Browse Source

Commander: move esc_status as local variable.

Signed-off-by: Claudio Micheli <claudio@auterion.com>
sbg
Claudio Micheli 6 years ago committed by Beat Küng
parent
commit
2eb9fb9ed6
  1. 1
      msg/vehicle_status_flags.msg
  2. 7
      src/modules/commander/Commander.cpp
  3. 3
      src/modules/commander/Commander.hpp

1
msg/vehicle_status_flags.msg

@ -22,7 +22,6 @@ bool circuit_breaker_engaged_gpsfailure_check @@ -22,7 +22,6 @@ bool circuit_breaker_engaged_gpsfailure_check
bool circuit_breaker_flight_termination_disabled
bool circuit_breaker_engaged_usb_check
bool circuit_breaker_engaged_posfailure_check # set to true when the position valid checks have been disabled
bool circuit_breaker_engaged_escs_check
bool offboard_control_signal_found_once
bool offboard_control_signal_lost

7
src/modules/commander/Commander.cpp

@ -150,7 +150,6 @@ static uint8_t _last_sp_man_arm_switch = 0; @@ -150,7 +150,6 @@ static uint8_t _last_sp_man_arm_switch = 0;
static struct vtol_vehicle_status_s vtol_status = {};
static struct cpuload_s cpuload = {};
static struct esc_status_s esc_status = {};
static bool last_overload = false;
@ -1624,8 +1623,10 @@ Commander::run() @@ -1624,8 +1623,10 @@ Commander::run()
if (esc_status_sub.updated()) {
/* ESCs status changed */
esc_status_s esc_status = {};
esc_status_sub.copy(&esc_status);
esc_status_check();
esc_status_check(esc_status);
}
estimator_check(&status_changed);
@ -4366,7 +4367,7 @@ Commander::offboard_control_update(bool &status_changed) @@ -4366,7 +4367,7 @@ Commander::offboard_control_update(bool &status_changed)
}
void Commander::esc_status_check()
void Commander::esc_status_check(const esc_status_s &esc_status)
{
char esc_fail_msg[50];
esc_fail_msg[0] = '\0';

3
src/modules/commander/Commander.hpp

@ -65,6 +65,7 @@ @@ -65,6 +65,7 @@
#include <uORB/topics/vehicle_command.h>
#include <uORB/topics/vehicle_global_position.h>
#include <uORB/topics/vehicle_local_position.h>
#include <uORB/topics/esc_status.h>
using math::constrain;
@ -217,7 +218,7 @@ private: @@ -217,7 +218,7 @@ private:
void battery_status_check();
void esc_status_check();
void esc_status_check(const esc_status_s &esc_status);
/**
* Checks the status of all available data links and handles switching between different system telemetry states.

Loading…
Cancel
Save