vehicle_control_mode needs to be updated when offboard_control_mode is changed #12002
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
For dynamic flights in
OFFBOARD
mode it's necessary to switch between position/velocity/attitude/rates submodes fast.For now, changes is
offboard_control_mode
topic does not trigger Commander to update the status, so thevehicle_control_mode
doesn't get updated, causing delays (0.1–0.2 s) for publishing appropriate setpoints.Like in this log, where automatic flip is performed (notice the delay between
offboard_control_mode
andvehicle_control_mode
updates):https://logs.px4.io/plot_app?log=fd5ad882-c4fb-49cc-9713-9201a6ee1379
This fix makes updates simultaneous:
https://logs.px4.io/plot_app?log=8c115337-4469-4de3-8490-33d619d66d21
These logs are from SITL, but we experienced the same on real hardware. In v1.8.2 it was making automatic flips impossible, without ugly hacks to switch to position control earlier to compensate the possible delay.
@dagar