move_linear()
  • 1 Minute to read

move_linear()


Article summary

move_linear()

Move the robot in linear direction, for a given distance [meters].

Reference

Arguments

ArgumentsTypeDefault value
distancefloatThe distance of movement, in meters [m]. If distance is negative, the robot will move backwards
x_velocityfloatForward velocity, in meters per second [m/s]. Value must be positive
callbackfuncNoneIf you define a callback, it will be called when the movement finishes.
waitboolfalseWait until the movement finishes before moving to next line of code.

Return

None

Exceptions

ExceptionCondition
RayaWrongArgumentDistance is not positive.
RayaAlreadyMovingThere is another motion command in progress.
RayaBridgeExceptionCommand 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?