This document describes the MQTT-based communication protocol between the GUI and Oceanix. All messages exchanged MUST follow a JSON-like structure, adhering to the specified topics and key-value conventions.
Each topic below defines the permissible keys and values, as well as the direction of communication (GUI -> Oceanix or Oceanix -> GUI). Message structures are detailed to ensure consistency.
-
- Direction: GUI → Oceanix
- Description: Sends position and orientation values from the GUI to Oceanix.
- Keys:
X: Integer from -32678 to 32678Y: Integer from -32678 to 32678Z: Integer from -32678 to 32678YAW: Integer from -32678 to 32678PITCH: Integer from -32678 to 32678ROLL: Integer from -32678 to 32678
- Example Message:
{ "X": 0, "Y": 0, "Z": 0, "YAW": 0, "ROLL" : 0, "PITCH" : 0 }
-
- Direction: GUI → Oceanix
- Description: Sends state commands to Oceanix, typically in response to user actions in the GUI.
- Structure:
command_name: The name of the command, which may correspond to a button pressed in the GUI.value: Optional
- Possible command_name:
ARM_ROV: Arms or disarms the ROV. The value is irrelevant.CHANGE_CONTROLLER_STATUS: Changes the controller status. The value is irrelevant.PITCH_REFERENCE_UPDATE: Updates the pitch reference value.ROLL_REFERENCE_UPDATE: Updates the roll reference value.DEPTH_REFERENCE_UPDATE: Updates the depth reference value.PITCH_REFERENCE_OFFSET: Offsets the current pitch reference value.ROLL_REFERENCE_OFFSET: Offsets the current roll reference value.DEPTH_REFERENCE_OFFSET: Offsets the current depth reference value.THRUST_MAX_OFFSET: Offsets the maximum thrust value.WORK_MODE: Enables and disables motors work mode, setting motors thrust_max_xy and thrust_max_z to 2.9 and 2.0 or reverting them to the default values.REQUEST_CONFIG: Request current configuration, is sent on config/ topic
- Example Message:
{ "PITCH_REFERENCE_UPDATE": 10.5 }
-
- Direction: GUI → Oceanix
- Description: Sends commands for the arm control to Oceanix, typically in response to button presses in the GUI.
- Keys:
command: commandcommand_name: The name of the command, indicating the arm action.
- Possible command_name:
ROTATE_WRIST_CCW: Rotate the wrist counterclockwise.ROTATE_WRIST_CW: Rotate the wrist clockwise.STOP_WRIST: Stop the wrist movement.OPEN_NIPPER: Open the nipper.CLOSE_NIPPER: Close the nipper.STOP_NIPPER: Stop the nipper movement.TORQUE_WRIST_ON: Turn on the wrist torque.TORQUE_WRIST_OFF: Turn off the wrist torque.
- Example Message:
{ "command": "ROTATE_WRIST_CCW" }
-
- Direction: GUI ← Oceanix
- Description: Sends status information from Oceanix to the GUI at a configurable interval.
- Keys:
variable_name: The name of the variable being monitored.value: Current value of the variable
- Information Types:
- Heartbeat: Essential information required for GUI functionality.
- Keys:
rov_armed:["OK", "OFF"]nucleo_connected:["OK", "OFF"]work_mode:["OK", "OFF"]controller_stateDEPTH:["ACTIVE", "READY", "OFF"]ROLL:["ACTIVE", "READY", "OFF"]PITCH:["ACTIVE", "READY", "OFF"]
force_z: Newtonforce_roll: Newtonforce_pitch: Newtonreference_z: metersreference_roll: DEGreference_pitch: DEGdepth: metersroll: DEGpitch: DEGyaw: DEGimu_state:["OK", "OFF"]bar_state:["OK", "OFF"]motor_thrust_max_xy: Kgfmotor_thrust_max_z: Kgfmotor_thrustFSX: KgfFDX: KgfRSX: KgfRDX: KgfUPFSX: KgfUPFDX: KgfUPRSX: KgfUPRDX: Kgf
pwmFSXFDXRSXRDXUPFSXUPFDXUPRSXUPRDX
- Optional Debug: Additional data useful for debugging purposes.
- Example Message:
{ "rov_armed": "OK", "depth": 2.8 }
-
- Direction: GUI ⇔ Oceanix
- Description: Used to synchronize configuration data between GUI and Oceanix.
- Keys:
config_variable: The name of the configuration variable.value: The current or updated value of the configuration variable.
- Behavior:
- when the command is received
REQUEST_CONFIGOceanix sends the current configuration to the GUI. - The GUI can send updates to modify the configuration and send it back to Oceanix on this topic.
- When a configuration is received before writing it's validity is checked.
- when the command is received
- Example Message:
{ "controller_profile" : 1 }
-
- Direction: GUI → Oceanix
- Description: Send log message from Oceanix. The log level can be changed in the config.
- Example Message:
1746649287972[CONFIG ][INFO ]Reading config file\n
This structure is designed for future modifications, including additional keys and topics that may be required as the protocol evolves.