mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-22 13:53:34 +08:00
Navigator: Resume mission with last flight speed (#21714)
* Navigator: DO_CHANGE_SPEED: only store sinlge cruising_speed_current_mode This stored cruising speed setpoint is reset on mode change and after a VTOL transition. * Navigator Mission: replay DO_CHANGE_SPEED items when resuming mission * Navigator: remove cruising_speed_sp_update() Speed changes in a mission are handled directly in the position controllers, and no longer in Navigator. Signed-off-by: Silvan Fuhrer <silvan@auterion.com> --------- Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
This commit is contained in:
@@ -617,7 +617,7 @@ void Navigator::run()
|
||||
set_cruising_speed(cmd.param2);
|
||||
|
||||
} else {
|
||||
set_cruising_speed();
|
||||
reset_cruising_speed();
|
||||
|
||||
/* if no speed target was given try to set throttle */
|
||||
if (cmd.param3 > FLT_EPSILON) {
|
||||
@@ -1160,43 +1160,6 @@ float Navigator::get_altitude_acceptance_radius()
|
||||
}
|
||||
}
|
||||
|
||||
float Navigator::get_cruising_speed()
|
||||
{
|
||||
/* there are three options: The mission-requested cruise speed, or the current hover / plane speed */
|
||||
if (_vstatus.vehicle_type == vehicle_status_s::VEHICLE_TYPE_ROTARY_WING) {
|
||||
if (_mission_cruising_speed_mc > 0.0f) {
|
||||
return _mission_cruising_speed_mc;
|
||||
|
||||
} else {
|
||||
return -1.0f;
|
||||
}
|
||||
|
||||
} else {
|
||||
if (_mission_cruising_speed_fw > 0.0f) {
|
||||
return _mission_cruising_speed_fw;
|
||||
|
||||
} else {
|
||||
return -1.0f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Navigator::set_cruising_speed(float speed)
|
||||
{
|
||||
if (_vstatus.vehicle_type == vehicle_status_s::VEHICLE_TYPE_ROTARY_WING) {
|
||||
_mission_cruising_speed_mc = speed;
|
||||
|
||||
} else {
|
||||
_mission_cruising_speed_fw = speed;
|
||||
}
|
||||
}
|
||||
|
||||
void Navigator::reset_cruising_speed()
|
||||
{
|
||||
_mission_cruising_speed_mc = -1.0f;
|
||||
_mission_cruising_speed_fw = -1.0f;
|
||||
}
|
||||
|
||||
void Navigator::reset_triplets()
|
||||
{
|
||||
reset_position_setpoint(_pos_sp_triplet.previous);
|
||||
|
||||
Reference in New Issue
Block a user