Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speed reset when switching flight modes #21414

Merged
merged 2 commits into from
Apr 27, 2023

Conversation

afwilkin
Copy link
Contributor

@afwilkin afwilkin commented Apr 3, 2023

Solved Problem

When I issued a DO_CHANGE_SPEED, and then changed flight modes, that speed continued over to the new flight mode.
For example, if I issue a DO_CHANGE_SPEED in mission mode for 1 m/s, and then switch to Loiter mode, I am still restricted to 1 m/s.

From the conversations that I have had with maintainers, this is not the behavior we want to have

The only flight mode that this does not happen for is RTL, which has the following line
_navigator->reset_cruising_speed();

Solution

I reset the cruising speed upon entering a new navigation mode.

Alternatives

We could also create a new module that keeps track of what mode we are in and changes speed limits from there

Test coverage

  • Create a waypoint mission with a change speed waypoint item at 1 m/s. Mid-mission flip to HOLD mode and issue a do_relocate.
    Before the change: log
    image

After the change: log
image

@junwoo091400 junwoo091400 added Admin: Enhancement (improvement) 💡 Flight Controls 🦅 Anything about flight control algorithm (Navigation, Attitude control, etc) labels Apr 3, 2023
@DronecodeBot
Copy link

This pull request has been mentioned on Discussion Forum for PX4, Pixhawk, QGroundControl, MAVSDK, MAVLink. There might be relevant details there:

https://discuss.px4.io/t/px4-community-q-a-april-05-2023/31435/4

@junwoo091400 junwoo091400 requested a review from dagar April 5, 2023 15:19
@junwoo091400
Copy link
Contributor

@dagar we mentioned this during the call, and concluded that more discussion on the context of this problem is needed. So it would be nice to have your feedback on use-cases for this!

@DronecodeBot
Copy link

This pull request has been mentioned on Discussion Forum for PX4, Pixhawk, QGroundControl, MAVSDK, MAVLink. There might be relevant details there:

https://discuss.px4.io/t/px4-community-q-a-april-05-2023/31435/1

Copy link
Contributor

@sfuhrer sfuhrer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is good to go from my side. We've tested it a bit in SITL and real vehicles (VTOLs). Needs follow up #21503 to have effect immediately always and not just when you set a new loiter for example.

The speed interface / handling in Navigator is quite ugly so I hope we get to fix it more fundamentally after the release.

@sfuhrer sfuhrer merged commit cdc717b into PX4:main Apr 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Admin: Enhancement (improvement) 💡 Flight Controls 🦅 Anything about flight control algorithm (Navigation, Attitude control, etc)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants