Sub: transition to manual_override, deprecate roll-pitch toggle#32639
Sub: transition to manual_override, deprecate roll-pitch toggle#32639ES-Alexander wants to merge 5 commits intoArduPilot:masterfrom
Conversation
peterbarker
left a comment
There was a problem hiding this comment.
The method is now mis-named :-)
Good improvement.
Obviously some behavioural changes - did you want to add warnings if people try things that aren't supported now?
| MAV_RESULT set_message_interval(uint32_t msg_id, int32_t interval_us); | ||
|
|
||
| // Helper function to override the input to a RC channel | ||
| void manual_override(class RC_Channel *c, int16_t value_in, uint16_t offset, float scaler, const uint32_t tnow, bool reversed = false); |
There was a problem hiding this comment.
I'd be tempted to friend that joystick class instead, but it's not a big thing
There was a problem hiding this comment.
I've now friended Sub in GCS_MAVLINK instead, which I believe is at least marginally nicer than making a function public just for Sub usage.
I wanted to do GCS_MAVLINK_Sub instead, or GCS_Sub, but the joystick.cpp file uses so many top level Sub features that it became impractical to write sub. everywhere.
I also wanted to guard the friending with #if APM_BUILD_TYPE(APM_BUILD_ArduSub), but that was apparently an invalid usage of APM_BUILD_TYPE, and I couldn't find a reasonable alternative guard flag, so I had to just include it in all the firmware 🤷♂️
45eb0c5 to
03ba7f5
Compare
@peterbarker not sure what you mean by this. As far as I can tell the
Thanks - it wasn't very fun to implement 😅
Added a warning about the removed roll-pitch toggle behaviour, so it's at least not a silent failure. Was tricky to get something meaningful in 50 characters, but hopefully it's still clear enough to Sub users 🤷♂️ |
Summary
Refactors ArduSub MAVLink
MANUAL_CONTROLhandling to allow ignoring axes and support channel ranges, and deprecates the roll-pitch toggle joystick button function to aid in doing so.Testing (more checks increases chance of being merged)
Description
MANUAL_CONTROLhandling to (generally) ignore axes when specified asINT16_MAX, per the specGCS_MAVLINK::manual_overridemethod, per @peterbarker's suggestionmanual_overrideimplementation, and friend theSubclasssandtaxes with a 6-axis joystickIf merged, closes #32348, though I'm currently unsure which is the lesser evil...