Motion
  • 1 Minute to read

Motion


Article summary

1. Overview

This controller allows you to move the robot in any direction that you want.

This controller gives direct movement commands to the robot and it doesn't include path planning or obstacle avoidance algorithms. Please refer to the Navigation controller if you want to navigate instead of just moving. 

2. Using the controller

from raya.application_base import RayaApplicationBase

class RayaApplication(RayaApplicationBase):
    async def setup(self):
        ...
        self.sound = await self.enable_controller('motion')
        ...


The controller class includes a set of methods to control the motion of the robot:

  • move_linear()
  • rotate()
  • set_velocity()
  • await_until_stop()
  • cancel_motion()
  • is_moving()

Reference

Arguments

ArgumentsTypeDefault value
x_velocityfloat
Forward (positive) or backward (negative) velocity, in meters per second [m/s]
y_velocityfloat
Lateral left (positive) or right (negative) velocity, in meters per second [m/s]
angular_velocityfloat
Rotational velocity. Positive: left. Negative: right. In radians per second [rad/s]
durationfloat
Time (in seconds) to move at the selected velocity.
callbackfunction
If you define a callback, it will be called when the movement finishes.
waitboolfalseWait until the movementfinishes before moving to the next line of code

Return

None

3. Example


Was this article helpful?

What's Next