We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2c25373 commit 4f9b8d5Copy full SHA for 4f9b8d5
1 file changed
vortex_utils/ros_converter.py
@@ -0,0 +1,11 @@
1
+from python_utils import Pose, Twist, quat_to_euler
2
+from geometry_msgs.msg import Pose as PoseMsg
3
+from geometry_msgs.msg import Twist as TwistMsg
4
+
5
+def pose_from_ros(pose_msg: PoseMsg) -> Pose:
6
+ quat = pose_msg.orientation
7
+ euler_angles = quat_to_euler(quat.x, quat.y, quat.z, quat.w)
8
+ return Pose(pose_msg.position.x, pose_msg.position.y, pose_msg.position.z, *euler_angles)
9
10
+def twist_from_ros(twist_msg: TwistMsg) -> Twist:
11
+ return Twist(twist_msg.linear.x, twist_msg.linear.y, twist_msg.linear.z, twist_msg.angular.x, twist_msg.angular.y, twist_msg.angular.z)
0 commit comments