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

how to display robot_pose_ekf/odom_combined in rviz

asked 2013-08-26 16:03:35 -0600

dan gravatar image

updated 2014-01-28 17:17:45 -0600

ngrennan gravatar image

I have robot_pose_ekf running nicely, publishing both the transform odom_combined → base_footprint as well as the topic robot_pose_ekf/odom_combined (geometry_msgs/PoseWithCovarianceStamped)

The transform shows up well in rviz, reflecting robot moves correctly. But I am unable to see robot_pose_ekf/odom_combined. When I enter that topic as an odometry type, of course, I get a mismatch error (expecting nav_msgs/Odometry, received geometry_msgs/PoseWithCovarianceStamped, disconnecting). I also tried entering it as a Pose, but rviz then is looking for geometry_msgs/PoseStamped so the message again gets disconnected.

So how do I get robot_pose_ekf/odom_combined to display in rviz?

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
3

answered 2013-08-27 05:16:34 -0600

dan gravatar image

I think I partly figured this out. The odometry example from here: http://www.ros.org/wiki/navigation/Tutorials/RobotSetup/Odom publishes both an odometry topic and a transform. The odometry topic (along with an Imu topic) is subscribed to by robot_pose_ekf, which then publishes a PoseWithCovarianceStamped topic and a transform. The difference can be seen by comparing the two transforms. In general, seems like a bad idea to be publishing both transforms, since it breaks the transform tree structure to have two tfs relating the same relationships.

So my thought is to stop publishing the tf from the odometry node, only publish the odom Odometry topic from there and not bother publishing the PoseWithCovarianceStamped odom_combined topic from ekf (since I cannot find any subscribers to that topic) and only publish the tf from there.

Is that right? It feels weird and certainly is not discussed in the tutorials, so I suspect I am missing something important, but this is my best guess at this point.

edit flag offensive delete link more

Comments

1

Yes, you are right but you can publish both transforms without any problem. If the tree is broken it's because you put two parents to the same children.You can have one frame as origin, often this is odom and two children frames /pose and /pose2. check your TF tree to respect this constraint.

jep31 gravatar image jep31  ( 2013-08-27 21:04:10 -0600 )edit
0

answered 2013-08-26 20:50:48 -0600

jep31 gravatar image

updated 2013-08-26 20:51:27 -0600

Tf is good enough to visualize the position of your robot, it's even better than some arrows. Why do you want display a odometry type in rviz ? At worst it's easy to build a node to convert from PoseStamped to nav_msgs/Odometry, see the definition poseStamped and odometry. Odometry has also velocity terms and robot_pose_ekf only gives you a position. Odometry type in rviz display you a arrow in the position and oriented to the velocity direction.

edit flag offensive delete link more

Comments

I wanted to display it to compare with pure odometry, like the figure shown in http://www.ros.org/wiki/robot_pose_ekf Also, I am still learning ROS and seems like the planners and AMCL don't use the ekf topic. If it is not used in rviz or by the planners, why publish it at all? Where is it used?

dan gravatar image dan  ( 2013-08-27 04:38:19 -0600 )edit

Yes but if I remember it well, odometry in Rviz is not a path as you see. It's only a set of arrow with the last position and velocity. I would display also something like this graph to compare before and after filter but I don't know how. rxplot is not good enough to display two variables like this

jep31 gravatar image jep31  ( 2013-08-27 04:50:11 -0600 )edit

So I can suggest you to build two nav_msgs::Path with the set of positions before and after filtering. You can display this in rviz and have something similar to the tutorial.

jep31 gravatar image jep31  ( 2013-08-27 04:53:00 -0600 )edit

yes, either that or, as you suggest, just build a little node that converts PoseWithCovarianceStamped to PoseStamped, which rviz can display. See the extended answer below. I still don't think I have it right, but this is my overall best guess.

dan gravatar image dan  ( 2013-08-27 05:19:35 -0600 )edit

Question Tools

2 followers

Stats

Asked: 2013-08-26 16:03:35 -0600

Seen: 4,246 times

Last updated: Aug 27 '13