2. Omni Move

In this project, you will learn how to move the Zeus Car to 0, 45, 90, 135, 180, 225, 270, and 315 degrees.

If you ignore the friction on the ground and the structural tolerances, its path should be an octagon and eventually return to the origin.

How to do?

  1. The ESP32-CAM and the Arduino board share the same RX (receive) and TX (transmit) pins. So, when you’re uploading code, you’ll need to first disconnect the ESP32-CAM to avoid any conflicts or potential issues.

    ../_images/unplug_cam1.png
  2. Open the 2_omni_move.ino file under the path of zeus-car-main\examples\2_omni_move.

  3. Select the correct board and port, then click the Upload button.

    Note

    • If you get a “Compilation error: SoftPWM.h: No such file or directory” prompt, it means you don’t have the SoftPWM library installed.

    • Please refer to Install the Required Libraries to install the two required libraries SoftPWM and IRLremote.

    ../_images/ar_board_upload.png
  4. Turn the power switch to ON to start the Zeus Car.

    ../_images/zeus_power.jpg
  5. At this point the Zeus Car will move to 0, 45, 90, 135, 180, 225, 270, and 315 degrees.

How it works?

The movement of the Zeus Car is mainly implemented by this function.

void carMove(int16_t angle, int8_t power)
  • angle: The direction you want the car to move. use the head of the car as the 0 degree and increase the angle in counterclockwise direction.

  • power: The moving power, the range is -100% ~ 100%. When power is positive, the car moves forward, and vice versa, it moves backward.