move_linear()¶
Move the robot in linear direction, for a given distance [meters].
Reference¶
Arguments¶
Arguments |
Type |
Default value |
|
|---|---|---|---|
distance |
|
The distance of movement, in meters [m]. Distance must be positive. |
|
x_velocity |
|
x velocity, in meters per second [m/s] |
|
y_velocity |
|
|
y velocity, in meters per second [m/s] |
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. |
Return¶
None
Exceptions¶
RayaWrongArgumentRayaAlreadyMovingRayaNotValidMotionCommand
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 motion.move_linear(distance = 2, x_velocity=1.0, wait=True)
...
async def finish(self):
...
See the Motion example to check some valid uses.