mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-17 09:10:36 +08:00
Check mission climb always on current mission item (#22230)
* mission_base: reset inactivation index when user set a new mission index, or mission is reset. * mission_base: check Climb required always on current mission item
This commit is contained in:
@@ -141,6 +141,9 @@ Mission::set_current_mission_index(uint16_t index)
|
||||
set_mission_items();
|
||||
}
|
||||
|
||||
// User has actively set new index, reset.
|
||||
_inactivation_index = -1;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -243,7 +243,7 @@ MissionBase::on_activation()
|
||||
}
|
||||
}
|
||||
|
||||
checkClimbRequired(resume_index);
|
||||
checkClimbRequired(_mission.current_seq);
|
||||
set_mission_items();
|
||||
|
||||
_inactivation_index = -1; // reset
|
||||
@@ -557,6 +557,7 @@ MissionBase::checkMissionRestart()
|
||||
if (_system_disarmed_while_inactive && _mission_has_been_activated && (_mission.count > 0U)
|
||||
&& ((_mission.current_seq + 1) == _mission.count)) {
|
||||
setMissionIndex(0);
|
||||
_inactivation_index = -1; // reset
|
||||
_is_current_planned_mission_item_valid = isMissionValid(_mission);
|
||||
resetMissionJumpCounter();
|
||||
_navigator->reset_cruising_speed();
|
||||
|
||||
@@ -295,6 +295,7 @@ protected:
|
||||
bool _system_disarmed_while_inactive{false}; /**< Flag indicating if the system has been disarmed while mission is inactive*/
|
||||
mission_s _mission; /**< Currently active mission*/
|
||||
float _mission_init_climb_altitude_amsl{NAN}; /**< altitude AMSL the vehicle will climb to when mission starts */
|
||||
int _inactivation_index{-1}; // index of mission item at which the mission was paused. Used to resume survey missions at previous waypoint to not lose images.
|
||||
|
||||
DatamanCache _dataman_cache{"mission_dm_cache_miss", 10}; /**< Dataman cache of mission items*/
|
||||
DatamanClient &_dataman_client = _dataman_cache.client(); /**< Dataman client*/
|
||||
@@ -428,7 +429,6 @@ private:
|
||||
int32_t _load_mission_index{-1}; /**< Mission inted of loaded mission items in dataman cache*/
|
||||
int32_t _dataman_cache_size_signed; /**< Size of the dataman cache. A negativ value indicates that previous mission items should be loaded, a positiv value the next mission items*/
|
||||
|
||||
int _inactivation_index{-1}; // index of mission item at which the mission was paused. Used to resume survey missions at previous waypoint to not lose images.
|
||||
bool _align_heading_necessary{false}; // if true, heading of vehicle needs to be aligned with heading of next waypoint. Used to create new mission items for heading alignment.
|
||||
|
||||
mission_item_s _last_gimbal_configure_item {};
|
||||
|
||||
Reference in New Issue
Block a user