2623 Commits

Author SHA1 Message Date
Niklas Hauser
f45b960eee [mavlink] Use separate mutex for event buffer
This prevents the mavlink transmit loop from waiting on the module mutex
thus not stopping transmissions when the mutex is already taken.

This can happen when calling `mavlink status` from the mavlink shell,
where `Mavlink::get_status_all_instances()` takes the mutex and then
prints the status via pipes to the mavlink transmit buffer.
If that pipe cannot be emptied a deadlock happens.

Since the MavlinkReceiver thread also waits on the module mutex, both
reception and transmission of Mavlink packets are then prevented thus
disabling communications entirely.
2023-10-17 10:05:46 -04:00
vlad-serbanica
af84c2ca7f mavlink_main: increase raw gps latency 2023-10-11 09:53:59 -04:00
Konrad
9a48d375ce mavlink-mission: Calculate land_start and land item directly on mission upload. 2023-09-29 14:25:03 +02:00
Silvan Fuhrer
0df5134156
vfr_hud: fix throttle display for FW and show magnitude for 3D thrust (#22154)
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-09-28 17:15:26 +02:00
RomanBapst
4f1682c3c8 UTM_GLOBAL_POSITION: prevent uint16 overflow
Signed-off-by: RomanBapst <bapstroman@gmail.com>
2023-09-21 08:21:56 -04:00
PX4 BuildBot
3107860a89 Update submodule mavlink to latest Wed Sep 13 20:14:21 UTC 2023
- mavlink in PX4/Firmware (06b8477f853bf0234d0a894dcf6af4718597989f): 58435f6a83
    - mavlink current upstream: 81524c2b34
    - Changes: 58435f6a83...81524c2b34

    81524c2b 2023-09-13 Hamish Willee - Update pymavlink - for fixed wireshark (#2038)
fe14d798 2023-08-31 Matthias Grob - common: extend MANUAL_CONTROL with auxiliary continuous inputs (#2031)
546edec2 2023-08-30 Peter Barker - common.xml: display GIMBAL_MANAGER_STATUS.flags as bitmask (#2035)
16754498 2023-08-28 Richard Allen - fix RC_CHANNELS_SCALED inactive channel (#2032)
a31bf384 2023-08-24 Hamish Willee - Fix c_library_vX build order (#2026)
5887a6af 2023-08-17 auturgy - reserve range in all.xml (#2030)
2023-09-13 18:31:37 -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
Niklas Hauser
af40d5befd nsh: check nsh_consolemain return value
Starting a new console allocates memory dynamically, which can fail.
2023-08-29 10:55:01 -04:00
Julian Oes
cde47e8fc0 mavlink: improve readability
Co-authored-by: Matthias Grob <maetugr@gmail.com>
2023-08-29 13:23:55 +02:00
Julian Oes
448454a317 mavlink: Support voltages > 65v in battery status
If the measured voltage is more than 65v we need to split the voltage
over multiple cells in order to avoid overflowing the uint16. This is
according to the MAVLink spec.

Signed-off-by: Julian Oes <julian@oes.ch>
2023-08-29 13:23:55 +02:00
Julian Oes
74b4902e50 mavlink: fix BATTERY_STATUS extension
The extension fields need to be 0 by default according to the MAVLink
spec. This is because extensions are 0 by default and need to be 0 when
unknown/unused for backwards compatibility.

The patch also simplifies the flow slightly in that it doesn't create a
temporary array but just fills in the cell voltages directly.

Signed-off-by: Julian Oes <julian@oes.ch>
2023-08-29 13:23:55 +02:00
Mathieu Bresciani
6a58f6c7dc
Enable arbitrary euler angle for Mag rotation CAL_MAGx_{ROLL,PITCH,YAW}
- Enable arbitrary euler angle for Mag rotation
  - new CUSTOM rotation enum out of the normal enum range
 - mag_rot: automatically change to custom if euler rot is set
 - sensor_calibration: Magnetometer save custom rotation parameters
 - mag_cal: cross mention rotation parameters
  - This allows the user to see the RPY options when searching for the rotation parameter

---------

Co-authored-by: Junwoo Hwang <junwoo@auterion.com>
Co-authored-by: bresch <[brescianimathieu@gmail.com](mailto:brescianimathieu@gmail.com)>
Co-authored-by: Daniel Agar <daniel@agar.ca>
2023-08-26 14:52:39 -04: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
PX4 BuildBot
4fce159a2a Update submodule mavlink to latest Fri Aug 11 12:38:42 UTC 2023
- mavlink in PX4/Firmware (594d7743bab98001866a2f34e1cc835d5795fb3a): e04677782a
    - mavlink current upstream: 58435f6a83
    - Changes: e04677782a...58435f6a83

    58435f6a 2023-08-09 Hamish Willee - development.xml - remove mission_checksum (#2010)
048237b4 2023-08-02 Hamish Willee - Update Pymavlink - for Ava etc (#2025)
2023-08-11 09:48:45 -04:00
Daniel Agar
88e7452492
commander: collapse ArmStateMachine and simplify
- simplify vehicle_status.arming_state down to just armed and disarmed
    - ARMING_STATE_INIT doesn't matter
    - ARMING_STATE_STANDBY is effectively pre_flight_checks_pass
    - ARMING_STATE_STANDBY_ERROR not needed
    - ARMING_STATE_SHUTDOWN effectively not used (all the poweroff/shutdown calls loop forever in place)
    - ARMING_STATE_IN_AIR_RESTORE doesn't exist anymore
 - collapse ArmStateMachine into commander
     - all requests already go through Commander::arm() and Commander::dismarm()
 - other minor changes
     - VEHICLE_CMD_DO_FLIGHTTERMINATION undocumented (unused?) test command (param1 > 1.5f) removed
     - switching to NAVIGATION_STATE_TERMINATION triggers parachute command centrally (only if armed)

---------

Co-authored-by: Matthias Grob <maetugr@gmail.com>
2023-07-28 17:12:01 -04:00
PX4 BuildBot
37a6ac5c93 Update submodule mavlink to latest Thu Jul 27 12:39:22 UTC 2023
- mavlink in PX4/Firmware (3476e500bf5baa837314e09ff29deeabb719071b): e47dfbb4b7
    - mavlink current upstream: e04677782a
    - Changes: e47dfbb4b7...e04677782a

    e0467778 2023-07-27 JaeyoungLim - Clarify SET_ATTITUDE_TARGET quaternion field (#2020)
2023-07-27 10:32:27 -04:00
Konrad
e4111a03bf mavlink-mission: Initialize the safepoint and mission counter from the dataman state.
If at the last powercycle one mission was uploaded, the counter in dataman was 1. On the next powercycle the mavlink mission counter was reset to zero and on first mission upload updated to 1 again. Other modules check, if the mission was changed based on the counter, like the mission.cpp loaded the mission counter from the dataman. On a new mission, the comparison of the counters failed, because both were the same value even if the mission was completely different.
2023-07-27 07:21:29 +02:00
Beat Küng
133aeb10a6 mision: only run mission feasibility checks when mission updated
Instead of also when geofence/safe points updated.
This prevents reporting multiple times.
2023-07-24 13:10:31 +02:00
Beat Küng
16a144c00f navigator: use mission topic to notify about geofence & safe point changes
This avoids the need to regularly access dataman for checking.
2023-07-24 13:10:31 +02:00
Igor Mišić
3143f6bd0a mavlink_mission & mission: move dataman update to mission 2023-07-24 13:10:31 +02:00
Igor Mišić
55d8adb35b mavlink_mission: remove locking mechanism 2023-07-24 13:10:31 +02:00
Igor Mišić
208552fdab dataman: add DatamanClient with sync functions
Rework of dataman
2023-07-24 13:10:31 +02:00
Martina Rivizzigno
7f78ae449a
update submodule mavlink to latest Thu Jul 6 10:14:36 2023
* remove MAV_PROTOCOL_CAPABILITY_SET_ACTUATOR_TARGET because removed from message def Auterion/mavlink@1c9949e
2023-07-18 11:37:32 -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
Harrison Gieraltowski
018ec97c41
mavlink_log_handler: handle _next_entry (#21784) 2023-07-03 10:30:07 +02:00
Konrad
3303323971 mavlink stream: Heartbeat system status should neglect the actuator_armed.lockdown flag in HIL, since this is always enabled for HIL. 2023-06-16 14:21:32 +02:00
alessandro
f9510557a6 always trigger all cameras 2023-06-09 13:17:45 +02:00
Loïc Dubois
1b9d90e7c4
mavlink: fix mismatch between header macros and class used 2023-05-23 20:44:32 -04: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
Patrick José Pereira
837847f3ad mavlink: Use snprintf over sprintf
Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
2023-05-22 07:46:54 +02:00
PX4 BuildBot
74105907c9 Update submodule mavlink to latest Fri May 19 12:38:47 UTC 2023
- mavlink in PX4/Firmware (0ff9816579d1c5a4086ec7b9d05fe7a79c410df2): 3ee5382d0c
    - mavlink current upstream: 18955a04c7
    - Changes: 3ee5382d0c...18955a04c7

    18955a04 2023-05-11 Nick Exton - common.xml: Add MAV_RESULT_COMMAND_LONG_ONLY and MAV_RESULT_COMMAND_INT_ONLY to MAV_RESULT (#1982)
b92321ba 2023-03-30 Hamish Willee - Update message_definitions/v1.0/common.xml
58ff70f4 2023-03-30 Hamish Willee - COMMAND_ACK progress/result_param2 clarification
31b4aebb 2023-05-11 Julian Oes - cmake: locally install pip dependencies (#1984)
e9bf6a61 2023-05-10 Hamish Willee - Gimbal manager messages - remove WIP tagging (#1980)
0416967f 2023-05-10 Beat Küng - development: changes to standard flight modes (#1915)
ce00667f 2023-05-04 Jonas Vautherin - New cmakelists (#1977)
fdef5cc0 2023-05-03 Nick Exton - common.xml: Prefer COMMAND_INT when command includes altitude field (#1983)
89676d1d 2023-05-03 Nick Exton - common.xml: Add ZOOM_TYPE_HORIZONTAL_FOV to CAMERA_ZOOM_TYPE enum (#1979)
2023-05-19 08:41:38 -06:00
Julian Oes
ddfc2986dc mavlink: flow control param needs reboot
Signed-off-by: Julian Oes <julian@oes.ch>
2023-05-07 21:48:27 -04:00
PX4 BuildBot
e8d12e26c2 Update submodule mavlink to latest Mon May 1 12:39:14 UTC 2023
- mavlink in PX4/Firmware (487c2b03cae972f42a9fe7c397f6949fed63ca3d): d6d86d3f0c
    - mavlink current upstream: 3ee5382d0c
    - Changes: d6d86d3f0c...3ee5382d0c

    3ee5382d 2023-04-20 Peter Barker - common.xml: exclude any stored home location from MISSION_CURRENT.total (#1976)
e0f59ae2 2023-04-13 Hamish Willee - Remove WIP from gimbal device messages/commands (#1973)
181346b5 2023-04-12 Peter Barker - common.xml: remove MAV_CMD_ACK (#1972)
2023-05-01 11:11:15 -04:00
Julian Oes
3f13a6e787 gimbal: implement gimbal_device_id
It turns out that I had omitted implementing the gimbal_device_id which
is the component ID of the gimbal device that the gimbal manager (in
this case PX4) is responsible for.

Signed-off-by: Julian Oes <julian@oes.ch>
2023-05-01 09:02:25 -04:00
Jaeyoung Lim
cbe611ce66 Update mavlink submodule to latest 2023-04-11 07:44:10 +02:00
PX4 BuildBot
58a5aa26a0 Update submodule mavlink to latest Sat Mar 25 00:39:09 UTC 2023
- mavlink in PX4/Firmware (73104cab2e49118903cf32bdf11f6ea917fa394e): 2bdcab78b5
    - mavlink current upstream: e1e68da5e6
    - Changes: 2bdcab78b5...e1e68da5e6

    e1e68da5 2023-03-08 Hamish Willee - Add quickstart to the README (#1960)
9b92bf2e 2023-03-08 Hamish Willee - Fix enum value for payload battery (#1959)
81e9fcd5 2023-03-08 Hamish Willee - Allocate range for ras-a and indicate next free range (#1957)
abbda253 2023-03-02 Hamish Willee - Indicate preference for COMMAND_INT (#1955)
d3a8e4b8 2023-02-08 Julian Oes - development: add command to configure SiK radio
2023-03-24 21:43:59 -04:00
Beat Küng
8497d3388f fix mavlink_ulog: use hrt_abstime instead of float
The float inaccuracy was leading to problems on SITL with large timestamps.
2023-03-20 21:47:41 -04:00
Silvan Fuhrer
17cd65a239 Navigator: remove support for DO_SET_SERVO
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-03-16 11:55:45 +01: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
Silvan Fuhrer
b16f16598b VTOL: remove virtual actuator_controls and instead use virtual torque/thrust topics
MC/FW rate controller and auto tuner: remove actuator_controls

AirshipAttControl: remove actuator_controls

MulticopterLandDetector: remove actuator_controls

mavlink streams vfr_hud and high_latency2: remove actuator_controls

RoverPositionController: remove actuator_controls

UUVAttitudeController: remove actuator_controls

battery: use length of thrust_setpoint for throttle compensation

VehicleMagnetometer: use length of thrust_setpoint for throttle compensation

Signed-off-by: Silvan Fuhrer
2023-03-16 11:55:45 +01:00
AlexKlimaj
e375e02974 Add GPS spoofing state 2023-03-14 20:28:32 -04: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 Mesham
fe48de6240 Check position subscriber before force-send flag when sending GPS global origin stream 2023-03-01 08:52:41 -05:00
DanielePettenuzzo
539f874325 mavlink main - enable gps global origin stream also on mavlink low bw mode and change all rates to 1Hz 2023-03-01 08:52:41 -05:00
DanielePettenuzzo
6bf19ebe23 gps global origin stream - make sure we can always send out the message at least once on request
When requesting a message from a stream that is not active we start the
stream with interval=0 and call the request method once. For all streams
this works fine except the gps_global_origin. For this one the request method
is actually overidden to throttle down the rate and not just send out the message.
This will cause this message to never being sent on request if the stream
is not active by default.
2023-03-01 08:52:41 -05:00
Silvan Fuhrer
526e066d9a Commander: rework GPS invalid warning to use estimator feedback instead of separate GPS quality thresholds
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2023-02-24 13:32:38 +01:00
PX4 BuildBot
192764387d Update submodule mavlink to latest Tue Feb 14 12:38:55 UTC 2023
- mavlink in PX4/Firmware (e7a5dedf48f967465d1f9e6c96a9bf304e1a74b1): e3b8756e37
    - mavlink current upstream: 2bdcab78b5
    - Changes: e3b8756e37...2bdcab78b5

    2bdcab78 2023-02-09 Hamish Willee - undo last commit
9c60f17a 2023-02-09 Hamish Willee - param_id char[] description
841b7683 2023-02-08 Alessandro Ros - remove invalid enum reference from storm32.xml (#1947)
8d4e50ee 2023-02-08 Julian Oes - scripts: install npm dependencies first
72a9b2c3 2023-02-08 Julian Oes - pymavlink: update submodule
2023-02-14 09:53:11 -05:00
Knut Hjorth
db539d15bd mavlink: fix bug when opening /dev/null as default stdin/stdout/stderr
Prior commit added opening of /dev/null as 0, 1 and/or 2 file
descriptors, if they where not present. However, if the temporary
file descriptor used to open /dev/null matched the target file
descriptor, it would be immediately closed again. This commit fixes that,
and does not duplicate and close the temporary file descriptor if it is
already at the correct number.
2023-02-14 08:18:01 +01:00