Enable gimbal control using SET_ACTUATOR_CONTROL_TARGET while controlling the vehicle offboard #12146
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.
Describe problem solved by the proposed pull request
When trying to control the gimbal using mavlink command
SET_ACTUATOR_CONTROL_TARGET
, all other will be ignored. This results in a crash when you try the gimbal withSET_ACTUATOR_CONTROL_TARGET
and fly the vehicle in offboard mode by body_rate and thrust setpoints.( Issue reported in #12029)This PR sets a flag so that not all setpoints are ignored when
SET_ACTUATOR_CONTROL_TARGET
is controlling the gimbal control group. This enables applications such as human tracking while the vehicle is in offboard mode.Test data / coverage
The gimbal actuator setpoints were tested while the vehicle was flown a circular trajectory with body_rate and thrust setpoints. vmount was disabled in order to control the gimbal directly in all the tests. Video
https://review.px4.io/plot_app?log=88dfba29-549d-4dc0-bf86-bc3e68815a33
Describe your preferred solution
SET_ACTUATOR_CONTROL_TARGET
is not ignored iff the control group of the actuator setpoint is a gimbal.Additional context
Sending high rate actuator_setpoints still make the vehicle unstable. body_rate setpoints becomes jittery when actuator setpoints are sent at high rates(100Hz). This is still being looked into, but enabling this at 10Hz seems still worth merging into master.
Sending actuator_setpoints(group_mix=2) at 10Hz
log: https://review.px4.io/plot_app?log=88dfba29-549d-4dc0-bf86-bc3e68815a33
Sending actuator_setpoints(group_mix=2) at 100Hz
log: https://review.px4.io/plot_app?log=5fc25c22-ab35-41b4-b23e-4633e708935c