Convert a C{geometry_msgs/Pose} into position/quaternion np arrays @param msg: ROS message to be converted @return: - p: position as a np.array - q: quaternion as a numpy array (order = [x,y,z,w])
(msg)
| 11 | import numpy as np |
| 12 | |
| 13 | def pose_to_pq(msg): |
| 14 | """Convert a C{geometry_msgs/Pose} into position/quaternion np arrays |
| 15 | |
| 16 | @param msg: ROS message to be converted |
| 17 | @return: |
| 18 | - p: position as a np.array |
| 19 | - q: quaternion as a numpy array (order = [x,y,z,w]) |
| 20 | """ |
| 21 | p = np.array([msg.position.x, msg.position.y, msg.position.z]) |
| 22 | q = np.array([msg.orientation.x, msg.orientation.y, |
| 23 | msg.orientation.z, msg.orientation.w]) |
| 24 | return p, q |
| 25 | |
| 26 | |
| 27 | def pose_stamped_to_pq(msg): |
no outgoing calls
no test coverage detected