49 Commits

Author SHA1 Message Date
Alex Klimaj
297ddabe70
drivers: rc_input only publish if more than 0 rc channels filled (fixes GHST auto scan) 2024-04-09 11:19:41 -04:00
David Sidrane
b556d668f8 RCInput:Add Support for RX-TX SWAP using onewire
A board can optionaly define RC_SERIAL_SWAP_USING_SINGLEWIRE
   If the board is wired board with TX to the input (Swapped) and
   the SoC does not support U[S]ART level RX-TX swapping to allow
   useing onewire to do the swap if and only if:

     RC_SERIAL_SWAP_USING_SINGLEWIRE   is defined
     RC_SERIAL_SWAP_RXTX               is defined
     TIOCSSWAP                         is defined and retuns !OK
     TIOCSSINGLEWIRE                   is defined
2024-01-16 17:09:26 -05:00
Beat Küng
d1266c856f rc_input: prevent error output during boot on boards with px4io
output:
INFO  [rc_input] valid device required
ERROR [rc_input] Task start failed (-1)
2023-09-14 10:40:54 -04:00
Matthias Grob
7d0596d244 RCInput: follow topic name convention 2023-05-23 17:24:17 +02:00
chris1seto
77fdce9f3c
drivers/rc/crsf_rc: update standalone driver for CRSF and direct support for lq/rssi (#20084)
Co-authored-by: Chris Seto <chris1seto@gmail.com>
2022-09-23 19:19:25 -04:00
Daniel Agar
54b5d4c5b8 drivers/rc_input: don't allow starting on the px4io serial port 2022-09-14 21:23:30 -04:00
Junwoo Hwang
32ae00fd44
Move Vehicle Command Result Enum defs to Vehicle Command Ack (#19729)
- As it is always only used for the vehicle command ack message
- It was a duplicate, hence making it error prone for maintainment
- The uORB message comments were updated to make the relationship with
the MAVLink message / enum definitions clear
2022-07-07 16:15:11 +02:00
Daniel Agar
fba7c972d1
drivers/rc_input: ensure RC inversion is disabled initially and latch RC_INPUT_PROTO conservatively
- this allows jumping straight to a non-SBUS RC protocol
 - increased the scan time per protocol 300->500 ms, which the newer DSM parser seems to need in some cases.
 - only set RC_INPUT_PROTO if we've had a successful RC lock for > 3 seconds
2022-05-11 14:30:41 -04:00
Daniel Agar
a15432fac1
drivers/rc_input: RC_INPUT_PROTO parameter minimal implementation (#19539)
Co-authored-by: chris1seto <chris12892@gmail.com>

Co-authored-by: chris1seto <chris12892@gmail.com>
2022-04-27 21:06:43 -06:00
Daniel Agar
0b9f60a037 drivers/rc_input: always provide RC_PORT_CONFIG parameter
- RC_PORT_CONFIG is disabled by default if the board doesn't have
CONFIG_BOARD_SERIAL_RC set
 - allows user facing custom RC configuration that overrides board
defaults
2022-02-10 09:41:32 -05:00
Beat Küng
8a2b310b83 topic_listener: avoid code generation, use existing metadata at runtime
This reduces flash size for v5 by ~110KB, the topic listener now only adds
about 1.2KB.
2021-10-20 08:10:05 +02: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
Daniel Agar
ca685490a9 drivers/rc_input: only print vrssi if analog stable 2021-08-30 12:45:56 -07:00
Daniel Agar
15c01a9732 drivers/rc_input: flush buffers when beginning new scan state 2021-08-30 12:45:56 -07:00
Daniel Agar
a305fc9c34 drivers/rc_input: only invert RC when starting/ending SBUS 2021-08-30 12:45:56 -07:00
Daniel Agar
79703c9c7a drivers/rc_input: don't resume scanning if armed 2021-08-30 12:45:56 -07:00
Daniel Agar
98f89aae9b drivers/rc_input: always report new lock 2021-08-30 12:45:56 -07:00
David Sidrane
4aa7bff8c6 rc_input:Use inttypes 2021-06-16 17:07:47 +02:00
benjinne
9b7eae4043
rc: enable crsf and ghst telemetry on supported boards
Co-authored-by: Benjamin Linne <benjamin.linne.civ@mail.mil>
2021-04-07 08:51:49 +02:00
Daniel Agar
2d6deb4f1c drivers/rc_input: don't accept RX_PAIR cmd when armed 2021-03-24 15:13:38 -04:00
Lorenz Meier
435ef38eda RC Input: Reset lock state when switching to a new protocol 2021-03-24 15:13:38 -04:00
jciberlin
6f5efbeab5 ghst_telemetry: send battery status
Send battery status (ghst_telemetry). Apply factors to show correct values of volts, amps and mAh. Change ghost protocol code to follow more MISRA C++ guidelines.
2021-03-15 09:42:53 +01:00
Daniel Agar
6b1e7ffdb8 rc_input: fix possible string truncation (-Werror=stringop-truncation) 2021-02-26 17:56:14 -05:00
jciberlin
64342f568d Ghost protocol
ghst: add ghost protocol
2021-02-20 11:29:57 +01:00
Daniel Agar
53a14e847d drivers/rc_input: support RC_RSSI_PWM_CHAN 2021-01-26 18:19:52 -05:00
Lorenz Meier
a444d2610a Spektrum passive power: Only use if present 2020-12-31 13:22:52 +01:00
Lorenz Meier
641cc33d79 RC input: Always report DSM state 2020-12-31 13:22:52 +01:00
Lorenz Meier
6529e1444f RC input: Better monitoring
The output is now less confusing in terms of which protocol is currently active.
2020-12-31 13:22:52 +01:00
Lorenz Meier
8445a08bff RC input: Acknowledge binding (or indicate that feature is not implemented) 2020-12-31 13:22:52 +01:00
FengShun
eac9a6b68b Replace PublicationQueued with Publication to automatically configure ORB_QUEUE_LENGTH 2020-10-26 13:01:13 +01:00
Daniel Agar
ddce711acb drivers/rc_input: command line bind use vehicle_command 2020-10-04 22:23:47 -04: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
rfu
8787780de4 some printf format and conversion fixes 2020-05-04 09:49:23 +02:00
SalimTerryLi
dc8e775d8f
ADC: replace ioctl with uorb message (#14087) 2020-03-20 11:23:32 +01:00
Daniel Agar
e3de7e62ea drivers/rc_input: port to linux for testing 2020-01-09 16:16:23 -05:00
Daniel Agar
5f1121c216
rc_input: move to PX4 WQ 2020-01-08 13:00:59 -05:00
Daniel Agar
a475d71ca9
astyle shift module documentation to bottom of files
- Astyle chokes on the module description strings, so for now we can keep them near the bottom of each file.
2019-11-02 10:58:47 -04:00
Daniel Agar
4192414576 clang-tidy: partially fix cppcoreguidelines-pro-type-reinterpret-cast 2019-10-28 10:50:31 -04:00
Daniel Agar
35398e05ca
perf counter cleanup (mostly intervals)
Some of these perf counters were useful during initial development, but realistically aren't needed anymore, some are redundant when we can now see the average interval from `work_queue status` and some of them simply aren't worth the cost at higher rates.
2019-10-21 18:54:17 -04:00
Daniel Agar
26364d44c9
px4_work_queue: command line status output and shutdown empty queues
* adds a work_queue systemcmd that will bring a tree view of all active work queues and work items
 * WorkQueues now track attached WorkItems and will shutdown when the last WorkItem is detached
2019-10-02 12:23:17 -04:00
Daniel Agar
2989ce981c rc_input: move to uORB::PublicationMulti<> 2019-09-30 18:41:23 -04:00
Beat Küng
b7a0e1ef03 boards: simplify RC port configuration by using NuttX ioctl's
A board only needs to define:
 #define RC_SERIAL_PORT                     "/dev/ttyS4"

Then it can optionally define one or more of the following:
 #define RC_SERIAL_SWAP_RXTX
 #define RC_SERIAL_SINGLEWIRE
 #define RC_INVERT_INPUT(_invert_true) px4_arch_gpiowrite(GPIO_SBUS_INV, _invert_true)
2019-07-16 08:09:22 +02:00
Daniel Agar
38da0f95aa rc_input move to uORB::Subscription 2019-07-01 10:35:26 +02:00
Vasily Evseenko
f8c50f442f Fix RSSI in on FMUv4 (pixracer) 2019-03-11 10:55:57 -07:00
Beat Küng
481bfc6308 px4_module: use px4_atomic_t 2019-01-30 10:24:06 -05:00
Daniel Agar
6660418c31 rc_input make RC_SCAN_STRING static constexpr 2018-07-30 10:32:56 -04:00
Daniel Agar
cdf828cbda rc_input don't store cycle_timestamp 2018-07-30 10:32:56 -04:00
Daniel Agar
46254420be rc_input add perf counters 2018-07-30 10:32:56 -04:00
Daniel Agar
658237f36a px4fmu move RC input to new rc_input driver 2018-07-30 10:32:56 -04:00