-
-
Save protortyp/be3a32b4216a2a7431049260c1b80e63 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import rospy | |
import tf | |
from geometry_msgs.msg import Quaternion | |
# Create a quaternion object | |
quat = Quaternion() | |
quat.x = 0.1 | |
quat.y = 0.2 | |
quat.z = 0.3 | |
quat.w = 0.4 | |
# Convert the quaternion to a rotation matrix | |
rot_matrix = tf.transformations.quaternion_matrix([quat.x, quat.y, quat.z, quat.w]) | |
# Print the rotation matrix | |
rospy.loginfo("Rotation matrix:\n{}".format(rot_matrix)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment