Motion
- 1 Minute to read
Motion
- 1 Minute to read
Article summary
Did you find this summary helpful?
Thank you for your feedback
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
Arguments | Type | Default value | |
---|---|---|---|
x_velocity | float | Forward (positive) or backward (negative) velocity, in meters per second [m/s] | |
y_velocity | float | Lateral left (positive) or right (negative) velocity, in meters per second [m/s] | |
angular_velocity | float | Rotational velocity. Positive: left. Negative: right. In radians per second [rad/s] | |
duration | float | Time (in seconds) to move at the selected velocity. | |
callback | function | If you define a callback, it will be called when the movement finishes. | |
wait | bool | false | Wait until the movementfinishes before moving to the next line of code |
Return
None
3. Example
Was this article helpful?