mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-01 08:50:34 +08:00
Commander: Added COM_ONB_BOOT_T parameter.
Since onboard controllers bootup times are hardware dependent, it makes sense to have the possibility to adapt timeout time according to the specific HW. Signed-off-by: Claudio Micheli <claudio@auterion.com>
This commit is contained in:
committed by
Julian Oes
parent
7a8002fdab
commit
3b5ef82193
@@ -3964,14 +3964,15 @@ void Commander::data_link_check(bool &status_changed)
|
||||
if (status_flags.avoidance_system_required && !_onboard_controller_lost) {
|
||||
|
||||
//if avoidance never started
|
||||
if (_datalink_last_heartbeat_avoidance_system == 0 && hrt_elapsed_time(&_avoidance_system_not_started) > 10_s
|
||||
if (_datalink_last_heartbeat_avoidance_system == 0
|
||||
&& hrt_elapsed_time(&_avoidance_system_not_started) > _onboard_boot_timeout.get() * 1_s
|
||||
&& avoidance_waiting_count < AVOIDANCE_MAX_TRIALS) {
|
||||
_avoidance_system_not_started = hrt_absolute_time();
|
||||
mavlink_log_info(&mavlink_log_pub, "Waiting for avoidance system to start");
|
||||
avoidance_waiting_count++;
|
||||
|
||||
} else if (avoidance_waiting_count == AVOIDANCE_MAX_TRIALS) {
|
||||
mavlink_log_critical(&mavlink_log_pub, "Avoidance system not responding. Try reboot vehicle.");
|
||||
mavlink_log_critical(&mavlink_log_pub, "Avoidance not responding. Try reboot vehicle.");
|
||||
avoidance_waiting_count++;
|
||||
}
|
||||
|
||||
|
||||
@@ -117,7 +117,9 @@ private:
|
||||
(ParamInt<px4::params::COM_LOW_BAT_ACT>) _low_bat_action,
|
||||
(ParamFloat<px4::params::COM_DISARM_LAND>) _disarm_when_landed_timeout,
|
||||
|
||||
(ParamInt<px4::params::COM_OBS_AVOID>) _obs_avoid
|
||||
(ParamInt<px4::params::COM_OBS_AVOID>) _obs_avoid,
|
||||
(ParamInt<px4::params::COM_ONB_BOOT_T>) _onboard_boot_timeout
|
||||
|
||||
)
|
||||
|
||||
const int64_t POSVEL_PROBATION_MIN = 1_s; /**< minimum probation duration (usec) */
|
||||
|
||||
@@ -805,4 +805,18 @@ PARAM_DEFINE_INT32(NAV_RCL_ACT, 2);
|
||||
* @reboot_required true
|
||||
* @group Mission
|
||||
*/
|
||||
PARAM_DEFINE_INT32(COM_OBS_AVOID, 0);
|
||||
PARAM_DEFINE_INT32(COM_OBS_AVOID, 0);
|
||||
|
||||
/**
|
||||
* Set onboard controller bootup timeout
|
||||
*
|
||||
* This parameter defines the bootup timeout.
|
||||
* After the timeout a mavlink message to warn the user that the system
|
||||
* is still booting up is triggered.
|
||||
*
|
||||
* @group Commander
|
||||
* @unit s
|
||||
* @min 0
|
||||
* @max 120
|
||||
*/
|
||||
PARAM_DEFINE_INT32(COM_ONB_BOOT_T, 15);
|
||||
Reference in New Issue
Block a user