568 Commits

Author SHA1 Message Date
Julian Oes
e46e4dc80e commander: prevent race condition after mission
When a mission finishes with an RTL command, there's a race condition
between:
1. RTL command setting user_mode_intention RTL
2. Mission completion logic forcing LOITER

The auto-loiter transition was checking current nav_state (which is
still AUTO_MISSION) instead of any pending user_mode_intention,
causing it to override the RTL request.

Fix: Only auto-transition to loiter if no mode change is already
pending.
2025-06-30 09:20:44 -07:00
Marco Hauswirth
6604c52c98
Commander: Adjust home position altitude after GNSS altitude correction (#25003)
Within the first 2min of a flight, check if the integrated GNSS vertical velocity and the baro
measurements disagree with the reported GNSS altitude, and in that case update the 
set home position altitude to cancel out GNSS altitude drift.

* prevent re-init when reaching negative altitudes

* only allow correction during the first 120 second after takeoff

* add dependency to COM_HOME_EN parameter. reset vel-integral for multiple takeoffs
2025-06-18 13:26:45 +02:00
Pedro Roque
6d15019717
feat: spacecraft tooling for commander and VehicleStatus (#24716)
* feat: spacecraft tooling for commander and VehicleStatus

* fix: format

* fix: remove iostream

* feat: mavlink compliant spacecraft definition

* feat: add orbiter to define

feat: spacecraft tooling for commander and VehicleStatus

fix: format

fix: remove iostream

feat: mavlink compliant spacecraft definition

* feat: add orbiter to define

* feat: update mavlink to latest

* fix: get away without specifying spacecraft vehicle

* fix: removed unnecessary definition

* fix: format
2025-06-12 21:48:48 +02:00
Mahima Yoga
c9658f28e9
commander: use existing class state to track mission progress (#24947)
Replaced the local variable landed_amid_mission with the class member _mission_in_progress for consistency and to reduce redundancy.
No functional change.
2025-06-09 18:17:13 -08:00
Mahima Yoga
2110da73ad
Commander: don't reset Home position if landed during a (uncompleted) mission. (#24902) 2025-06-02 10:50:03 +02:00
Silvan Fuhrer
d857a278ff Commander: use is_ground_vehicle() consistently instead of checking vehicle_type
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2025-03-04 12:15:01 +00:00
Silvan Fuhrer
7cb6464cfb VehicleStatus.msg: remove VEHICLE_TYPE_UNKNOWN
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2025-03-04 12:15:01 +00:00
bresch
2d1652f499 Commander: fix parachute trigger
Setting "lockdown" disables the actuators. In this mode,
"force_failsafe" has no effect as the actuators are disabled, so the
parachute is not getting released as it requires the output to change to
its failsafe value.
2025-03-03 15:41:39 +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
Silvan
14941bc270 Commander: handle mode change rejection the same for RC and MAVLink
Previously, when requesting a mode switch to Position without a valid
position estimate through an RC button, the mode change to Position mode
was not rejected if COM_POSCTL_NAVL was set to 1 and instead the system
switched to Altitude mode.
If the mode request instead came in through MAVLink it was rejected.
This commit aligns the two ways of changing a flight mode.

Signed-off-by: Silvan <silvan@auterion.com>
2025-02-28 14:22:36 +01:00
Silvan
1f2dba68d2 remove avoidance library and logic
Signed-off-by: Silvan <silvan@auterion.com>
2025-02-18 14:33:16 +01:00
Hamish Willee
9e5cfa330a Commander: Quick calibration supports mag too 2025-02-04 21:58:03 -05:00
Matthias Grob
5e2848312d Commander: start timer for auto disarm after spoolup 2025-01-14 14:55:34 +01:00
Beat Küng
aca5a70964 standard_modes: add vehicle-type specific standard modes
See https://mavlink.io/en/messages/development.html#MAV_STANDARD_MODE.
The only standard mode that is not set is MAV_STANDARD_MODE_SAFE_RECOVERY,
as PX4 uses RTL for that (with configuration parameters).
2024-12-18 07:12:36 +01:00
Beat Küng
be300b767d commander: ensure health report is always sent out before failsafe notificaation
As the failsafe message can reference the health report, the health report
needs to be sent out first. This is generally the case, except there is a
rate limiter set to 2 seconds. So if the report changes quickly, it is
sent out delayed (potentially after the failsafe report).
2024-11-21 14:16:22 +01:00
Matthias Grob
044d13635d Commander: Change user facing messages to "Remote ID" instead of "OpenDroneID"
Apprently users reference the system like that and OpenDroneID
might already be too technical, less understandable to some.
2024-11-21 11:38:23 +01:00
Matthias Grob
651552c9b8 Commander: avoid automatic type deduction where neither the type is obvious nor it helps with readability 2024-11-12 21:21:40 -05:00
RomanBapst
a0e6f9cd70 commander: try to fix arm authorization spamming
Signed-off-by: RomanBapst <bapstroman@gmail.com>
2024-10-14 14:18:00 +03:00
Daniel Agar
332b7bec27 commander: ignore REQUEST_CAMERA_INFORMATION
- add answer command logging
2024-09-27 10:33:37 -07:00
BazookaJoe1900
4d83badba1
fix files tags on the header comments (#23564) 2024-09-19 09:25:18 +03:00
Matthias Grob
e4d25df58a Consistently use "stick gesture" for "rc stick gesture" 2024-09-05 18:06:29 +02:00
Silvan Fuhrer
8eaf93468e Commander: feedback string for arming/disarming: make clear when from gesture
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2024-09-05 18:06:29 +02:00
Silvan Fuhrer
d967cdbb48 Manual control: rename SOURCE_RC_STICK_GESTURE to SOURCE_MANUAL_CONTROL_GESTURE
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2024-09-05 18:06:29 +02:00
Silvan Fuhrer
81cf6a736d
Commander: add VEHICLE_CMD_EXTERNAL_POSITION_ESTIMATE to list of externaly handled commands (#23642)
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2024-09-05 11:20:39 +02:00
Silvan Fuhrer
6fa6360aef
Commander: always allow to switch to LAND mode (#23580)
Special handling for LAND mode: always allow to switch into it such that if used
as emergency mode it is always available. When triggering it the user generally wants
the vehicle to descend immediately, and if that means to switch to DESCEND it is fine.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2024-09-03 18:10:37 +02:00
Ramon Roche
54f7b58007 Commander: lock down mav sys and comp id
- keeps them as local params at init
- only allow to set at init
2024-08-23 11:19:25 -04:00
Matthias Grob
edcda80cb9
Commander: adhere to parameter naming convention (#23466) 2024-07-30 14:27:27 +02:00
Jukka Laitinen
6435e25929 commander: Use PX4_STACK_ADJUSTED to increase stack for 64-bit targets
Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
2024-04-29 08:11:54 +02:00
Igor Mišić
61ca65d863 mavlink: use high_latency_data_link_lost as backup to normal data_link 2024-04-25 08:23:32 +02:00
Igor Mišić
4f8de500af iridiumsbd: update logic for detecting if the modem is not responsive 2024-04-25 08:23:32 +02:00
Igor Mišić
de23c10b68 commander: improve handling high latency link lost/regain 2024-04-25 08:23:32 +02:00
Igor Mišić
df2cc4af05 commander: fix check for availability of high latency link
Signed-off-by: RomanBapst <bapstroman@gmail.com>
2024-04-25 08:23:32 +02:00
Silvan Fuhrer
6e15dd5328 Commander: trigger warning when arming denied due to check failure
Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
2024-03-15 09:34:11 +01:00
Eric Katzfey
ae947513d7
add load_mon support for Qurt platform (#22883)
- Added check in commander to see if CPU load monitoring has been disabled before signalling overload
2024-03-13 21:33:58 -04:00
Beat Küng
c78389a855 commander: send ack for VEHICLE_CMD_DO_SET_ACTUATOR 2024-02-02 09:38:28 -05:00
Peter van der Perk
84093a07a2 reboot: Add reboot to ISP option 2024-01-04 11:17:16 -05:00
Matthias Grob
ef0926d64b Commander: add position slow mode 2023-12-08 21:17:59 +01:00
Konrad
36f0c0f0bf mavlink-mission: Add support for opaque ids and replace update counter with it 2023-11-29 11:10:40 -05:00
Konrad
a92e7a8796 missionResult: remove unnecessary constants and rename instance_count to mission_update_counter 2023-11-24 08:11:41 +01:00
Matthias Grob
ead16d0e6c Commander: add parameter to disallow disarming in manual thrust modes 2023-11-17 09:53:56 +01:00
Matthias Grob
78987f6016 ManualControl: introduce stick gesture for killing 2023-11-17 09:53:56 +01:00
Beat Küng
bb900264e0 commander+mavlink: implement MAVLink standard modes 2023-11-15 13:18:58 +01:00
Beat Küng
b46e1d744b commander: add config overrides 2023-11-15 13:18:58 +01:00
Beat Küng
889b6a1a78 commander: add VEHICLE_CMD_SET_NAV_STATE internal command 2023-11-15 13:18:58 +01:00
Beat Küng
fbbccf6997 commander: implement external modes and mode executors 2023-11-15 13:18:58 +01:00
Matthias Grob
9d455d5f1f ThrowLaunch: move into separate class 2023-11-13 11:57:19 +01:00
Michał Barciś
1a48f311ea ThrowLaunch changes after PR
Signed-off-by: Michał Barciś <mbarcis@mbarcis.net>
2023-11-13 11:57:19 +01:00
Michał Barciś
c2b4f051f9 Added Throw Launch feature
More details in the PR: https://github.com/PX4/PX4-Autopilot/pull/21170

Signed-off-by: Michał Barciś <mbarcis@mbarcis.net>
2023-11-13 11:57:19 +01:00
Konrad
8edd7ce2c1 kconfig: Add option to enable figure of eight support 2023-10-31 15:57:59 -04:00
Konrad
e5e66370e7 FixedwingPositionControl: Add support for figure 8 loitering.
The command is sent by a dedicated mavlink command and forwarded to the fixed wing position controller.

The pattern is defined by the radius of the major axis, the radius of the minor axis and the orientation. The pattern is then defined by:
The upper part of the pattern consist of a clockwise circle with radius defined by the minor axis. The center of the circle is defined by the major axis minus the minor axis away from the pattern center.
The lower part of the pattern consist of a counter-clockwise circle with the same definitions as above.
In between, the circles are connected with straight lines in a cross configuration. The lines are always tangetial to the circles.
The orientation rotates the major axis around the NED down axis.

The loitering logic is defined inside its own class used by the fixed wing position control module. It defines which segment (one of the circles or lines) is active and uses the path controller (npfg or l1-control) to determine the desired roll angle.

A feedback mavlink message is send with the executed pattern parameters.
2023-10-31 15:57:59 -04:00