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

Revision history [back]

Forgetting about your mapping and slam setup, the way to get your robot position is to get a transform from your /base_frame to /map (and not /odom to /map, as ideally it should be constant and only changes due to drift errors, check the image in the bottom of this page). Once you have that transform, you can obtain the position of your robot using the getOrigin() method, as shown in this example.

bonus: if you want to try a very simple SLAM setup, I suggest you try hector_slam.

Forgetting about your mapping and slam setup, the way to get your robot position is to get a transform from your /base_frame to /map (and not /odom to /map, as ideally it should be constant and only changes due to drift errors, check the image in the bottom of this page). Once you have that transform, you can obtain the position of your robot using the getOrigin() method, as shown in this example.

bonus: if you want to try a very simple SLAM setup, I suggest you try hector_slam.

Forgetting about your mapping and slam setup, the way to get your robot position is to get a transform from your /base_frame to /map (and not /odom to /map, as ideally it should be constant and only changes due to drift errors, check the image in the bottom of this page). Once you have that transform, you can obtain the position of your robot using the getOrigin() method, as shown in this example.

related question here.

bonus: if you want to try a very simple SLAM setup, I suggest you try hector_slam.