move_linear()
- 1 Minute to read
move_linear()
- 1 Minute to read
Article summary
Did you find this summary helpful?
Thank you for your feedback
move_linear()
Move the robot in linear direction, for a given distance [meters].
Reference
Arguments
Arguments | Type | Default value | |
---|---|---|---|
distance | float | The distance of movement, in meters [m]. If distance is negative, the robot will move backwards | |
x_velocity | float | Forward velocity, in meters per second [m/s]. Value must be positive | |
callback | func | None | If you define a callback, it will be called when the movement finishes. |
wait | bool | false | Wait until the movement finishes before moving to next line of code. |
Return
None
Exceptions
Exception | Condition |
---|---|
RayaWrongArgument | Distance is not positive. |
RayaAlreadyMoving | There is another motion command in progress. |
RayaBridgeException | Command was rejected by bridge. |
See the complete list of Raya Exceptions.
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:
await motion.move_linear(distance = 2, x_velocity=1.0, wait=True)
Was this article helpful?