The main FSM consists of two main state: paired state and unpaired state. The controller will be initialized at the unpaired state and transfers to paired state once received a control message following a pair message. It will post to different services according to the control received. There are different type of messages that the boat can react to the controller: pair acknowledgement and fuel status.
It has private functions to help send and receive message: message builders and decoder. The message builders are functions with pre-set message type and the decoder will extract useful information from the data received.
There are two servo motors on the boat: flag servo and rudder servo. The Flag servo has two position, paired and unpaired. It is initialized at the unpaired state; once the boat is paired, the main FSM will post to the service to make the servo change to paired position. The rudder servo position is mapped to POT reading received through control message from the controller.
There are two DC motors on the boat: propulsion motor and the pump motor. The propulsion motor has three modes: forward, static, and backwards, which is mapped to the POT reading. The pump motor is controlled by thee buttons from the controller: pressure increase, start/stop, and pressure decrease.
The main FSM consists of two main state: paired state and unpaired state. The controller will be initialized at the unpaired state and starts to pair with the boat upon pair button pressed. It will transfer to the pair state after receiving acknowledgement from the boat.
It has private functions to help send and receive message: message builders and decoder. The message builders are functions with pre-set message type and the decoder will extract useful information from the data received.
There are two servo motors on the controller side: the pairing flag on the Navicon and the fuel gauge servo on the Fuelcon. The pairing flag servo will start at the unpaired position and moves to paired position when the controller goes to paired state. The fuel gauge will update its position based on the fuel level received from the boat.
There are five buttons on the controller: pair button, pump start/stop button, pump pressure increase button, pump pressure decrease button, and refuel button. There are 3 POTs: rudder control, throttle control, dial control. Since there are a lot of user input to check, the frame work may be spammed. To avoid that, we created a service to limit the rate to once per 0.1 second.