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

Error reading /odom topic

asked 2013-02-27 02:29:21 -0600

McMurdo gravatar image

When I write code to read the odometry data, I get errors while compiling.

void test::odom_callback(const nav_msgs::Odometry::ConstPtr& odom_reading)

is the function i use. And I have also done in the constructor of the class:

odom_listener = n.subscribe("odom", 10, test::odom_callback, this);

The dependency has been mentioned in manifest.xml. I have also included the nav_msgs/Odometry.h file

I get this error: In member function ‘void test::odom_callback(const ConstPtr&)’:

error: ‘const ConstPtr’ has no member named ‘twist’

Please help.

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
6

answered 2013-02-27 02:57:12 -0600

dornhege gravatar image

Use odom_reading->twist instead of odom_reading.twist.

edit flag offensive delete link more

Comments

SHIT! SUCH A BASIC C++ ERROR! THANKS A TON!

McMurdo gravatar image McMurdo  ( 2013-02-27 11:46:30 -0600 )edit

This helped me so much!!

apletta gravatar image apletta  ( 2019-07-03 05:39:59 -0600 )edit

Question Tools

Stats

Asked: 2013-02-27 02:29:21 -0600

Seen: 839 times

Last updated: Feb 27 '13