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

JSON format for geometry_msgs/PoseStamped

asked 2012-07-15 21:49:12 -0500

RJ gravatar image

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

ngrennan gravatar image

Hi,

I want to publish a JSON message type using PoseStamped through rosbridge, I tried searching online but there wasn't any information about it. So, how do I go about doing it?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
4

answered 2012-07-16 11:54:08 -0500

updated 2012-07-17 13:12:27 -0500

The structure of geometry_msgs/PoseStamped is documented here: http://ros.org/doc/api/geometry_msgs/html/msg/PoseStamped.html

A PoseStamped message in JSON would therefore look as follows:

{ 
    header: { 
        seq: <int>, 
        stamp:  {
            secs: <int>,
            nsecs: <int>
        },
        frame_id: <string>
    },
    pose: {
        position: {
            x: <float>,
            y: <float>,
            z: <float>
        },
        orientation: {
            x: <float>,
            y: <float>,
            z: <float>,
            w: <float>
        }
    }
}

The entire JSON message that you would send to rosbridge to publish the message would be:

{
    receiver: "/topic",
    type: "geometry_msgs/PoseStamped",
    msg: { ...as above... }
}

Cheers, Jon

edit flag offensive delete link more

Question Tools

Stats

Asked: 2012-07-15 21:49:12 -0500

Seen: 1,846 times

Last updated: Jul 17 '12