Z4nna / nereo_rov_code

The code for the ROV Nereo made by PoliTOcean
MIT License
1 stars 1 forks source link

Info e Errori #6

Closed Z4nna closed 2 months ago

Z4nna commented 3 months ago

Inserire in ogni nodo un publisher di tipo “DiagnosticArray” che pubblichi periodicamente tutti i messaggi di diagnostica

Z4nna commented 3 months ago

To create a DiagnosticArray message:

  1. declare the variable diagnostic_array;
  2. Assign the header: diagnostic_array.header.stamp = this->get_clock()->now();
  3. Assign the ID: diagnostic_array.header.frame_id = "node_name";
  4. Declare a DiagnosticStatus messages array: diagnostic_statuses[N]
  5. Add all the DiagnosticStatus messages you like to the array ( check the array bounds )
  6. add the array to the DiagnosticArray message: diagnostic_array.status.data = diagnostic_statuses;
Z4nna commented 3 months ago

To create a DiagnosticStatus message:

  1. Declare the message variable: diagnostic_status;
  2. Assign the level ( see documentation at https://github.com/ros2/common_interfaces/blob/rolling/diagnostic_msgs/msg/DiagnosticStatus.msg ) : diagnostic_status.level = LEVEL_CODE;
  3. Assign a name: diagnostic_status.name.data = "name";
  4. Assign the message: diagnostic_status.message.data = "message";
  5. Optional: for debugging purposes, you might want to add a dictionary or an hardware_id. See docs.
SalvatoreLS commented 2 months ago

Diagnostic array completed for both sensors