Beat Küng
491ee01ac4
rpm_capture: add rpm capture driver, publising pwm_input (for now)
2024-12-19 07:30:25 +01:00
Beat Küng
9e9d352eb2
mavlink: update submodule
...
MAV_STANDARD_MODE_SAFE_RECOVERY and MAV_STANDARD_MODE_RETURN_HOME got
merged.
2024-12-18 07:12:36 +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
8ccd43dc1b
refactor commander: remove unused argument is_armed in Report class
2024-11-21 14:16:22 +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
Beat Küng
bfcd4564a6
fix metadata.cmake: add missing paths to json & xml parameter outputs ( #23464 )
2024-08-07 16:17:03 +10:00
Beat Küng
4883f2128a
commander: allow external modes more time for initial response
...
We've come accross a case where a ROS node would consistently take something
over 800 ms until the first arming check request subscription callback was
triggered.
After the first sample, the callback always triggered within the expected
timeframe.
Therefore this patch allows for more time right after registration until
timing out.
2024-08-05 08:43:56 +02:00
Beat Küng
52ac9336c4
boards: change default IP from 192.168.0.3 to 10.41.10.2
...
192.168.0.x is often used by routers for WIFI/ethernet networks, and thus
can create conflicts.
This can happen for example if a companion is connected to the FMU via
ethernet and at the same time connects to a WIFI network as DHCP client.
2024-06-10 11:05:50 +02:00
Beat Küng
a90cdcfe80
boards/px4/fmu-v{5,6}x: enable uxrce_dds_client on ethernet by default
2024-06-10 11:05:50 +02:00
Beat Küng
2524ac8c2b
boards/px4/fmu-v{5,6}x: do not enable mavlink on ethernet for skynode
2024-06-10 11:05:50 +02:00
Beat Küng
ca112fea8a
fix commander: make sure to count all valid mags in preflight check
...
Previously, if a mag was not required (not index 0 and not used by ekf),
it was not counted in num_enabled_and_valid_calibration.
If a user set SYS_HAS_MAG to e.g. 3, it would then trigger a preflight
failure, even if there were 3 calibrated and enabled mags.
2024-05-31 12:30:34 -04:00
Beat Küng
e1ffc2cdaa
commander: add check for 5V overcurrent
2024-05-22 09:34:04 +02:00
Beat Küng
e17faece3d
mavlink_ftp: do not store reply on kErrNoSessionsAvailable
...
This would interfere with an existing ongoing session
2024-05-07 07:26:12 +02:00
Beat Küng
f002b08e6a
mavlink_ftp: ensure there's enough space for the 2. path in _workRename
...
Prevents accessing invalid memory when reading ptr + oldpath_sz + 1 and
oldpath_sz fills out the whole or N-1 bytes of the payload.
2024-05-07 07:26:12 +02:00
Beat Küng
f16115d8be
mavlink_ftp: handle relative paths correctly
...
by ensuring there's a '/' in between when concatenating the path with
_root_dir.
2024-05-07 07:26:12 +02:00
Beat Küng
9e6dcb1f60
fix mavlink: cmd_logging_{start,stop}_acknowledgement flags were not reset
...
Regression from https://github.com/PX4/PX4-Autopilot/pull/23043
Also avoids a race condition by making sure the command ack is handled
before sending out the mavlink message (in case an external component
reacts immediately to the mavlink message).
2024-05-03 06:59:55 +02:00
Beat Küng
547209e1dc
libevents: update submodule
...
And remove obsolete libevents_definitions.h
2024-04-29 07:22:40 -07:00
Beat Küng
f543951e10
commander: set correct health component when reporting errors
2024-04-24 16:06:32 -04:00
Beat Küng
2e12e14a23
boards/px4/fmu-v5x: remove sd_stress & reflect to reduce flash usage
2024-03-21 20:58:21 -04:00
Beat Küng
70346a5b2f
failsafe: set cause to generic when fallback mode is activated
...
Previously when triggering low battery RTL and then losing GPS, the fallback
to Descend would still have low battery as cause.
2024-03-15 14:06:58 +01:00
Beat Küng
c78389a855
commander: send ack for VEHICLE_CMD_DO_SET_ACTUATOR
2024-02-02 09:38:28 -05:00
Beat Küng
8b422c5ed6
fix FunctionActuatorSet: if a param is set to NaN, it should be ignored
...
MAVLink spec: https://mavlink.io/en/messages/common.html#MAV_CMD_DO_SET_ACTUATOR
Previously, a command was overwriting all other indexes.
2024-02-02 09:38:28 -05:00
Beat Küng
8be64278be
fix navigator: prevent race condition when receiving multiple commands at once
...
When handling multiple commands, it could happen that the first command
updates _reposition_triplet. Normally this would then get handled after
getting the mode change from commander through vehicle_status.
But if the next command is handled before an update from commander, it
could overwrite the triplet.
This patch ensures that navigator waits for an update from commander (and
therefore process the _reposition_triplet) before handling the next
command.
This happened specifically when pressing 'Pause' from QGC during a mission.
QGC sends VEHICLE_CMD_DO_REPOSITION twice, first for pausing, then changing
the altitude.
The result was that the vehicle would not stop at the current location but
continue to the next mission waypoint and stop there.
2024-01-22 12:45:54 -05:00
Beat Küng
c5101c70b3
uorb: enure message definitions don't exceed buffer lengths & increase test buffer
...
There were already checks at runtime, but this ensures the format is not
too long at built-time.
2023-12-05 10:42:23 +01:00
Beat Küng
f69636feef
fix msg: add_custom_command needs to depend on files instead of custom_command target name
...
This fixes incremental builds when msg files change.
Introduced with https://github.com/PX4/PX4-Autopilot/pull/21995 .
2023-11-30 10:36:39 -05:00
Beat Küng
7afa011741
mavlink_mission: publish mission after updating dataman
...
This avoids a potential race condition when dataman also updates dataman
as a result of the publication.
2023-11-24 08:10:07 +01:00
Beat Küng
93cae5f9d7
mission: fix comparison logic for saving mission state
2023-11-24 08:10:07 +01:00
Beat Küng
19f08b46b0
ci: add test for PX4_EXTRA_NUTTX_CONFIG
2023-11-22 21:41:53 -05:00
Beat Küng
a9c4e5a33f
cmake: allow extra nuttx config options via PX4_EXTRA_NUTTX_CONFIG env var
2023-11-22 21:41:53 -05:00
Beat Küng
0d53bd945e
Jenkinsfile: add 'git fetch' to failsafe target
...
It was failing occationally with:
14:12:43 CMake Error at CMakeLists.txt:129 (list):
14:12:43 list index: 1 out of range (-1, 0)
14:12:43
14:12:43
14:12:43 CMake Error at CMakeLists.txt:131 (list):
14:12:43 list index: 2 out of range (-1, 0)
14:12:43
14:12:43
14:12:43 CMake Error at CMakeLists.txt:132 (string):
14:12:43 string sub-command REPLACE requires at least four arguments.
14:12:43
14:12:43
14:12:43 -- PX4 version: f513c40d62 (f513c40d62..NOTFOUND)
2023-11-15 14:23:06 +01:00
Beat Küng
f513c40d62
ucdr/msg.h.em: static inline the (de-)serialization methods
...
to avoid multiple definitions when using them from different places.
2023-11-15 13:18:58 +01:00
Beat Küng
2f91102808
mixer_module: rename Offboard_Actuator_Set to Peripheral_via_Actuator_Set
...
Offboard is a bit too specifically tied to Offboard mode.
2023-11-15 13:18:58 +01:00
Beat Küng
d12a7dd11d
uxrce_dds_client: run session until we do not get data anymore
...
Otherwise there can be significant delay for received data
2023-11-15 13:18:58 +01:00
Beat Küng
36fbd18bdc
px4/fmu-v5x: set mavlink dialect to development for now
...
So dynamic modes are available
2023-11-15 13:18:58 +01:00
Beat Küng
fb7e973dfd
commander: allow external modes to be assigned to RC
...
Stores a hash of the mode name so that the same mode is always assigned
to the same index independent from registration order.
2023-11-15 13:18:58 +01:00
Beat Küng
22acb08406
uorb: add message format compatibility check
...
This can be used by DDS/ROS 2 to check for matching message definitions.
2023-11-15 13:18:58 +01:00
Beat Küng
a72f2517ea
px4events: handle events parsing from ROS2 code
2023-11-15 13:18:58 +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
Beat Küng
1ad5a9de08
uorb: compress format definitions
...
Reduces flash usage by ~16KB.
- compress formats at build-time into a single string with all formats
- then at runtime iteratively decompress using
https://github.com/atomicobject/heatshrink
2023-11-08 00:31:26 -05:00
Beat Küng
fd0a311f3c
Makefile: exclude submodules for 'make validate_module_configs'
2023-11-03 11:09:57 -04:00
Beat Küng
2e1d5687f9
fix events: use px4_add_library instead of add_library
...
Fixes `make uorb_graphs`
2023-10-06 10:24:23 -04:00
Beat Küng
d1fcd39a44
fix crsf_rc: prevent potential buffer overflow for unknown packets
...
The length check for unknown packets did not include PACKET_SIZE_TYPE_SIZE
and CRC_SIZE, and hence working_index could overflow CRSF_MAX_PACKET_LEN,
triggering invalid memory access further down in QueueBuffer_PeekBuffer.
Also the working_segment_size was wrong for unknown packets.
Credits for finding this go to @Pwn9uin.
2023-10-05 08:00:22 +02: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
Beat Küng
b485b1a12a
drv_hrt: remove whitespace for operator ""
...
Fixes the clang error:
/__w/PX4-Autopilot/PX4-Autopilot/src/drivers/drv_hrt.h:297:35: fatal error: identifier '_s' preceded by whitespace in a literal operator declaration is deprecated [-Wdeprecated-literal-operator]
297 | constexpr hrt_abstime operator "" _s(unsigned long long seconds)
2023-08-28 17:48:20 +02:00
Beat Küng
d4c7ea74ef
refactor uxrce_dds_client: reduce amount of generated code for SendTopicsSubs
...
Reduces flash usage by ~4KB for current set of topics.
2023-08-21 20:56:08 -04:00
Beat Küng
8e1dd710a6
parameters: remove indentation from json output
...
Reduces parameters.json.xz by ~3KB on v5x.
2023-08-21 20:55:09 -04:00
Beat Küng
03365658d5
VehicleControlMode: add flag_control_allocation_enabled
...
Allows (external) modes to directly publish actuator_{motors,servos}.
2023-08-21 20:53:51 -04:00
Beat Küng
ae70f9c640
attitude_estimator_q: disable ATT_ACC_COMP by default
...
Improves tracking in the CI test, and I always disabled it on my vehicles
as well.
2023-08-08 12:28:52 -04:00
Beat Küng
57297234e2
autopilot_tester: slower descend for fly_forward_in_offboard_attitude
...
As CI was sometimes failing
2023-08-08 12:28:52 -04:00
Beat Küng
02a6640000
fix uxrce_dds_client: apparently we cannot use the upper 4 bits for ID's
2023-08-08 10:59:34 +02:00
Beat Küng
2d09ad55e3
omnibus/f4sd: disable urxce_dds_client and enable tools & load_mon
2023-08-04 11:27:31 -04:00
Beat Küng
0277a6486f
mavsdk_tests: add offboard attitude test & run with Q estimator
2023-08-04 11:27:31 -04:00
Beat Küng
351a9050c3
commander: update param description for COM_MOT_TEST_EN
2023-07-27 09:39:24 -04:00
Beat Küng
8e8b35dadf
px4/fmu-v6x: disable batt_smbus for now to reduce flash
2023-07-24 13:10:31 +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
72955221cb
fix dataman: treat 0 as valid return for read & ensure to init buffer
...
This can happen e.g. when the item is cleared.
2023-07-24 13:10:31 +02:00
Beat Küng
9aa355a08c
HIL: add --ignore-stdout-errors to run_nsh_cmd.py and use for 'tests dataman'
...
As this test is expected to contain errors.
2023-07-24 13:10:31 +02:00
Beat Küng
5c73d24765
boards/px4/fmu-v5/test: disable modules to reduce flash
2023-07-24 13:10:31 +02:00
Beat Küng
05a5bbe120
boards/diatone/mamba-f405-mk2: disable modules to reduce flash
2023-07-24 13:10:31 +02:00
Beat Küng
ebd64bfab6
navigator: defer saving mission until disarmed
...
Avoids unnecessary dataman accesses
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
Beat Küng
8b780f2a96
airframes/x500_v2: move motors from AUX to MAIN
2023-07-18 11:13:16 -04:00
Beat Küng
327b7e611e
boards/px4/fmu-v5/test: disable modules to reduce flash
2023-07-14 07:51:01 +02:00
Beat Küng
4a18baa4bd
boards/mamba-f405-mk2: disable ekf components to reduce flash
2023-07-14 07:51:01 +02:00
Beat Küng
0d6cb46c83
lightware_laser_i2c: add SF30/D
2023-07-06 22:42:39 -04:00
Beat Küng
77d6c722a7
helicopter: add tail servo support
...
as a separate CA_AIRFRAME, as the UI cannot switch between servo/motor.
2023-07-03 16:21:27 +02:00
Beat Küng
bae413a332
v6x: start mavlink on TELEM2 for skynode
...
Equivalent to v5x
2023-07-03 16:20:41 +02:00
Beat Küng
65ad6afb08
Micro-XRCE-DDS-Client: update submodule
...
Go get https://github.com/eProsima/Micro-XRCE-DDS-Client/pull/359 .
2023-06-19 16:05:36 -04:00
Beat Küng
c95539e8ce
boards: increase init stack size by 150B
...
External airframes need a bit more stack due to nested configs.
2023-06-09 21:11:11 -04:00
Beat Küng
7230a6dd8e
commander: add option to exclude mag to param SYS_FAC_CAL_MODE
2023-06-09 21:05:40 -04:00
Beat Küng
f119cca3b3
logger: restart on file write error
...
This can also happen if the maximum file size is reached.
2023-06-08 09:52:49 +02:00
Beat Küng
db18a94382
refactor param: reduce flash usage
...
Reduces usage by ~1.5KB
2023-05-31 07:45:20 +02:00
Beat Küng
1bfca24fa9
refactor param: move autosave to px4::wq_configurations::lp_default work queue
...
Changes initialization order as param_init now depends on wq manager
2023-05-31 07:45:20 +02:00
Beat Küng
e65a0a01d6
fix WorkQueueManager: wait until running to prevent race conditions
2023-05-31 07:45:20 +02:00
Beat Küng
a2ce73d39d
px4/fmu-v6x: increase BL baudrate for flashing via uart to 1500000
2023-04-13 07:46:49 +02:00
Beat Küng
989d9243b7
fix control_allocator: correct PRINT_MODULE_USAGE_NAME
2023-04-13 07:46:09 +02:00
Beat Küng
aa5b9ae638
fix failsafe: correctly handle Hold RC loss action
...
Otherwise the additional mode check triggers an RTL which takes precedence
over Hold.
Introduced in 132e9d2439
2023-04-04 07:03:42 +02:00
Beat Küng
932b743e13
ROMFS: add motor assignment to holybro x500
2023-03-28 08:18:26 -07:00
Beat Küng
22c94f805a
component information: add translation support
2023-03-20 21:57:25 -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
Beat Küng
e129534a58
fix ROMFS: add rc.autostart_ext to cmake
2023-03-01 08:53:17 -05:00
Beat Küng
06dfd1726f
microdds_client: fix -l flag and add -c for custom participant configuration
...
Allows to use a custom FastDDS configuration on the Agent side.
2023-02-22 11:15:29 -05:00
Beat Küng
fe3c1d0a92
logger: do not try to wait for mavlink ack when writing watchdog data
...
As it might block for 2.5s (if mavlink is blocked) and therefore would not
write to file before restoring the priorities.
2023-02-21 11:32:30 -05:00
Beat Küng
66b0f6eb35
log_writer_file: call fsync after reliable transfer
...
ensures watchdog data is flushed immediately
2023-02-21 11:32:30 -05:00
Beat Küng
e4cef9f303
logger: update watchdog
...
- reduce boost priority to PX4_WQ_HP_BASE - 6
- add cli command 'trigger_watchdog' to manually trigger watchdog
- add perf counters when triggering watchdog
- reduce top measurement to 300ms
- restore priorities after 1.5s
There are precautions in case the SD card code itself has a busy-loop.
2023-02-21 11:32:30 -05:00
Beat Küng
015ba62727
log_writer_file: do not call close() with mutex held
...
Generally not an issue, but if close() takes long, or even busy-loops due
to an underlying bug in the OS, it will block the main thread too.
2023-02-21 11:32:30 -05:00
Beat Küng
83c8c79af5
commander failsafe: add API to defer failsafes
2023-02-07 19:27:51 -05:00
Beat Küng
a727bddc19
microdds_client: set queue depth for incoming topics according to msg definition
...
Otherwise the FMU might miss publications from 2 different publishers at
the same time.
2023-02-07 19:12:10 -05:00
Beat Küng
3f2336af32
navigator: add ModeCompleted signalling topic
2023-02-07 19:11:52 -05:00
Beat Küng
f05e8a699e
ROMFS: enable COM_LOW_BAT_ACT by default for SITL
2023-02-07 19:11:29 -05:00
Beat Küng
ebc1d7544e
battery_simulator: add support for failure injection
...
For failsafe triggering in automated tests
2023-02-07 19:11:08 -05:00
Beat Küng
b1709743f7
commander: add wind or flight time limit exceeded mode requirement
...
This prevents switching into any of these modes once the condition is set.
2023-02-01 08:48:09 +01:00
Beat Küng
a8628c9d9c
fix commander: clear takeoff_time only on disarm
...
Otherwise the flight time restriction flag gets cleared too early, before
disarming (which puts the vehicle into the previous mode and it might
take off again).
2023-02-01 08:48:09 +01:00
Beat Küng
8e4c5884ec
fix commander: need to check for valid mode change even if already the same
...
Fixes the following case:
- user intention set to X
- failsafe triggers, mode = Y
- can_run for X becomes false
- user tries to switch to X
-> need to re-evaluate can_run
2023-02-01 08:48:09 +01:00
Beat Küng
7988491e37
failsafe simulator: improve spacing for multi-line checkboxes
...
Reduces line-height to 100% in that case.
2023-02-01 08:48:09 +01:00
Beat Küng
0687fd2689
lockstep_scheduler: avoid pthread_cond_destroy on at_exit
...
The static object is destroyed on at_exit while threads might still be
inside a CS. This can lead to a hanging process.
Cleaner would be to gracefully stop the threads.
According to https://linux.die.net/man/3/pthread_cond_destroy :
Attempting to destroy a condition variable upon which other threads are
currently blocked results in undefined behavior.
2023-01-30 11:45:02 +01:00
Beat Küng
98705ced2f
lightware_laser_i2c: fix unreliable startup detection
...
In rare occasions asking for the protocol values after setting it returned
[0, 0]. I did not see any documentation for having to wait, but adding a
short wait period fixes it.
2023-01-18 23:02:56 -05:00