11 #include <geometry_msgs/PoseWithCovariance.h> 12 #include <geometry_msgs/Pose.h> 13 #include <geometry_msgs/Quaternion.h> 17 #include <Eigen/Dense> 21 #if MRPT_VERSION >= 0x199 22 #define getAsVectorVal asVectorVal 29 const double roll,
const double pitch,
const double yaw)
34 rotation.
setRPY(roll, pitch, yaw);
44 for (
int i = 0; i < 3; i++)
45 for (
int j = 0; j < 3; j++)
49 TEST(PoseConversions, copyMatrix3x3ToCMatrixDouble33)
54 for (
int r = 0;
r < 3;
r++)
57 TEST(PoseConversions, copyCMatrixDouble33ToMatrix3x3)
60 for (
int r = 0;
r < 3;
r++)
61 for (
int c = 0;
c < 3;
c++) src(
r,
c) = 12.0 +
r * 4 -
c * 2 +
r *
c;
65 for (
int r = 0;
r < 3;
r++)
80 TEST(PoseConversions, reference_frame_change_with_rotations)
84 ros_msg_original_pose.pose.position.x = 1;
85 ros_msg_original_pose.pose.position.y = 0;
86 ros_msg_original_pose.pose.position.z = 0;
87 ros_msg_original_pose.pose.orientation.x = 0;
88 ros_msg_original_pose.pose.orientation.y = 0;
89 ros_msg_original_pose.pose.orientation.z = 0;
90 ros_msg_original_pose.pose.orientation.w = 1;
96 ros_msg_original_pose.pose.position.x, mrpt_original_pose.
mean[0]);
104 double yaw =
M_PI / 2.0;
111 rotation_tf.
setRPY(0, 0, yaw);
115 tf::Pose tf_result = rotation_pose_tf * tf_original_pose;
127 double x,
double y,
double z,
double yaw,
double pitch,
double roll)
139 EXPECT_NEAR(ros_p3D.position.x, p3D.
x(), 1e-4) <<
"p: " << p3D << endl;
140 EXPECT_NEAR(ros_p3D.position.y, p3D.
y(), 1e-4) <<
"p: " << p3D << endl;
141 EXPECT_NEAR(ros_p3D.position.z, p3D.z(), 1e-4) <<
"p: " << p3D << endl;
143 EXPECT_NEAR(ros_p3D.orientation.x, q.
x(), 1e-4) <<
"p: " << p3D << endl;
144 EXPECT_NEAR(ros_p3D.orientation.y, q.
y(), 1e-4) <<
"p: " << p3D << endl;
145 EXPECT_NEAR(ros_p3D.orientation.z, q.
z(), 1e-4) <<
"p: " << p3D << endl;
146 EXPECT_NEAR(ros_p3D.orientation.w, q.
r(), 1e-4) <<
"p: " << p3D << endl;
159 <<
"p_bis: " << p_bis << endl
160 <<
"p3D: " << p3D << endl;
180 TEST(PoseConversions, check_CPose2D_to_ROS)
200 <<
"p3D_ros: " << p3D_ros << endl
201 <<
"p3D: " << p3D << endl;
GLint GLint GLint GLint GLint GLint y
void getAsQuaternion(mrpt::math::CQuaternionDouble &q, mrpt::math::CMatrixFixedNumeric< double, 4, 3 > *out_dq_dr=NULL) const
static void poseMsgToTF(const geometry_msgs::Pose &msg, Pose &bt)
void checkPoseMatrixFromRotationParameters(const double roll, const double pitch, const double yaw)
void setFromValues(const double x0, const double y0, const double z0, const double yaw=0, const double pitch=0, const double roll=0)
#define EXPECT_NEAR(val1, val2, abs_error)
GLint GLint GLint GLint GLint x
void setRPY(const tfScalar &roll, const tfScalar &pitch, const tfScalar &yaw)
double DEG2RAD(const double x)
bool convert(const mrpt_msgs::ObservationRangeBeacon &_msg, const mrpt::poses::CPose3D &_pose, mrpt::obs::CObservationBeaconRanges &_obj)
TEST(PoseConversions, copyMatrix3x3ToCMatrixDouble33)
void getRotationMatrix(mrpt::math::CMatrixDouble33 &ROT) const
#define EXPECT_EQ(val1, val2)
mrpt::math::CVectorDouble getAsVectorVal() const
GLdouble GLdouble GLdouble r
#define EXPECT_FLOAT_EQ(val1, val2)
GLdouble GLdouble GLdouble GLdouble q
void setYawPitchRoll(const double yaw_, const double pitch_, const double roll_)
void check_CPose3D_tofrom_ROS(double x, double y, double z, double yaw, double pitch, double roll)