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

message filters PoseWithCovarianceStamped

asked 2015-04-06 01:35:12 -0500

Rahndall gravatar image

updated 2015-04-06 01:35:28 -0500

Dear Ros Users, I tried to use a message filters to sync two PoseWithCovarianceStamped topics

void callback(const geometry_msgs::PoseWithCovarianceStampedPtr& pose_1, const geometry_msgs::PoseWithCovarianceStampedPtr& pose_2)
{
  ...
}
message_filters::Subscriber<geometry_msgs::posewithcovariancestamped> pose_sub_1(nh, "pose_1", 1);
message_filters::Subscriber<geometry_msgs::posewithcovariancestamped> pose_sub_2(nh, "pose_2", 1);
message_filters::TimeSynchronizer <geometry_msgs::PoseWithCovarianceStamped, geometry_msgs::PoseWithCovarianceStamped> sync(pose_sub_1, pose_sub_2, 10);
sync.registerCallback(boost::bind(&callback, _1, _2));

but I got error at compile time:

/usr/include/boost/bind/bind.hpp:313:34: error: invalid initialization of reference of type ‘const boost::shared_ptr<geometry_msgs::posewithcovariancestamped_<std::allocator<void> > >&’ from expression of type ‘const boost::shared_ptr<const geometry_msgs::posewithcovariancestamped_<std::allocator<void=""> > >’ unwrapper<f>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_]);

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2017-07-28 14:45:09 -0500

Leo Campos gravatar image

This error message is trying to tell you that it expects your callback to take a boost::shared_ptr (or the ConstPtr message subtype) for the first argument; not a reference to a object.

Try this instead:

void callback(const geometry_msgs::PoseWithCovarianceStampedConstPtr& pose_1, const geometry_msgs::PoseWithCovarianceStampedConstPtr& pose_2)
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2015-04-06 01:35:12 -0500

Seen: 703 times

Last updated: Apr 06 '15