ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

How to use tf::poseMsgToEigen

asked 2018-02-08 12:16:52 -0500

JuanTelo gravatar image

Hi, I'm kind of confused on how I should use tf::poseMsgToEigen. I have

#include <tf/tf.h>
#include <tf/transform_listener.h>
#include <eigen_conversions/eigen_msg.h>

and

tf::TransformListener *tf_listener = NULL;
tf::poseMsgToEigen(end_target, end_effector_state);

end_target is in geometry_msgs::Pose and end_effector_state should be in the eigen form as the documentation suggests but I keep getting error such as:

no matching function for call to ‘poseMsgToEigen(geometry_msgs::Pose&, const Affine3d&)’
edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
2

answered 2018-02-08 17:03:22 -0500

The key is the const Affine3d& in your error. It's hard to tell without a complete code snippet, but it seems like the compiler thinks that end_effector_state is constant, and there isn't a function call that takes a const Affine3d&, only one that takes an Affine3d&. Your solution would be to initialize a different variable that isn't const and use that instead.

Eigen::Affine3d end_effector_mutable;
tf::poseMsgToEigen(end_target, end_effector_mutable);
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2018-02-08 12:16:52 -0500

Seen: 1,489 times

Last updated: Feb 08 '18