mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-27 13:03:33 +08:00
remove avoidance library and logic
Signed-off-by: Silvan <silvan@auterion.com>
This commit is contained in:
@@ -1717,8 +1717,6 @@ void Commander::updateParameters()
|
||||
_vehicle_status.system_type = value_int32;
|
||||
}
|
||||
|
||||
_vehicle_status.avoidance_system_required = _param_com_obs_avoid.get();
|
||||
|
||||
_auto_disarm_killed.set_hysteresis_time_from(false, _param_com_kill_disarm.get() * 1_s);
|
||||
|
||||
const bool is_rotary = is_rotary_wing(_vehicle_status) || (is_vtol(_vehicle_status)
|
||||
@@ -1799,9 +1797,6 @@ void Commander::run()
|
||||
_status_changed = true;
|
||||
}
|
||||
|
||||
/* Update OA parameter */
|
||||
_vehicle_status.avoidance_system_required = _param_com_obs_avoid.get();
|
||||
|
||||
handlePowerButtonState();
|
||||
|
||||
systemPowerUpdate();
|
||||
@@ -2814,16 +2809,6 @@ void Commander::dataLinkCheck()
|
||||
_vehicle_status.open_drone_id_system_present = true;
|
||||
_vehicle_status.open_drone_id_system_healthy = healthy;
|
||||
}
|
||||
|
||||
if (telemetry.heartbeat_component_obstacle_avoidance) {
|
||||
if (_avoidance_system_lost) {
|
||||
_avoidance_system_lost = false;
|
||||
_status_changed = true;
|
||||
}
|
||||
|
||||
_datalink_last_heartbeat_avoidance_system = telemetry.timestamp;
|
||||
_vehicle_status.avoidance_system_valid = telemetry.avoidance_system_healthy;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2875,17 +2860,6 @@ void Commander::dataLinkCheck()
|
||||
_open_drone_id_system_lost = true;
|
||||
_status_changed = true;
|
||||
}
|
||||
|
||||
// AVOIDANCE SYSTEM state check (only if it is enabled)
|
||||
if (_vehicle_status.avoidance_system_required && !_onboard_controller_lost) {
|
||||
// if heartbeats stop
|
||||
if (!_avoidance_system_lost && (_datalink_last_heartbeat_avoidance_system > 0)
|
||||
&& (hrt_elapsed_time(&_datalink_last_heartbeat_avoidance_system) > 5_s)) {
|
||||
|
||||
_avoidance_system_lost = true;
|
||||
_vehicle_status.avoidance_system_valid = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Commander::battery_status_check()
|
||||
|
||||
@@ -241,7 +241,6 @@ private:
|
||||
Hysteresis _auto_disarm_killed{false};
|
||||
|
||||
hrt_abstime _datalink_last_heartbeat_open_drone_id_system{0};
|
||||
hrt_abstime _datalink_last_heartbeat_avoidance_system{0};
|
||||
hrt_abstime _datalink_last_heartbeat_gcs{0};
|
||||
hrt_abstime _datalink_last_heartbeat_onboard_controller{0};
|
||||
hrt_abstime _datalink_last_heartbeat_parachute_system{0};
|
||||
@@ -268,7 +267,6 @@ private:
|
||||
bool _failsafe_user_override_request{false}; ///< override request due to stick movements
|
||||
|
||||
bool _open_drone_id_system_lost{true};
|
||||
bool _avoidance_system_lost{false};
|
||||
bool _onboard_controller_lost{false};
|
||||
bool _parachute_system_lost{true};
|
||||
|
||||
@@ -342,7 +340,6 @@ private:
|
||||
(ParamBool<px4::params::COM_FORCE_SAFETY>) _param_com_force_safety,
|
||||
(ParamFloat<px4::params::COM_KILL_DISARM>) _param_com_kill_disarm,
|
||||
(ParamBool<px4::params::COM_MOT_TEST_EN>) _param_com_mot_test_en,
|
||||
(ParamBool<px4::params::COM_OBS_AVOID>) _param_com_obs_avoid,
|
||||
(ParamFloat<px4::params::COM_OBC_LOSS_T>) _param_com_obc_loss_t,
|
||||
(ParamInt<px4::params::COM_PREARM_MODE>) _param_com_prearm_mode,
|
||||
(ParamInt<px4::params::COM_RC_OVERRIDE>) _param_com_rc_override,
|
||||
|
||||
@@ -121,27 +121,6 @@ void SystemChecks::checkAndReport(const Context &context, Report &reporter)
|
||||
}
|
||||
}
|
||||
|
||||
// avoidance system
|
||||
if (context.status().avoidance_system_required) {
|
||||
if (context.status().avoidance_system_valid) {
|
||||
reporter.setIsPresent(health_component_t::avoidance);
|
||||
|
||||
} else {
|
||||
/* EVENT
|
||||
* @description
|
||||
* <profile name="dev">
|
||||
* This check can be configured via <param>COM_OBS_AVOID</param> parameter.
|
||||
* </profile>
|
||||
*/
|
||||
reporter.armingCheckFailure(NavModes::All, health_component_t::system, events::ID("check_system_avoidance_not_ready"),
|
||||
events::Log::Error, "Avoidance system not ready");
|
||||
|
||||
if (reporter.mavlink_log_pub()) {
|
||||
mavlink_log_critical(reporter.mavlink_log_pub(), "Preflight Fail: Avoidance system not ready");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// VTOL in transition
|
||||
if (context.status().is_vtol && !context.isArmed()) {
|
||||
if (context.status().in_transition_mode) {
|
||||
|
||||
@@ -640,14 +640,6 @@ PARAM_DEFINE_INT32(COM_RCL_EXCEPT, 0);
|
||||
*/
|
||||
PARAM_DEFINE_INT32(COM_ACT_FAIL_ACT, 0);
|
||||
|
||||
/**
|
||||
* Flag to enable obstacle avoidance.
|
||||
*
|
||||
* @boolean
|
||||
* @group Commander
|
||||
*/
|
||||
PARAM_DEFINE_INT32(COM_OBS_AVOID, 0);
|
||||
|
||||
/**
|
||||
* Expect and require a healthy MAVLink parachute system
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user