mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-03 00:10:35 +08:00
fw pos ctrl: organize state variables
This commit is contained in:
committed by
Daniel Agar
parent
2d5f1a5c6b
commit
5648deb5a1
@@ -1518,10 +1518,10 @@ FixedwingPositionControl::control_auto_takeoff(const hrt_abstime &now, const flo
|
||||
/* Perform launch detection */
|
||||
|
||||
/* Inform user that launchdetection is running every 4s */
|
||||
if ((now - _launch_detection_notify) > 4_s) {
|
||||
if ((now - _last_time_launch_detection_notified) > 4_s) {
|
||||
mavlink_log_critical(&_mavlink_log_pub, "Launch detection running\t");
|
||||
events::send(events::ID("fixedwing_position_control_launch_detection"), events::Log::Info, "Launch detection running");
|
||||
_launch_detection_notify = now;
|
||||
_last_time_launch_detection_notified = now;
|
||||
}
|
||||
|
||||
/* Detect launch using body X (forward) acceleration */
|
||||
@@ -2465,7 +2465,7 @@ FixedwingPositionControl::reset_takeoff_state()
|
||||
|
||||
_launchDetector.reset();
|
||||
_launch_detection_state = LAUNCHDETECTION_RES_NONE;
|
||||
_launch_detection_notify = 0;
|
||||
_last_time_launch_detection_notified = 0;
|
||||
|
||||
_launch_detected = false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user