36 Commits

Author SHA1 Message Date
Matthias Grob
babe93c3bf rc_update: adapt throttle trim calibration for [-1,1]
This is fully backwards compatible: If the throttle trim is set to
the minimum then it's the legacy calibration and gets
interpreted such that there is no trim and behavior remains as before.
If the trim is set to a different value than the minimum then it gets
used like with all other channels which was unsupported before.
2022-11-28 19:25:55 +01:00
Matthias Grob
331cb21dee manual_control_setpoint: change stick axes naming
In review it was requested to have a different name for
manual_control_setpoint.z because of the adjusted range.

I started to investigate what naming is most intuitive and found
that most people recognize the stick axes as roll, pitch, yaw, throttle.
It comes at no surprise because other autopilots
and APIs seem to share this convention.

While changing the code I realized that even within the code base
the axes are usually assigned to a variable with that name or
have comments next to the assignment clarifying the axes
using these names.
2022-11-28 19:25:55 +01:00
Matthias Grob
d81ca65c6f rc_update: replace RC scaling with interpolate function use 2022-11-23 11:06:44 -05:00
Daniel Agar
13f9eabd70 delete unused actuator_controls_3 2022-09-09 09:14:09 -04:00
Beat Küng
7e75b497ae
helicopter: add switch to engage main motor
For helicopters it's useful (e.g. during bringup) to be able to disable
the main rotor while the tail is still controlled to safely land.
2022-09-07 08:00:26 +02:00
Matthias Grob
4bd2d4cf35 rc_update: add unit tests for mode slot
To verify RC mode switch and mode button functionality works as expected.
2022-05-16 14:37:29 +02:00
Daniel Agar
77a37c26bf rc_update: further tighten timing requirements for valid data
- any real RC data input will be much faster than 3 Hz, so this is an
easy way to minimize bogus decoded data from propagating
2022-04-07 14:42:05 -04:00
Daniel Agar
3d08e031d2 rc_update: improve manual_switches simple protections
- require back to back matching switch decode to match within 1 second
 - clear any previous manual switches if RC is unstable
2022-03-25 10:56:24 -04:00
Daniel Agar
6135bb384b cleanup module callback registration failed errors 2022-03-23 20:44:50 -04:00
Julian Oes
e4763f15f6 Mantis: add RC hacks
This changes the way RC is handled for the Mantis:
- The RC values are re-written when arriving over MAVLink. They are
  rescaled from 0..4095 to 1000..2000 and the channel bits added to
  separate channels. This makes the downstream handling easier.
- Gimbal pitch is moved from Aux1 to Aux2 as that should be the default.
- Aux3 and Aux4 are used for the photo and video trigger.
- The speed button is used as the FLTMODE channel and set to switch
  between POSCTL and ALTCTL.
2022-01-10 23:04:10 -05:00
Julian Oes
9fe7a40673 manual_control: enable sending camera commands 2022-01-10 23:04:10 -05:00
Matthias Grob
fabf865411 Use backwards compatible manual_control_setpoint instead of manual_control_input 2021-11-09 16:05:25 +01:00
Julian Oes
14eb656a59 rc_update: use snake_case for namespace name 2021-11-09 16:05:25 +01:00
Julian Oes
6e8ccf6a45 rc_update: rename update method
This reflects better what it actually does.
2021-11-09 16:05:25 +01:00
Daniel Agar
2d816e0b3e [WIP] manual_control selector hacks 2021-11-09 16:05:25 +01:00
Daniel Agar
089c962d92 px4io: moving mixing to FMU side
Using mixers on the IO side had a remote benefit of being able to
override all control surfaces with a radio remote on a fixed wing.
This ended up not being used that much and since the original design
10 years ago (2011) we have been able to convince ourselves that the
overall system stability is at a level where this marginal benefit,
which is not present on multicopters, is not worth the hazzle.

Co-authored-by: Beat Küng <beat-kueng@gmx.net>
Co-authored-by: Daniel Agar <daniel@agar.ca>
2021-09-25 19:15:05 -04:00
Matthias Grob
d1f1e02afb Refactor mode button changes 2021-09-14 09:52:32 +02:00
Claudio Micheli
c50daae4a3 rc_update: introduce support for toggle buttons via RC channels
Signed-off-by: Claudio Micheli <claudio@auterion.com>
2021-09-14 09:52:32 +02:00
Daniel Agar
38bc46fd1a re-add RC_MAP_RATT_SW (unused) and mark active for QGC 2021-04-16 13:07:02 -04:00
Daniel Agar
2492fb35e4 rc_update: require consecutive valid input_rc before publishing 2021-04-15 16:40:54 -04:00
Daniel Agar
bb12fce66c delete RATTITUDE flight mode 2021-03-09 10:47:00 -05:00
Kalyan Sriram
b257f9d1fd actuator: add support for MAV_CMD_DO_SET_ACTUATOR
Adds support for using the MAVLink command MAV_CMD_DO_SET_ACTUATOR to
update the actuator values on control group 3 aux{1, 2, 3}. A simple
deconfliction with rc_update is implemented: when a MAVLink command is
sent, RC is disabled for that channel until a major stick movement is
detected.
2021-03-02 12:41:02 +01:00
Lorenz Meier
8a448718b9 RC update: Do not constrain throttle
If the user calibrated to negative throttle, enable them to use it.
2021-02-14 11:17:28 +01:00
Daniel Agar
ef6209ba03
new manual_control_switches msg (split out of manual_control_setpoint) (#16270)
- split out switches from manual_control_setpoint into new message manual_control_switches
 - manual_control_switches published at minimal rate (~ 1 Hz) or immediately on change
 - simple switch debounce in rc_update (2 consecutive identical decodes required)
 - manual_control_switches logged at full rate rather than sampled at (5-10% of messages logged)
 - manual_control_setpoint publish at minimal rate unless changing
 - commander handle landing gear switch for manual modes
 - processing of mode_slot and mode_switch is now split so we only do one or the other (not both)
     - a future step will be to finally drop mode_switch and accompanying switches entirely

Co-authored-by: Matthias Grob <maetugr@gmail.com>
2020-12-11 12:11:35 -05:00
Daniel Agar
85f3ab1960
rc_update: only decode if RC input is stable (channel count and source) 2020-12-01 09:40:24 -05:00
Daniel Agar
63a23957b1
rc/dsm: decode improvements
- always check system field for validity
 - reject any data outside of "servo position" valid range from Spektrum specification
 - properly support XPlus channels (12+)
 - debug message if channel count changes
2020-08-02 12:52:16 -04:00
Matthias Grob
e9eae1bd76 Refactor: Name manual_control_setpoint the same way everywhere 2020-06-22 12:06:27 -04:00
Matthias Grob
27586db93e rc_update: remove obsolete RC filtering 2020-05-20 19:30:19 +02:00
Julian Oes
e7c655ba52 rc_update: make specific RC loss check only on PPM
This makes the check more specific, so it's only active on PPM input.
2020-02-20 09:02:30 +01:00
bozkurthan
3f16eba3f7 RC Failsafe fix for RFD 868+/900 Modems
RC Failsafe isn't triggered when PPM signal is valid. These changes
update Failsafe trigger logic for RC input. RF Modules keep sending
valid PPM signal when the RC Transmitter is lost.
RF Modules which are in the air send PPM signal with same type when lost
the signal from ground.
2020-02-20 09:02:30 +01:00
Daniel Agar
386673e6c3 fix flt_cutoff_min -> flt_cutoff_max 2019-12-23 23:47:34 +01:00
Daniel Agar
93d392ff80 Update src/modules/rc_update/rc_update.cpp
Co-Authored-By: Beat Küng <beat-kueng@gmx.net>
2019-12-23 23:47:34 +01:00
Daniel Agar
607cb97758 Update src/modules/rc_update/rc_update.cpp
Co-Authored-By: Beat Küng <beat-kueng@gmx.net>
2019-12-23 23:47:34 +01:00
Daniel Agar
57fc98812d rc_update: cleanup parameter usage 2019-12-23 23:47:34 +01:00
Daniel Agar
22a005c9f4
delete module's redundant print_status()
- we can already get the running status from ModuleBase and the other misc information is already available through perf or uORB
2019-11-30 18:22:19 -05:00
Daniel Agar
bc182e94e6
sensors split rc_update into new standalone module 2019-11-24 13:25:11 -05:00