I want to publish tf2_msgs/TFMessage and I m getting no matching function for call to ‘error: no matching function for call to ‘geometry_msgs::TransformStamped_<std::allocator<void>

asked 2021-03-14 16:05:52 -0600

alexspi13 gravatar image

Hello I'm trying to run this piece of code to publish data in tf topic for visualise movement from my real robot to rviz.

rviz_publisher = n->advertise<tf2_msgs::TFMessage>("/tf", 200);
transform.rotation.w = 1;
transform.translation.y = 0.3;
transform.translation.z = 0.0;
transform.rotation.z = 1.0;
header.stamp.now();
header.frame_id = "link_left_f_2";
left_wheel_front->transforms.emplace_back(header);
left_wheel_front->transforms.emplace_back(transform);

And I get this error:

/usr/include/c++/7/ext/new_allocator.h:136: error: no matching function for call to ‘geometry_msgs::TransformStamped_<std::allocator<void> >::TransformStamped_(std_msgs::Header_<std::allocator<void> >&)’{ ::new((void *)__p) _Up(std::forward<_Args>(__args)...); }^

Any help is appreciated. I have tried different ways and always fall into a barrier. Please I really need help!

edit retag flag offensive close merge delete