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]. Distance must be positive.

x_velocity

float

x velocity, in meters per second [m/s]

y_velocity

float

0.0

y velocity, in meters per second [m/s]

ca llback_feedback

Callable

None

Callable function for feedback (optional).

callback_finish

Callable

None

Callable function for finish (optional).

wait

bool

false

Wait until the movement finishes before moving to the next line of code.

Return

None

Exceptions

  • RayaWrongArgument

  • RayaAlreadyMoving

  • RayaNotValidMotionCommand

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.