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

Enable DO_SET_SPEED commands outside of missions in other AUTO modes #18834

Merged
merged 2 commits into from
Feb 17, 2022

Conversation

sfuhrer
Copy link
Contributor

@sfuhrer sfuhrer commented Dec 10, 2021

Replaces #18605.

Describe problem solved by this pull request

  • no interface to change speed setpoint in auto flight if not in mission
  • flying in high wind with an airspeed setpoint close to stall is dangerous due to increased external disturbances, so the airspeed setpoint should ideally be increased in these situations

Describe your solution
Speed setpoint slider:
(Note: no PR yet for QGC side) Introduce a slider in the flyview of QGC to change the current speed setpoint. For MC this would be groundspeed, for FW/VTOLs in FW mode airspeed. After confirming the set value of the slider, QGC sends the MAVLink command DO_CHANGE_SPEED. Navigator stores the received value in _mission_cruising_speed_mc/_fw, and applies it from there on for every new AUTO action (e.g. GoTo, Loiter etc). For it to have immediate effect if vehicle is in AUTO_LOITER when receiving the change speed, apply it by doing a reposition without updating any other field than cruising_speed and cruising_throttle.
DO_CHANGE_SPEED waypoints in mission have the same interface. They override the value set through the slider in the flyview.

When RTL is activated reset the cruising speed and throttle.
image

Wind-based adaption: (not sure if we need this anymore with #18810)
There is an offset added to the minimum airspeed setpoint: setpoint += FW_WIND_ARSP_SC * abs(wind). So if the scale is set to 0.2, then for 10m/s there are 2m/s added to the setpoint that help making the vehicle's attitude control more robust to disturbances caused by the high wind, plus reduces the chance of a groundspeed undershoot.

EDIT: removed the wind-based adaption from this PR, and also split out the airspeed setpoint handling in the FW position controller: #18841

Describe possible alternatives

Test data / coverage
SITL tested.

Additional context

@sfuhrer
Copy link
Contributor Author

sfuhrer commented Dec 10, 2021

VTOLSpeedAirspeedChanges.mp4

This is an early draft on the groundstation side.

@Jaeyoung-Lim
Copy link
Member

This is super cool!

@sfuhrer sfuhrer force-pushed the pr-fw-tecs-modes-take2-master branch 2 times, most recently from 6c7326e to 8238af9 Compare December 13, 2021 09:16
- update _mission_cruising_speed_mc/_fw also if DO_CHANGE_SPEED command
is received outside of mission (e.g. while Loitering doing an Orbit)
- if vehicle is in AUTO_LOITER when receiving the change speed, then immediately
apply it by doing a reposition without updating any other field than cruising_speed
and cruising_throttle
-when RTL is activated reset the cruising speed and throttle

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
@sfuhrer sfuhrer force-pushed the pr-fw-tecs-modes-take2-master branch from 8238af9 to 9d533ba Compare December 13, 2021 09:16
@sfuhrer sfuhrer requested a review from dagar December 13, 2021 10:16
Copy link
Contributor

@RomanBapst RomanBapst left a comment

Choose a reason for hiding this comment

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

@sfuhrer I just realized that when you set a speed in mc mode and then transition, the fw controller will use the same speed setpoint. Can you have a look at that?

…itioning

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
@sfuhrer
Copy link
Contributor Author

sfuhrer commented Dec 17, 2021

@sfuhrer I just realized that when you set a speed in mc mode and then transition, the fw controller will use the same speed setpoint. Can you have a look at that?

Yes good point, I'd say we should always reset the speed and throttle setpoint when transitioning: 30179e1

It's a bit unfortunate that the transition command isn't passed through in the position_setpoint, that would make the things easier and prob more deterministic. Now I had to trigger a repo setpoint update (similar to when a DO_CHANGE_SPEED is received). Don't see any immediate issue with it, we should though go through all cases in testing.

@ryanjAA
Copy link
Contributor

ryanjAA commented Jan 15, 2022

This is awesome @sfuhrer !

@sfuhrer
Copy link
Contributor Author

sfuhrer commented Feb 17, 2022

Given that the QGC implementation is now there in a PR I go ahead and merge this.

@lichishubao
Copy link

But it doesn't work when the Fix-wing in offboard mode

@sfuhrer
Copy link
Contributor Author

sfuhrer commented Feb 9, 2023

But it doesn't work when the Fix-wing in offboard mode

Please open a new issue or ask on discord, as stated this PR wasn't about offboard but AUTO modes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants