check avoidance status in commander and set sys status

remove mavlink log
This commit is contained in:
Martina Rivizzigno
2020-03-02 16:49:56 +01:00
committed by Julian Kent
parent 48b7cd926e
commit aee1e70642
4 changed files with 55 additions and 34 deletions
+9 -4
View File
@@ -61,6 +61,7 @@
#include <uORB/topics/airspeed.h>
#include <uORB/topics/battery_status.h>
#include <uORB/topics/cpuload.h>
#include <uORB/topics/distance_sensor.h>
#include <uORB/topics/esc_status.h>
#include <uORB/topics/estimator_status.h>
#include <uORB/topics/geofence_result.h>
@@ -132,6 +133,8 @@ private:
*/
void data_link_check();
void avoidance_check();
void esc_status_check(const esc_status_s &esc_status);
void estimator_check();
@@ -196,7 +199,6 @@ private:
(ParamFloat<px4::params::COM_DISARM_PRFLT>) _param_com_disarm_preflight,
(ParamBool<px4::params::COM_OBS_AVOID>) _param_com_obs_avoid,
(ParamInt<px4::params::COM_OA_BOOT_T>) _param_com_oa_boot_t,
(ParamInt<px4::params::COM_FLT_PROFILE>) _param_com_flt_profile,
@@ -251,7 +253,9 @@ private:
// Mavlink
(ParamInt<px4::params::MAV_COMP_ID>) _param_mav_comp_id,
(ParamInt<px4::params::MAV_SYS_ID>) _param_mav_sys_id,
(ParamInt<px4::params::MAV_TYPE>) _param_mav_type
(ParamInt<px4::params::MAV_TYPE>) _param_mav_type,
(ParamFloat<px4::params::CP_DIST>) _param_cp_dist
)
enum class PrearmedMode {
@@ -282,6 +286,8 @@ private:
PreFlightCheck::arm_requirements_t _arm_requirements{};
hrt_abstime _valid_distance_sensor_time_us{0}; /**< Last time that distance sensor data arrived (usec) */
hrt_abstime _last_gpos_fail_time_us{0}; /**< Last time that the global position validity recovery check failed (usec) */
hrt_abstime _last_lpos_fail_time_us{0}; /**< Last time that the local position validity recovery check failed (usec) */
hrt_abstime _last_lvel_fail_time_us{0}; /**< Last time that the local velocity validity recovery check failed (usec) */
@@ -325,8 +331,6 @@ private:
Hysteresis _auto_disarm_landed{false};
Hysteresis _auto_disarm_killed{false};
bool _print_avoidance_msg_once{false};
hrt_abstime _last_print_mode_reject_time{0}; ///< To remember when last notification was sent
float _eph_threshold_adj{INFINITY}; ///< maximum allowable horizontal position uncertainty after adjustment for flight condition
@@ -388,6 +392,7 @@ private:
#endif
uORB::Subscription _cmd_sub {ORB_ID(vehicle_command)};
uORB::Subscription _cpuload_sub{ORB_ID(cpuload)};
uORB::Subscription _sub_distance_sensor[ORB_MULTI_MAX_INSTANCES] {{ORB_ID(distance_sensor), 0}, {ORB_ID(distance_sensor), 1}, {ORB_ID(distance_sensor), 2}, {ORB_ID(distance_sensor), 3}}; /**< distance data received from onboard rangefinders */
uORB::Subscription _esc_status_sub{ORB_ID(esc_status)};
uORB::Subscription _geofence_result_sub{ORB_ID(geofence_result)};
uORB::Subscription _iridiumsbd_status_sub{ORB_ID(iridiumsbd_status)};