0
$\begingroup$

Rosanswers logo

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.


Originally posted by McMurdo on ROS Answers with karma: 1247 on 2013-02-27

Post score: 1

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Use odom_reading->twist instead of odom_reading.twist.


Originally posted by dornhege with karma: 31395 on 2013-02-27

This answer was ACCEPTED on the original site

Post score: 6


Original comments

Comment by McMurdo on 2013-02-27:
SHIT! SUCH A BASIC C++ ERROR! THANKS A TON!

Comment by apletta on 2019-07-03:
This helped me so much!!

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.