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

Plot poseStamped topic in rqt_plot/RViz

asked 2016-12-09 06:32:48 -0500

fabbro gravatar image

Hi,

I have a topic which is built like that:

int32 id
float64 size
geometry_msgs/PoseStamped pose

I am seeing it if I do rostopic list and rostopic echo without any problem. I would like to see it through rqt_plot and/or RViz but I am not able to do so.

The topic is named

/apriltag2_detections

I do

rosrun rqt_plot rqt_plot

And I can arrive only to see the field id and size. Like from the following screenshot (you can also see a rostopic echo output on the right of the image):

image description

Could you tell me why? What am I doing wrong?

Thanks a lot for the help.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2016-12-09 10:49:06 -0500

rbbg gravatar image

updated 2016-12-12 09:37:52 -0500

gvdhoorn gravatar image

Hi fabbro,

Because detections is an array, you will have to add /apriltag2_tag_detections/detections[0]/pose/pose/position and /apriltag2_tag_detections/detections[0]/pose/pose/orientation to rqt_plot to plot the values of the first detection.

As for showing this pose in Rviz, I don't think Rviz is able to do that by default, but if you (also) publish just the pose on a separate topic, you can add a Pose display to Rviz that subscribes to that topic.

You can use topic_tools (wiki link) to automatically transform your messages to a geometry_msgs/Pose by running:

rosrun topic_tools transform /apriltag2_tag_detections /apriltag2_tag_detections_pose geometry_msgs/Pose 'm.detections[0].pose.pose'

This will create a new topic that transforms your messages into poses that Rviz can easily visualize.

Good luck!

edit flag offensive delete link more

Comments

Hey, I tried to do that. But as you can see from my figure I can only add /apriltag2_tag_detections/detections I have no idea why.

fabbro gravatar image fabbro  ( 2016-12-11 15:47:44 -0500 )edit
1

Whoops just noticed a typo, should ofourse be apriltag2_tag_detections/detections/pose/pose/position. Did you try explicitly typing that whole string? or even apriltag2_tag_detections/detections/pose/pose/position/x? I have found that the suggestions that rqt makes aren't always complete..

rbbg gravatar image rbbg  ( 2016-12-11 23:53:58 -0500 )edit

I tried, yes, but it does not work. It is really strange for me.

fabbro gravatar image fabbro  ( 2016-12-12 01:57:15 -0500 )edit
1

I don't see where detections comes from in your msg definition, does that happen to an array? In that case you will need apriltag2_tag_detections/detections[0]/pose/pose/position

rbbg gravatar image rbbg  ( 2016-12-12 02:15:07 -0500 )edit

Yes, finally. This was the problem. I put apriltag2_tag_detections/detections[0]/pose/pose/position and it is working. If you edit your answer I can also accept it to reward the help you gave me :) . Thanks again.

fabbro gravatar image fabbro  ( 2016-12-12 02:42:32 -0500 )edit
1

edited, you're welcome!

rbbg gravatar image rbbg  ( 2016-12-12 03:03:55 -0500 )edit

Thanks, I also upvoted all your comments.

fabbro gravatar image fabbro  ( 2016-12-12 03:22:09 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2016-12-09 06:32:48 -0500

Seen: 2,586 times

Last updated: Dec 12 '16