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

3D plot from geometry_msgs/Pose message

asked 2013-07-11 10:11:35 -0600

Pino gravatar image

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

ngrennan gravatar image

Hello,

I'm trying to make a 3D plot from data collected by a kinect. For this I recorded a bag file and can echo the topic using:

$ rostopic echo mono_depth_odometer/pose

Which outputs a message like this:

    ---
header: 
  seq: 66
  stamp: 
    secs: 1373486339
    nsecs: 909821489
  frame_id: /base_link
pose: 
  position: 
    x: 3.7901529439e-05
    y: 5.22536844969e-05
    z: 0.000106685859698
  orientation: 
    x: 7.32867424846e-06
    y: -2.76516487714e-06
    z: -8.7403562356e-06
    w: 0.999999999931
---

Now I would like to plot this in 3D. I have succesfully done this before with

rxplot --mode=3d topic1 topic2 topic3

So now I've tried this with different combinations with no success, for example:

$ rxplot --mode=3d mono_depth_odometer/position/x mono_depth_odometer/position/y mono_depth_odometer/position/z
$ rxplot --mode=3d mono_depth_odometer/position.x mono_depth_odometer/position.y mono_depth_odometer/position.z

What is the correct way to access the axis data in the message?

Thank you,

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2013-07-11 11:34:59 -0600

fergs gravatar image

updated 2013-07-12 07:21:35 -0600

You need to specify the 'pose' part:

 rxplot --mode=3d mono_depth_odometer/pose/pose/position/x mono_depth_odometer/pose/pose/position/y mono_depth_odometer/pose/pose/position/z
edit flag offensive delete link more

Comments

Tried this, got this error back: Invalid topic spec [/mono_depth_odometer/pose/position/x]: 'PoseStamped' object has no attribute 'position'

Pino gravatar image Pino  ( 2013-07-12 07:14:29 -0600 )edit

oops, missed that you were echoing "mono_depth_odometer/pose" in that case, see updated answer.

fergs gravatar image fergs  ( 2013-07-12 07:20:52 -0600 )edit

It now works, thank you. How is it there are two (/pose/pose/) subtopics? I didn't see this in the gometry_msgs/Pose documentation ( http://www.ros.org/doc/api/geometry_msgs/html/msg/Pose.html )

Pino gravatar image Pino  ( 2013-07-12 08:38:19 -0600 )edit
1

What is the message type of mono_depth_odometer? I'm not familiar with any packages that publish such a topic. Basically, whatever that message type is, it has a PoseStamped within it, thus geometry_msgs::PoseStamped has a field called header, and a field called pose, with X/Y/Z, and then the ...

fergs gravatar image fergs  ( 2013-07-12 16:31:26 -0600 )edit
1

... depth_odom message is calling the geometry_msgs::PoseStamped "pose" thus, "pose/pose".

fergs gravatar image fergs  ( 2013-07-12 16:32:57 -0600 )edit

Question Tools

Stats

Asked: 2013-07-11 10:11:35 -0600

Seen: 1,852 times

Last updated: Jul 12 '13