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

Revision history [back]

click to hide/show revision 1
initial version

I just found the error. It is in here

robot.OdomCombinedSubscriber = nh.subscribe<nav_msgs::odometry>("/robot_pose_ekf/odom_combined", 10, &TurtlebotRobot::OdometryCombinedCallback, &robot);

The message type should be geometry_msgs::PoseWithCovarianceStamped and not <nav_msgs::odometry>

I changed instruction to robot.OdomCombinedSubscriber = nh.subscribe<geometry_msgs::posewithcovariancestamped>("/robot_pose_ekf/odom_combined", 10, &TurtlebotRobot::OdometryCombinedCallback, &robot); and it worked!

I just found the error. It is in here

robot.OdomCombinedSubscriber = nh.subscribe<nav_msgs::odometry>("/robot_pose_ekf/odom_combined", 10, &TurtlebotRobot::OdometryCombinedCallback, &robot);

&robot);

The message type should be geometry_msgs::PoseWithCovarianceStamped geometry_msgs::PoseWithCovarianceStamped and not <nav_msgs::odometry>nav_msgs::odometry

I changed instruction to

robot.OdomCombinedSubscriber = nh.subscribe<geometry_msgs::posewithcovariancestamped>("/robot_pose_ekf/odom_combined", nh.subscribe<geometry_msgs::PoseWithCovarianceStamped>("/robot_pose_ekf/odom_combined", 10,  &TurtlebotRobot::OdometryCombinedCallback, &robot);

and it worked!