36 #include <geometry_msgs/PoseWithCovariance.h> 37 #include <geometry_msgs/Pose.h> 38 #include <geometry_msgs/Quaternion.h> 41 #include <mrpt/version.h> 42 #if MRPT_VERSION < 0x199 45 #include <mrpt/core/exceptions.h> 53 for (
int r = 0;
r < 3;
r++)
54 for (
int c = 0;
c < 3;
c++) _des(
r,
c) = _src[
r][
c];
61 for (
int r = 0;
r < 3;
r++)
62 for (
int c = 0;
c < 3;
c++) _des[
r][
c] = _src(
r,
c);
89 const unsigned int indxs_map[6] = {0, 1, 2,
92 for (
int i = 0; i < 6; i++)
94 for (
int j = 0; j < 6; j++)
96 _des.covariance[indxs_map[i] * 6 + indxs_map[j]] = _src.
cov(i, j);
129 _des.
x() = t[0], _des.
y() = t[1], _des.z() = t[2];
141 _des.position.x = _src[0];
142 _des.position.y = _src[1];
143 _des.position.z = _src[2];
148 _des.orientation.x = q.
x();
149 _des.orientation.y = q.
y();
150 _des.orientation.z = q.
z();
151 _des.orientation.w = q.
r();
160 _des.position.x = _src.
x();
161 _des.position.y = _src.
y();
164 const double yaw = _src.
phi();
165 if (std::abs(yaw) < 1e-10)
167 _des.orientation.x = 0.;
168 _des.orientation.y = 0.;
169 _des.orientation.z = .5 * yaw;
170 _des.orientation.w = 1.;
174 const double s = ::sin(yaw * .5);
175 const double c = ::cos(yaw * .5);
176 _des.orientation.x = 0.;
177 _des.orientation.y = 0.;
178 _des.orientation.z = s;
179 _des.orientation.w = c;
189 _des.position.x = _src.
x;
190 _des.position.y = _src.
y;
193 const double yaw = _src.
phi;
194 if (std::abs(yaw) < 1e-10)
196 _des.orientation.x = 0.;
197 _des.orientation.y = 0.;
198 _des.orientation.z = .5 * yaw;
199 _des.orientation.w = 1.;
203 const double s = ::sin(yaw * .5);
204 const double c = ::cos(yaw * .5);
205 _des.orientation.x = 0.;
206 _des.orientation.y = 0.;
207 _des.orientation.z = s;
208 _des.orientation.w = c;
217 _des.
x(_src.position.x);
218 _des.
y(_src.position.y);
221 convert(_src.orientation, quat);
224 quat.
rpy(roll, pitch, yaw);
252 _des.covariance[0] = _src.
cov(0, 0);
253 _des.covariance[1] = _src.
cov(0, 1);
254 _des.covariance[5] = _src.
cov(0, 2);
255 _des.covariance[6] = _src.
cov(1, 0);
256 _des.covariance[7] = _src.
cov(1, 1);
257 _des.covariance[11] = _src.
cov(1, 2);
258 _des.covariance[30] = _src.
cov(2, 0);
259 _des.covariance[31] = _src.
cov(2, 1);
260 _des.covariance[35] = _src.
cov(2, 2);
282 const unsigned int indxs_map[6] = {0, 1, 2, 5, 4, 3};
284 for (
int i = 0; i < 6; i++)
286 for (
int j = 0; j < 6; j++)
288 _des.
cov(i, j) = _src.covariance[indxs_map[i] * 6 + indxs_map[j]];
301 _src, mrpt_gaussian);
313 _des.
cov(0, 0) = _src.covariance[0];
314 _des.
cov(0, 1) = _src.covariance[1];
315 _des.
cov(0, 2) = _src.covariance[5];
316 _des.
cov(1, 0) = _src.covariance[0 + 6];
317 _des.
cov(1, 1) = _src.covariance[1 + 6];
318 _des.
cov(1, 2) = _src.covariance[5 + 6];
319 _des.
cov(2, 0) = _src.covariance[0 + 30];
320 _des.
cov(2, 1) = _src.covariance[1 + 30];
321 _des.
cov(2, 2) = _src.covariance[5 + 30];
372 _src.orientation.w, _src.orientation.x, _src.orientation.y,
385 q, _src.position.x, _src.position.y, _src.position.z);
void getAsQuaternion(mrpt::math::CQuaternionDouble &q, mrpt::math::CMatrixFixedNumeric< double, 4, 3 > *out_dq_dr=NULL) const
void copyFrom(const CPosePDF &o) MRPT_OVERRIDE
const double & phi() const
void rpy(T &roll, T &pitch, T &yaw) const
mrpt::math::CMatrixDouble66 cov
bool convert(const mrpt_msgs::ObservationRangeBeacon &_msg, const mrpt::poses::CPose3D &_pose, mrpt::obs::CObservationBeaconRanges &_obj)
void copyFrom(const CPose3DPDF &o) MRPT_OVERRIDE
void getRotationMatrix(mrpt::math::CMatrixDouble33 &ROT) const
GLdouble GLdouble GLdouble r
GLdouble GLdouble GLdouble GLdouble q
void copyFrom(const CPosePDF &o) MRPT_OVERRIDE
void setRotationMatrix(const mrpt::math::CMatrixDouble33 &ROT)
void copyFrom(const CPose3DPDF &o) MRPT_OVERRIDE
mrpt::math::CMatrixDouble33 cov