Ask Your Question
1

Error reading /odom topic

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

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 -0500

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 imageMcMurdo ( 2013-02-27 11:46:30 -0500 )edit

This helped me so much!!

apletta gravatar imageapletta ( 2019-07-03 05:39:59 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

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

Seen: 557 times

Last updated: Feb 27 '13