Yes, Boats and Rovers essentially have same conceptual design (reversible motors & steering).
On the side note, the solution presented here is probably coming from the fact that in QGC there’s a hotfix that has always resetted the throttle channel’s TRIM value (e.g. commonly RC3_TRIM
) to the minimum value (e.g. 1002), and not the mid-range value (1500).
This is further explained in this comment:
PX4:main
← PX4:manual-control-setpoint-1to1
Thanks for your review @junwoo091400 sadly while doing further testing I found w… hat I feared: QGC calibrates differently based on the RC mapping and throttle is in the calibration parameters trimmed differently such that PX4 as a result will map throttle to [0,1] so I'll have to work around that using a calibration translation. Why was it designed so complicated 🤯
https://github.com/mavlink/qgroundcontrol/commit/0577af2e944a0f53919aeb1367d580f744004b2c
Therefore the fix to revert the hotfix would be needed: Hotfix for sprung-loaded throttles and RC calibration: Enforce correc… · mavlink/qgroundcontrol@0577af2 · GitHub . For that the fix PR has been sitting a bit here:
mavlink:master
← junwoo091400:pr_remove_rc_throttle_trim_hotfix
opened 09:30AM - 19 Nov 22 UTC
## Descrption
A hotfix [commit](https://github.com/mavlink/qgroundcontrol/commi… t/0577af2e944a0f53919aeb1367d580f744004b2c) from 7 years ago was forcing RC transmitters to always have a trim value set to 'Min', effectively only allowing the [0, 1000] range.
~~While for legacy reasons & to bypass cases of spring-loaded transmitters, this may be ok, it is certainly not true regarding reversible thrust vehicles (e.g. Boat / Rovers), and it is confusing why only the throttle would be in the range [0, 1], and not [-1 ,1], as defined in the [`MANUAL_CONTROL`](https://mavlink.io/en/messages/common.html#MANUAL_CONTROL) MAVLink message definition.~~
## Changes
Removed this hotfix, and allows setting the trim values automatically in the state machine (need to check logic once again)
## Context
The discussion that discovered this flaw is here: https://github.com/PX4/PX4-Autopilot/pull/15949#issuecomment-1318728541
~~We need to also clearly define the point about the definition of `MANUAL_CONTROL`'s throttle (`z`) definition. As it doesn't really make sense to have throttle vector's orientation interfere with the RC transmitter's setpoint values (it should be agnostic to vehicle's behavior to be basic).~~
Also, PX4 will be able to handle this change using this logic (although some legacy parameter translations / user awarenesses would be needed): https://github.com/PX4/PX4-Autopilot/pull/15949
And we need to make sure for ArduPilot this will work out as well. Judging from [the way Steer / Throttle Manual override isn't differentiated](https://github.com/ArduPilot/ardupilot/blob/b2a38c0c6033a56bd4e7f7bffe65b70381d6ea76/Rover/GCS_Mavlink.cpp#L814-L815) in Rover code, I guess ArduPilot already uses full range (-1000 ~ +1000) definition for the internal RC throttle data, @peterbarker. Did you not have problem with QGC, regarding this point?
## TODOs
- [ ] I am still unclear how the rcTrim value would then get set for throttle, need to check the state machine logic to be sure.