Skip to content

Instantly share code, notes, and snippets.

@baalexander
Created March 22, 2013 22:03
Show Gist options
  • Save baalexander/5225140 to your computer and use it in GitHub Desktop.
Save baalexander/5225140 to your computer and use it in GitHub Desktop.
Euler to Quaternion transformation
from tf import transformations
# Docs for transformations.quaternion_from_euler
# You can get docs with transformations.quaternion_from_euler? and enter
#ai, aj, ak : Euler's roll, pitch and yaw angles
#axes : One of 24 axis sequences as string or encoded tuple
#q = quaternion_from_euler(1, 2, 3, 'ryxz')
#numpy.allclose(q, [0.310622, -0.718287, 0.444435, 0.435953])
transformations.quaternion_from_euler(0, 0, -1.550)
#Output: array([ 0. , 0. , -0.69971608, 0.71442103])
@baalexander
Copy link
Author

You'll need to sudo apt-get install ros-groovy-tf and source /opt/ros/groovy/setup.bash first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment