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

How can I visualize the pose?

I don't believe you can. header.frame_id is used to determine in which frame the poses are expressed.

Without that information, RViz would not be able to determine relative to what those poses are supposed to be placed in the 3D space it manages (ie: the render volume).

What is the work around for this issue?

Off the top of my head, two options:

  1. use the rosbag API to fix the .bags. Iterate over all messages and correct header.frame_id, then write them back
  2. use topic_tools/transform to fix the header at runtime: <remap> the original topic coming out of rosbag (while playing) to something (say /bad_poses), now make transform subscribe to that and then have it do something like this:

    rosrun topic_tools transform \
      /bad_poses \
      /fixed_poses \
      geometry_msgs/PoseStamped \
      'geometry_msgs.msg.PoseStamped( \
        header=std_msgs.msg.Header(
          seq=m.header.seq,stamp=m.header.stamp, \
          frame_id="my_new_frame") \
        ,pose=m.pose)' \
      --import geometry_msgs std_msgs
    

    (note: I've chopped this up for readability, check whether the syntax is still valid, it's all a single line)

Suggestion 2 is actually the last example on the topic_tools/transform wiki page.

Suggestion 1 would of course be a permanent fix.

How can I visualize the pose?

I don't believe you can. header.frame_id is used to determine in which frame the poses are expressed.

Without that information, RViz would not be able to determine relative to what those poses are supposed to be placed in the 3D space it manages (ie: the render volume).

What is the work around for this issue?

Off the top of my head, two options:

  1. use the rosbag API to fix the .bags. Iterate over all messages and correct header.frame_id, then write them back
  2. use topic_tools/transform to fix the header at runtime: <remap> the original topic coming out of rosbag (while playing) to something (say /bad_poses), now make transform subscribe to that and then have it do something like this:

    rosrun topic_tools transform \
      /bad_poses \
      /fixed_poses /original_topic_in_the_bag \
      geometry_msgs/PoseStamped \
      'geometry_msgs.msg.PoseStamped( \
        header=std_msgs.msg.Header(
          seq=m.header.seq,stamp=m.header.stamp, \
          frame_id="my_new_frame") \
        ,pose=m.pose)' \
      --import geometry_msgs std_msgs
    

    (note: note: I've chopped this up for readability, check whether the syntax is still valid, it's all a single line)line.

    This will publish the fixed poses on /original_topic_in_the_bag (you'd use the correct topic name here of course). You could have it publish on anything, I don't know whether there are other components in your node graph which expect those poses to be published on the topic in the bag.

Suggestion 2 is actually the last example on the topic_tools/transform wiki page.

Suggestion 1 would of course be a permanent fix.