MCPcopy Create free account
hub / github.com/SAMMiCA/ChangeSim / rotateMultirotor

Function rotateMultirotor

script/utils/geo_transform.py:39–53  ·  view source on GitHub ↗
(client,dyaw=0.0)

Source from the content-addressed store, hash-verified

37 return [qx, qy, qz, qw]
38
39def rotateMultirotor(client,dyaw=0.0):
40 # init multirotor pose
41 pose = client.simGetVehiclePose()
42 roll, pitch, yaw = euler_from_quaternion(pose.orientation)
43 print('initial pose_quaternion:{}'.format(pose))
44 print('initial pose_euler:{} {} {}'.format(roll, pitch, yaw))
45 yaw += dyaw
46 qx, qy, qz, qw = euler_to_quaternion(yaw, pitch, roll)
47 pose.orientation.w_val = qw
48 pose.orientation.z_val = qz
49 pose.orientation.y_val = qy
50 pose.orientation.x_val = qx
51 client.simSetVehiclePose(pose, ignore_collison=True)
52 print('changed pose_quaternion:{}'.format(pose))
53 print('changed pose_euler:{} {} {}'.format(roll, pitch, yaw))

Callers

nothing calls this directly

Calls 2

euler_from_quaternionFunction · 0.85
euler_to_quaternionFunction · 0.85

Tested by

no test coverage detected