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

Revision history [back]

You should probably use ROS data types instead of trying to just have a multi-dimensional array of floats. This would make it much easier to directly interpret what's inside each message.

What you really want to do is send a list of poses (= translation + orientation), correct? In that case, your message could look like this:

MyPoseList.msg

Header header
geometry_msgs/Pose[] poses

To get the x dimension of the first pose, you would write mymsg.poses[0].position.x.

Two more things:

  • Rotations are encoded as quaternions in ROS, not as Euler angles (roll-pitch-yaw). The Pose message has a orientation field that's a quaternion. Please search other answers here that explain how to convert between quaternions and Euler angles.
  • A pose doesn't mean anything if you don't know at what time and in what reference frame it is specified, that's why you need the header field. It would perhaps be better to remove the header field and instead use PoseStamped messages; that way, you could specify a different time stamp for each pose.