rotate()¶
Rotate the robot (left or right).
Reference¶
Arguments¶
Arguments |
Type |
Default value |
|
|---|---|---|---|
angle |
|
The angle of movement. Positive values will rotate the robot left, and negative values will rotate the robot to the right |
|
angular_speed |
|
Rotational velocity[d/s]. Value must be positive |
|
ca llback_feedback |
|
|
Callable function for feedback (optional). |
callback_finish |
|
|
Callable function for finish (optional). |
wait |
|
|
Wait until the movement finishes before moving to the next line of code. |
ang_unit |
|
|
unit of measurement for angle (DEGREES or RADIANS). |
Return¶
None
Exceptions¶
RayaWrongArgumentRayaAlreadyMoving
See the complete list of motion exceptions.
Usage Example¶
Move forward 2 meters (1 meter/second velocity) and wait until it finish moving those 2 meters before moving to the next line of code:
...
class RayaApplication(RayaApplicationBase):
async def setup(self):
self.motion = await self.enable_controller('motion')
....
async def loop(self):
....
await self.motion.rotate(
angle=-1.5708,
angular_speed=0.349,
ang_unit=ANG_UNIT.RAD,
callback_finish=self.cb_motion_finished
)
...
async def finish(self):
...
See the Motion example to check some valid uses.