81 Commits

Author SHA1 Message Date
Hamish Willee
f03131cfd3
MAVLink PARAM_ERROR support (#25699)
Co-authored-by: PX4BuildBot <bot@pixhawk.org>
2025-10-17 13:29:23 +11:00
airpixel-cz
2b0ea50d16
mavlink: parameters: fix camera and cannode param message routing 2025-09-26 23:16:05 -08:00
Beat Küng
bb3fd295ea mavlink: reduce rate multiplier to 0.25 while sending parameters
Co-authored-by: alexcekay <alexander@auterion.com>
2025-08-08 16:43:29 +02:00
Stefano Colli
d79302c366
mavlink_parameters: throttle MAVLink param transmission on low-bandwidth links (#25126)
* mavlink_parameters: throttle MAVLink param transmission if in low-bandwidth mode

* mavlink_parameters: simplify param transmission throttling

---------

Co-authored-by: Matthias Grob <maetugr@gmail.com>
2025-07-08 13:48:23 +02:00
Matthias Grob
9c83f842be
autostart scripts: Reintroduce SYS_PARAM_VER (#22813)
The case where the airframe maintainer wants to enforce a reset to airframe is
not covered anymore with the `param set-default` mechanism. For products based
on PX4 this is still required to ensure proper functionality after a major update.
2024-06-18 09:32:51 +02:00
Silvan Fuhrer
f4e76cd392
remove deprecated BAT_ params (#22872)
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2024-06-14 14:42:32 +02:00
Matthias Grob
68769ea0ec mavlink: use reference instead of pointer to access the MAVLink instance from protocol classes 2024-06-05 16:13:52 +02:00
Daniel Agar
60b85c2e1a
mavlink: add kconfig option to disable UAVCAN parameter bridge
- depends on DRIVERS_UAVCAN
2023-03-08 19:30:06 -05:00
Daniel Agar
8fc3b05491 mavlink: param_get proper type to silence errors 2021-11-22 09:08:38 -05:00
marcojob
68a13326f0
mavlink: remove unused strncpy (#18300) 2021-10-01 10:58:25 +02:00
Beat Küng
b31276a4f5 mavlink: switch to events 2021-09-11 14:08:41 -04:00
Daniel Agar
e9f84ba708 keep minimal legacy battery parameters for older QGC usability
- BAT_V_EMPTY, BAT_V_CHARGED, BAT_V_LOAD_DROP, BAT_N_CELLS
2021-07-23 15:07:53 -04:00
Beat Küng
9dd6bef7f9 autostart scripts: remove SYS_PARAM_VER
With the airframe defaults there's no use for that anymore
2021-03-31 20:12:05 -04:00
brad112358
d53fcb0bab
mavlink: use RADIO_STATUS to regulate parameter sending 2021-02-22 18:57:29 -05:00
Daniel Agar
967d35a6b6
rate limit most parameter_update subscriptions
- parameter updates can be quite expensive because they trigger nearly all modules to reload all of their parameters immediately
 - limit modules from updating faster than once per second
2021-01-10 21:09:15 -05:00
Daniel Agar
409ea2ac02
mavlink: parameters manually mark active minimal QGC set on first send 2020-12-27 13:54:03 -05:00
Julian Oes
a1b54eb655 mavlink: check index for out-of-bounds
If a MAP_RC_PARAM message is sent with an index > 2, this would lead
to undefined behaviour or a segfault/hardfault.
2020-12-09 08:59:57 +01:00
Daniel Agar
f26d4f2b6b mavlink: stop unnecessarily passing around time 2020-10-09 10:30:30 -04:00
Daniel Agar
f7cf1ffc41 drivers/uavcan: remove MAVLINK header dependency 2019-12-31 21:01:21 -05:00
Daniel Agar
a7f330075a clang-tidy: enable hicpp-braces-around-statements and fix 2019-10-28 10:50:31 -04:00
BazookaJoe1900
3007b0876c mavlink: add protection against setting wrong type of parameters 2019-10-14 11:18:08 -04:00
Daniel Agar
fe4f6c186e Mavlink: ifdef networking code 2019-09-21 13:46:01 -04:00
Daniel Agar
494f35d5f4
Mavlink: wait for boot complete before sending or receiving anything 2019-09-18 09:07:55 -04:00
Daniel Agar
f280977ed0
mavlink: update orb_publish to uORB::Publication<> 2019-09-02 23:51:54 -05:00
Daniel Agar
e69398c09f introduce uORB::PublicationQueued and transition most orb_advertise_queue usage 2019-08-04 10:08:09 -04:00
Daniel Agar
34598fe353
mavlink uavcan parameters initialize value 2019-08-03 15:05:34 -04:00
Daniel Agar
579cbbb42c mavlink move to new lightweight uORB::Subscription 2019-06-03 17:06:21 -04:00
Daniel Agar
f3533d31f8 mavlink update to latest and enable address-of-packed-member warning 2019-03-14 09:56:09 +01:00
Roman Bapst
bef8b6b949 mavlink hash check: return early in case of hash check parameter (#10861)
*  a request for setting the '_HASH_CHECK' parameter is handled differently
than the same request for a standard parameter. Make sure we don't actually
try to set the parameter.

Signed-off-by: Roman <bapstroman@gmail.com>
2018-11-25 14:01:23 -05:00
Julian Oes
428c2f72bd mavlink: always acknowledge a param write
This change has two effects:
1. We always acknowledge a param write no matter if the value was
   actually changed or not. This is according to the spec:
   https://mavlink.io/en/services/parameter.html#write-parameters
2. This fixes the bug where int32 parameters were not actually acked
   because the memory of the param value was casted directly to float
   and then compared. In the case of a int32 parameter set from 0 to 1
   it would mean that the cast to float of the memory representation
   was still 0 and therefore it was assumed to be "no change" and the
   ack was omitted.
2018-11-01 00:06:22 +01:00
Roman Bapst
f361749d70 mavlink temporary workarounds for dronekit: added parameters to disable (#10422)
hash check and heartbeat forwarding

- hash check disabling: for systems where a companion link forwards messages
to QGC (e.g. via LTE) parameter streaming will be stopped as soon as QGC
sends the request to stop the stream. If the companion side for some reason
still requires the stream to be active we need to disable QGC from stopping
the stream. Normally dronekit should be responsible for filtering out the
request from QGC but apparently this is not possible.

- disable heartbeat forwarding: dronekit does seem to get confused if
heartbeats from another system other than the autopilot get forwarded to it.
Example: Sending messages from QGC via the autopilot to dronekit running on
companion computer.

Signed-off-by: Roman <bapstroman@gmail.com>
2018-09-17 13:24:20 -04:00
David Sidrane
8aa1d4d68d BUGFIX hardfault FMUv5 List was used before being initalized.
_uavcan_open_request_list was accessed before it was initalized.
2018-06-12 13:44:04 -07:00
Beat Küng
289e618b6c mavlink: fix compiler warnings with GCC 8.0.1
-Wno-extra-semi is not valid for C code
2018-05-09 07:59:46 +02:00
Lorenz Meier
27e64149f0 MAVLink app: Avoid comparing to zero for value change
No functional change, but this avoids numerical issues in the check routine. Since the routine will tend to false positives, we will tend to send more param updates than required in case of numerical noise of the float representation. This is desired, as we prefer to send two updates rather than not sending one.
2018-01-08 09:27:22 +01:00
Lorenz Meier
f284385c3f MAVLink parameters: Send all updated parameters asynchronously
Parameters can change not just based on GCS request, but also due to internal code or requests by a different valid connected control authority such a cloud service. This change ensures that all connected systems get updated via MAVLink asynchronously.
2018-01-08 09:27:22 +01:00
Lorenz Meier
fba592b5fc MAVLink app: Send newest param hash for every param change to notify GCS about change
This should help keeping the GCS up to date about asynchronous changes on the autopilot.
2018-01-08 09:27:22 +01:00
Lorenz Meier
4eac493413 MAVLink app: Remove deprecation support for old param
This has been out of use for more than a year now and is no longer required.
2018-01-08 09:27:22 +01:00
Daniel Agar
ce78f254c2 mavlink parameters initialize struct
- fixes CID 141890
2017-10-31 08:11:18 +01:00
Beat Küng
a89980f440 MavlinkParametersManager: update sending rate
This is an adjustment due to the changed calling frequency of send()
(was 300 Hz, is now 100 Hz)
2017-05-18 09:48:14 +02:00
Beat Küng
d70caeb24b MavlinkParametersManager: remove MavlinkStream inheritance 2017-05-18 09:48:14 +02:00
Beat Küng
45af77a543 mavlink parameters: try to send 5 params at once on USB & UDP connections
This further speeds up param loading.

On Pixracer via USB, it's possible to send up to 11 at once before the TX
buffer gets full, so there is still enough free bandwidth left.
2017-03-14 21:30:04 +01:00
Michael Schaeuble
0d61e22d9b mavlink: Buffer UAVCAN parameter re-requests
We buffer the mavlink messages and don't forward them directly
via uORB. This solves an issue where many requests are dropped and
QGC does not start properly in combination with UAVCAN devices.
2017-02-17 09:15:56 +01:00
Lorenz Meier
3eb7caba4f MAVLink param handling: Exclude Coverity false positives 2017-01-14 07:47:03 -08:00
Daniel Agar
c9956e25b4 mavlink fix code style 2017-01-07 01:03:18 -05:00
Lorenz Meier
86c581b2ef Enable usage of UAVCAN node ID for params 2016-11-13 18:43:15 +01:00
Lorenz Meier
9866ff8959 Allow sending a param with a different component ID 2016-11-13 18:43:15 +01:00
Beat Küng
643ccd66b6 MavlinkParametersManager: output deprecation warning if INAV is selected 2016-11-08 11:17:07 +01:00
Lorenz Meier
720c445f21 MAVLink: Code style 2016-08-26 23:43:33 +02:00
Lorenz Meier
71d150f6ec MAVLink app: Fix rate handling 2016-07-10 17:05:33 +02:00
Beat Küng
0eb22823a6 fix resource leak in MavlinkParametersManager: call orb_unsubscribe 2016-06-07 10:05:59 +02:00