Skip to content

Commit

Permalink
Speed reset when switching flight modes (#21414)
Browse files Browse the repository at this point in the history
* speed reset between flight modes

* no whitespace
  • Loading branch information
afwilkin authored Apr 27, 2023
1 parent bfc1e36 commit cdc717b
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/modules/navigator/land.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ Land::on_activation()
_navigator->set_can_loiter_at_sp(false);

_navigator->set_position_setpoint_triplet_updated();

// reset cruising speed to default
_navigator->reset_cruising_speed();
}

void
Expand Down
3 changes: 3 additions & 0 deletions src/modules/navigator/loiter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ Loiter::on_activation()
} else {
set_loiter_position();
}

// reset cruising speed to default
_navigator->reset_cruising_speed();
}

void
Expand Down
3 changes: 3 additions & 0 deletions src/modules/navigator/mission.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,9 @@ Mission::on_activation()
cmd.param1 = -1.0f;
cmd.param3 = 0.0f;
_navigator->publish_vehicle_cmd(&cmd);

// reset cruise speed
_navigator->reset_cruising_speed();
}

void
Expand Down
2 changes: 1 addition & 1 deletion src/modules/navigator/rtl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ void RTL::on_activation()
}

// reset cruising speed and throttle to default for RTL
_navigator->set_cruising_speed();
_navigator->reset_cruising_speed();
_navigator->set_cruising_throttle();

set_rtl_item();
Expand Down
3 changes: 3 additions & 0 deletions src/modules/navigator/takeoff.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ void
Takeoff::on_activation()
{
set_takeoff_position();

// reset cruising speed to default
_navigator->reset_cruising_speed();
}

void
Expand Down

0 comments on commit cdc717b

Please sign in to comment.