This commit is contained in:
Max Hunt 2020-03-09 15:53:43 +00:00
parent 787bb62378
commit 0d0fb8fee8

View File

@ -1,3 +1,4 @@
clear
#!/usr/bin/python #!/usr/bin/python
import argparse import argparse
import struct import struct
@ -131,11 +132,11 @@ def cleanup():
def etq(roll, pitch, yaw): #Euler To Quaternian def etq(roll, pitch, yaw): #Euler To Quaternian
'''calculates Quaternian from euler angles''' '''calculates Quaternian from euler angles'''
qx = np.sin(roll/2) * np.cos(pitch/2) * np.cos(yaw/2) - np.cos(roll/2) * np.sin(pitch/2) * np.sin(yaw/2) qx = np.sin(roll/2) * np.cos(pitch/2) * np.cos(yaw/2) - np.cos(roll/2) * np.sin(pitch/2) * np.sin(yaw/2)
qy = np.cos(roll/2) * np.sin(pitch/2) * np.cos(yaw/2) + np.sin(roll/2) * np.cos(pitch/2) * np.sin(yaw/2) qy = np.cos(roll/2) * np.sin(pitch/2) * np.cos(yaw/2) + np.sin(roll/2) * np.cos(pitch/2) * np.sin(yaw/2)
qz = np.cos(roll/2) * np.cos(pitch/2) * np.sin(yaw/2) - np.sin(roll/2) * np.sin(pitch/2) * np.cos(yaw/2) qz = np.cos(roll/2) * np.cos(pitch/2) * np.sin(yaw/2) - np.sin(roll/2) * np.sin(pitch/2) * np.cos(yaw/2)
qw = np.cos(roll/2) * np.cos(pitch/2) * np.cos(yaw/2) + np.sin(roll/2) * np.sin(pitch/2) * np.sin(yaw/2) qw = np.cos(roll/2) * np.cos(pitch/2) * np.cos(yaw/2) + np.sin(roll/2) * np.sin(pitch/2) * np.sin(yaw/2)
return [qx, qy, qz, qw] return [qx, qy, qz, qw]
def spawn_v_brick(): def spawn_v_brick():
'''Spawns Vertical brick in Gazebo simulation''' '''Spawns Vertical brick in Gazebo simulation'''