Skip to content

Instantly share code, notes, and snippets.

@protortyp
Created March 19, 2023 09:10
Show Gist options
  • Save protortyp/f4df832dfa36c9786e395086b8d8156e to your computer and use it in GitHub Desktop.
Save protortyp/f4df832dfa36c9786e395086b8d8156e to your computer and use it in GitHub Desktop.
# Wait for the transform to become available
listener.waitForTransform('/base_link', '/end_effector', rospy.Time(), rospy.Duration(4.0))
# Get the transformation matrix from the robot base to the end effector
(trans, rot) = listener.lookupTransform('/base_link', '/end_effector', rospy.Time(0))
rot_matrix = tf.transformations.quaternion_matrix(rot)
transformation_matrix = tf.transformations.concatenate_matrices(rot_matrix, tf.transformations.translation_matrix(trans))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment