convert_orientation()¶
Convert the orientation representation from either Euler angles (roll, pitch, yaw) or quaternion (x, y, z, w) to quaternion format.
Reference¶
Arguments¶
Arguments |
Type |
Default value |
Description |
|---|---|---|---|
orientation |
|
Dictionary representing the orientation. It can contain either Euler angles (roll, pitch, yaw) or quaternion (x, y, z, w). |
|
units |
|
|
The unit for the Euler angles. Default is degrees. |
Return¶
Type |
Description |
|---|---|
|
the keys are ( |
Exceptions¶
RayaWrongArgument
See the complete list of arms exceptions
Usage Example¶
...
async def setup(self):
self.arms: ArmsController = self.enable_controller('arms')
...
async def loop(self):
orientation= {
'roll': 90.0,
'pitch': 90.0
}
print(self.arms.convert_orientation(
orientation=orientation))
...
self.finish_app()
Output
{'x': 0.5, 'y': 0.5, 'z': -0.5, 'w': 0.5}