Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
Signed-off-by: Julian Oes <[email protected]>
  • Loading branch information
julianoes committed May 1, 2024
1 parent be02029 commit a33d48d
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 25 deletions.
4 changes: 2 additions & 2 deletions msg/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ set(msg_files
ObstacleDistance.msg
OffboardControlMode.msg
OnboardComputerStatus.msg
OpenDroneIdArmStatus.msg
OpenDroneIdBasicId.msg
OpenDroneIdArmStatus.msg
OpenDroneIdBasicId.msg
OpenDroneIdOperatorId.msg
OpenDroneIdSelfId.msg
OpenDroneIdSystem.msg
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,3 +187,4 @@ class HealthAndArmingChecks : public ModuleParams
&_vtol_checks,
};
};

Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ void OpenDroneIDChecks::checkAndReport(const Context &context, Report &reporter)

NavModes affected_modes{NavModes::None};

if (_param_com_arm_odid.get() == 2) {
// disallow arming without the Open Drone ID system
affected_modes = NavModes::All;
}

if (_open_drone_id_arm_status_sub.copy(&odid_module_arm_status)) {
if (_param_com_arm_odid.get() == 2) {
// disallow arming without the Open Drone ID system
affected_modes = NavModes::All;
}

// Check ODID arm status
if (odid_module_arm_status.status == ODID_ARM_FAIL) {
if (_open_drone_id_arm_status_sub.copy(&odid_module_arm_status)) {

// Check ODID arm status
if (odid_module_arm_status.status == ODID_ARM_FAIL) {
/* EVENT
* @description
* Open Drone ID system reported being unhealthy.
Expand All @@ -75,22 +75,22 @@ void OpenDroneIDChecks::checkAndReport(const Context &context, Report &reporter)
}

} else if (!context.status().open_drone_id_system_present) {
/* EVENT
* @description
* Open Drone ID system failed to report. Make sure it is setup and installed properly.
*
* <profile name="dev">
* This check can be configured via <param>COM_ARM_ODID</param> parameter.
* </profile>
*/
reporter.armingCheckFailure(affected_modes, health_component_t::open_drone_id,
events::ID("check_open_drone_id_missing"),
events::Log::Error, "Open Drone ID system missing");

if (reporter.mavlink_log_pub()) {
mavlink_log_critical(reporter.mavlink_log_pub(), "Preflight Fail: Open Drone ID system missing");
}
/* EVENT
* @description
* Open Drone ID system failed to report. Make sure it is setup and installed properly.
*
* <profile name="dev">
* This check can be configured via <param>COM_ARM_ODID</param> parameter.
* </profile>
*/
reporter.armingCheckFailure(affected_modes, health_component_t::open_drone_id,
events::ID("check_open_drone_id_missing"),
events::Log::Error, "Open Drone ID system missing");

if (reporter.mavlink_log_pub()) {
mavlink_log_critical(reporter.mavlink_log_pub(), "Preflight Fail: Open Drone ID system missing");
}

}

}
2 changes: 2 additions & 0 deletions src/modules/mavlink/streams/OPEN_DRONE_ID_ARM_STATUS.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,13 @@ class MavlinkStreamOpenDroneIdArmStatus : public MavlinkStream
mavlink_open_drone_id_arm_status_t msg{};

msg.status = drone_id_arm.status;

for (uint8_t i = 0; i < sizeof(drone_id_arm.error); ++i) {

msg.error[i] = drone_id_arm.error[i];

}

mavlink_msg_open_drone_id_arm_status_send_struct(_mavlink->get_channel(),
&msg);

Expand Down

0 comments on commit a33d48d

Please sign in to comment.