Square movement
Show code - python implementation
Show code - python implementation
This implementation uses the /move/relative endpoint to move the robot in a square.
We simply indicate where we want to move the robot relative to its current position.
square.py
Circle movement
Slow
Show code - python implementation
Show code - python implementation
Since it’s harder to control the robot’s position using relative movements to create a circle, we use the absolute movement instead.
We calculate the position of the robot in the circle using the sin and cos functions to create a circular motion.
circle_slow.py
Fast
Show code - python implementation
Show code - python implementation
To quicken the robots movements, we lower the number of steps in the circle.
We also increase the sleep time between each step to avoid the robot moving too fast.
circle_fast.py