This code is designed to control the ØILUS boat, integrating multiple services to handle different aspects of the boat's functionality. The system comprises four main services: ADService, CommService, MotorService, and OilusFSM, each playing a crucial role in ensuring smooth and responsive boat operation.
The ADService reads the analog value from a potentiometer, converting it into a duty cycle for a servo motor. This value is periodically updated and sent to the MotorService. The CommService facilitates communication between the boat and an external controller via UART, handling the reception and transmission of control messages. It decodes incoming commands and prepares appropriate responses. The MotorService is responsible for controlling the boat's motors and servos based on the commands received from the external controller. It adjusts the motor speed, rudder position, and manages the firing mechanism of the boat. Finally, the OilusFSM (Finite State Machine) coordinates the overall operation, managing states such as pairing with the controller, waiting for control commands, executing commands, and refueling. It ensures that the boat operates efficiently and responds correctly to control inputs.
Together, these services provide a comprehensive control system for the ØILUS boat, enabling precise and reliable navigation and operation.