832 Commits

Author SHA1 Message Date
Matthias Grob
a048a8e8a0 mavlink_receiver: refactor manual_control.throttle extraction to exactly match MAVLink output 2025-03-21 11:44:51 +01:00
Sebastian Domoszlai
b5f37c9fa6
Simplify Battery-related Enum Naming (#24265)
* Simplify battery-related enum naming

* Fix mistakenly removed string in enum names

* Fix missing renamings

* Update outdated file

* msg: Increase battery_status version since the enum naming was changed

* Revert message version increase

---------

Co-authored-by: Matthias Grob <maetugr@gmail.com>
2025-02-28 11:42:40 -09:00
Eric Katzfey
5fb810a5ea voxl_esc: Added Mavlink tunnel UART pass-through mechanism 2025-02-26 18:04:34 -05:00
Matthias Grob
0b370ab5d3 Remove obstacle avoidance MAVLink Heartbeat check 2025-02-18 14:33:16 +01:00
Silvan
b916a96e00 Remove uorb topics exclusively used for avoidance
- TrajectoryBezier.msg
- TrajectoryWaypoint.msg
- VehicleTrajectoryBezier.msg
- VehicleTrajectoryWaypoint.msg

Additionally remove TRAJECTORY_REPRESENTATION_WAYPOINTS mavlink stream.

Signed-off-by: Silvan <silvan@auterion.com>
2025-02-18 14:33:16 +01:00
Marco Hauswirth
d2cbe10243
Clean up temperature msg fields (#24272)
* remove temp field from airspeed.msg, adjust temp selection

* temp-sensor hirarchy: airspeed, ext. baro, default value

* directly use diff-press or baro temp in true-airspeed  calc

* improve clarity

* add enum for temperature source in VehicleAirData.msg
2025-02-18 13:23:10 +01:00
Julian Oes
a9214b3aa3
gimbal: don't spoof gimbal device (#24271)
The current approach was wrong because the gimbal protocol now
handles the case properly where the autopilot is in charge of a
non-MAVLink gimbal.

This means that we don't need to send message "as if we were a gimbal
device" and instead set thet gimbal_device_id to 1 (up to 6) to indicate
we are in charge or a non-MAVLink gimbal.
2025-01-31 12:59:41 +13:00
Marco Hauswirth
4a5aa1e947
Fix max-hagl restriction to position/altitude control (#23667)
* fix max-hagl restriction to position/altitude control

* max hagl vel restriction in ManAcc position mode

* use interpolate func, change naming

* simplyfied vertical vel limitation

* move velocity-constraint adjustment to StickAccelXY
2025-01-20 15:50:21 +01:00
Matthias Grob
61961350f9 mavlink_receiver: don't publish out of range joystick input
Note that the MAVLink definition explicitly writes
"A value of INT16_MAX indicates that this axis is invalid."
which before this change was happily executed.
2024-12-19 17:59:41 +01:00
Stefano Colli
0561f6c9fc
GZ: add gimbal simulation (#23382) 2024-12-18 12:15:03 +01:00
Julian Oes
98fde4cbac gimbal: correctly set gimbal_device_id
When we use a gimbal connected via "RC", so PWM via the Aux channels, we
need to set the gimbal_device_id to 1 as per the protocol.

This was missing for GIMBAL_DEVICE_ATTITUDE_STATUS, so I added that, and
fixed the name of that variable while at it.
2024-12-18 07:51:40 +01:00
Matthias Grob
b5d18c6131 Remove unused collision_report message 2024-11-12 21:18:57 -05:00
Julian Oes
d8be547b06 mavlink: drop acks early that aren't for us
This fixes an issue where we dropped acks that we should have sent out
just because the queue was clogged with acks that have nothing to do
with us and just happen to be sent to us. We should just ignore them and
not publish them to uORB.
2024-11-07 17:10:05 +13:00
Julian Oes
25e071e21d mavlink: no acks for commands that aren't for us
We should not send out acks for commands that are not targetted at us.
This can confuse other MAVLink components and MAVLink commands just
don't scale that way, and it unnecessarily fills up our ack queue.

This was likely introduced to debug when MAVLink components were
implemented incorrectly sending commands to a wrong target.

The most we should do in this case is to print/log an info.
2024-11-07 17:10:05 +13:00
Julian Oes
01888a3085
mavlink: fix SET_MESSAGE_INTERVAL parsing (#23796)
This fixes the SITL tests that fail in CI because we catch NAN as non
zero after cast to int. To fix this I've added the check whether they
are finite at all.

The checks for param5 and param6 would be a bit trickier because they
can be int or float, so I have omitted them for now.
2024-10-11 09:03:22 +13:00
Hamish Willee
66b9e60a49
MAV_CMD_SET_MESSAGE_INTERVAL reject non-zero values for unused params (#23643)
* MAV_CMD_SET_MESSAGE_INTERVAL reject non-zero values for unused params

* Remove data rate

* Replace rounding with addition of 0.5/0.5f
2024-10-09 21:08:49 +13:00
Matthias Grob
fd04ece6d4 geo: remove dependency on drv_hrt time driver 2024-10-07 14:24:18 +02:00
Julian Oes
cd63cfed3a remoteid: implement System as sent from GCS
This will send the System message if it is already being sent by a ground
station. Otherwise, it will assemble the message itself using the
takeoff/home location.
2024-09-02 16:20:10 +12:00
Julian Oes
7d1d398984 remoteid: add SelfID message 2024-09-02 16:20:10 +12:00
Julian Oes
04ea4f9b3a uavcan: add OpenDroneID ArmStatus, operator ID
In order to have operator ID be sent by QGC, we need to forward
ArmStatus from the remote ID module (here on DroneCAN) to MAVLink.
2024-09-02 16:20:10 +12:00
Jaeyoung Lim
e008ca24f1
Remove euler angles from attitude setpoint (#23482)
* Remove euler angles from attitude setpoint message

* Remove usage of euler angles in attitude setpoint messages

This commit removes the usage of euler angles in the vehicle_attitude_setpoint messages

* Fix standard vtol
2024-08-12 16:42:51 +02:00
Matthias Grob
fdfe43471e
mavlink_receiver: limit access through instances with gimbal mode
This adds explicit handling for the few things we want to allow through a MAVLink instance dedicated to a gimbal/(camera) payload as per the MAVLink gimbal mode configuration.
2024-08-09 10:13:44 -04:00
Matthias Grob
6cf0bf5e19 Support MAVLink extension MANUAL_CONTROL.aux
Note that in uORB we don't currently know if the aux fields are
specifically valid or not so we can also not set the corresponding
bits in the field.
2024-08-09 10:49:38 +02:00
Silvan Fuhrer
33701aa3d5 BatteryStatus: remove voltage_filtered_a
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2024-07-03 16:41:49 +02:00
Silvan Fuhrer
c2ae6a7e24 BatteryStatus: remove current_filtered_a
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2024-07-03 16:41:49 +02:00
zhangteng0526
e03e0261a1 Fix buffer overflow in mavlink_receive.cpp 2024-07-03 08:11: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
Matthias Grob
9a7a977625 mavlink_receiver: put all message handling in the same function 2024-06-05 16:13:52 +02:00
asimopunov
f95a2021cd
adsb: warnings fixes & remove UTM_GLOBAL_POSITION (#21663)
- warn about full traffic conflict buffer at 1/60hz.
- add conflict expiry for buffer.
- use only events for buffer full warning. mavlink_log_critical no longer needed.
- use icao address for conflict warnings id, stop using uas_id. UTM_GLOBAL_POSITION assumed deprecated.
- stop spamming when buffer is full
- fix warning wording if buffer is full.
- remove UTM_GLOBAL_POSITION

Fixes failing unit test:
* [adsbTest] Reduce conflict timestamps - not enough time has passed in ci
- failed ci output - (passes locally with make tests TESTFILTER=AdsbConflict)
- Timestamp: 6000000000
- Time now: 457720038
- Time since timestamp: 0
- Old Conflict warning expired: 0
- --------------------
- adsb_conflict._traffic_state 0
- ../../src/lib/adsb/AdsbConflictTest.cpp:244: Failure
- Value of: adsb_conflict._traffic_state == TRAFFIC_STATE::REMIND_CONFLICT
-   Actual: false
- Expected: true
2024-04-22 10:14:39 +02:00
Eric Katzfey
d8fabd11d0
Send mavlink manual control buttons field in manual control input topic (#22988)
Pass along button states from manual control mavlink message in new buttons field in manual control input topic
2024-04-09 12:35:42 -07:00
Kjersti Brynestad
91e3ec5884 mavlink: Handle NAMED_VALUE_INT 2023-12-12 20:50:46 -05:00
Matthias Grob
d03030e881 mavlink_receiver: ifdef guard for velocity limits
Since this message is defined in development.xml and
not yet common.xml and some targets use
common.xml and the builds then failed.
2023-12-08 21:17:59 +01:00
Matthias Grob
ca6db94e39 Velocity limit: remove duplicate message and if(true) 2023-12-08 21:17:59 +01:00
Marcin
4cf43a68a3 FlightTask: add subscription to VELOCITY_LIMITS msg 2023-12-08 21:17:59 +01:00
murata
f29c5742be mavlink: Capitalize the first letter of Landing 2023-11-12 15:33:51 +01:00
alessandro
428e7d7754
mavlink: remove double assignment of battery field 2023-11-03 11:49:25 -04:00
bresch
23b31cc5fd manual_yaw: compensate for yaw estimate convergence
When the yaw estimate is converging, the controller makes the drone yaw
in order to follow the current setpoint. This is unintuitive for the
pilot and it is preferable if the drone continues to fly towards the
same physical direction.
2023-08-30 09:56:19 +02:00
Ludovic Vanasse
3a166247c1 Add condition for Iridium mode to not send params change after a time
In the mavlink_receiver code, after a while it will try to resend some
parameter update through the MAVLink instance. But for Iridium links
those are not a good idea. So this adds a condition that prevent the
sending if the MAVLink instance is in Iridium mode.

Related to issue #21496
2023-08-16 11:28:36 -04:00
Sergei Grichine
f000238987 SensorGps.msg: switch to double precision for lat/lon/alt
To match https://github.com/PX4/PX4-GPSDrivers/pull/132 - adding high precision RTK lat/lon/alt components
2023-07-13 07:50:09 +02:00
alexklimaj
dc99a875c3 Mavlink receiver unadvertise all
uorb multi pubs in destructor
2023-05-23 18:40:06 -06:00
Matthias Grob
7b6f45079b ManualControl: use input validity flag to check for RC calibration 2023-05-23 17:24:17 +02:00
Silvan Fuhrer
1218d9b2fc mavlink_mission: remove support for DO_SET_CAMERA_ZOOM
Camera controls should not happen through the flight controller, and
the control allocation has no means of controlling the camera zoom.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-03-16 11:55:45 +01:00
Silvan Fuhrer
27658354da MavlinkReceiver: remove support for SET_ACTUATOR_CONTROL_TARGET
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-03-16 11:55:45 +01:00
AlexKlimaj
e375e02974 Add GPS spoofing state 2023-03-14 20:28:32 -04:00
Daniel Agar
f520d4b3be
Update submodule mavlink to latest Sat Jan 7 12:38:21 UTC 2023
- mavlink in PX4/Firmware (8bc88ed526044a864427a4b65135c3baffabb2ef): 0c7792edfe
    - mavlink current upstream: 74dee05f0c
    - Changes: 0c7792edfe...74dee05f0c

74dee05f 2023-01-04 Beat Küng - component_metadata: add translation schema (#1934)
0267c4cf 2023-01-04 Bob Long - common.xml: add fuel_pressure ext. to EFI_STATUS (#1938)
c64818e8 2023-01-04 Mathieu Mirmont - common.xml: fix typos in AIS_TYPE enumerate (#1939)
2306bf79 2023-01-04 Hamish Willee - Update pymavlink (#1940)
0077129b 2022-10-06 Peter Hall - Development: update airspeed message
fbf84c64 2022-10-05 Peter Hall - gitignore: add /.vscode
817c44d8 2022-12-15 Mathieu Mirmont - Add the MAV_TYPE_VTOL_TILTWING aircraft type (#1933)

Co-authored-by: PX4 BuildBot <bot@px4.io>
2023-01-07 10:55:05 -05: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
83246c84cf Switch manual_control_setpoint.z scaling from [0,1] to [-1,1]
To be consistent with all other axes of stick input and avoid future
rescaling confusion.

Note: for the MAVLink message 69 MANUAL_CONTROL it's using the full range
according to the message specs now [-1000,1000].
2022-11-28 19:25:55 +01:00
Matthias Grob
5579e319ff mavlink_receiver: refactor forgotten manual_control_setpoint naming 2022-11-28 19:25:55 +01:00
Michael Schaeuble
d7fde289de Use gimbal attitude for the camera feedback when available
The CameraFeedback module used only the vehicle attitude for the camera orientation so far. With this change, the gimbal_device_attitude_status is used to compute the global camera orientation when a gimbal is used.
2022-11-14 09:26:14 -05:00
Matthias Grob
5ca28dd6dc Use isAllFinite() in all places that check finiteness on entire vectors or matrices 2022-10-19 19:09:20 +02:00