- Define LOG_FILEPATH_SCANF_WIDTH macro for the sscanf width specifier
- Replace hardcoded '255' with the named macro in both sscanf calls
- Improves maintainability and makes the relationship between buffer size and width explicit
- Addresses final code review feedback about magic numbers
Co-authored-by: dakejahl <37091262+dakejahl@users.noreply.github.com>
- Remove duplicate LOG_FILEPATH_SIZE macro from cpp file
- Use MavlinkLogHandler::LOG_FILEPATH_SIZE consistently throughout
- Update local filepath buffer to use the same size as LogEntry.filepath
- Addresses code review feedback about duplication and consistency
Co-authored-by: dakejahl <37091262+dakejahl@users.noreply.github.com>
- Add LOG_FILEPATH_SIZE constant (256) in both header and cpp
- Update LogEntry.filepath to use the constant
- Improve comments explaining width specifier relationship
- Addresses code review feedback about magic numbers
Co-authored-by: dakejahl <37091262+dakejahl@users.noreply.github.com>
- Add static_assert to ensure PX4_MAX_FILEPATH >= 256 at compile time
- Use %255s consistently for both sscanf calls to prevent overflow
- Add explanatory comments for the width specifier choice
- Addresses code review feedback about potential overflow on NuttX
Co-authored-by: dakejahl <37091262+dakejahl@users.noreply.github.com>
- Increase LogEntry.filepath buffer from 60 to 256 bytes
- Add width specifiers to sscanf calls (%255s and %1023s) to prevent buffer overflow
- Prevents remote DoS vulnerability when parsing logdata.txt with excessively long filenames
Co-authored-by: dakejahl <37091262+dakejahl@users.noreply.github.com>
* added vehicle command and support to remotely activate/deactivate the safety system (#26078)
* added print_status support for prearm safety status
* updated safety button to map to MAV_CMD_DO_SET_SAFETY_SWITCH_STATE = '5300'
* safety switch cmd: fixed incorrect catch-all and added commanded_state variable for easier reading
A false positive could be triggered if velocity fusion started,
then stopped after takeoff and only position fusion started again
(because velocity fusion timed out and had a timestamp > time_last_on_ground).
We now also check if the fusion timeout is due to the innovation being
rejected (and not just a temporary check failure or data interruption).
* test: increase altitude tolerance to fix flaky test
Altitude tolerance increased from 0.1f to 0.15f to handle simulation
timing variations. Test was failing at 0.201m with 0.2m tolerance.
* test: increase altitude tolerance further to 0.3m
* ci: re-add branch trigger for SITL tests
* Revert "ci: re-add branch trigger for SITL tests"
This reverts commit e5e4c9637b70a9d29247b82a52e11f1f2d0dcc59.
* mavlink: fix potential use-after-free
If a mavlink instance is force stopped, the main thread might be out of
scope and the receiver thread would be doing a use-after-free.
Instead the receiver thread needs to check its own _should_exit flag.
* mavlink: protect shared data by mutex in dtor
I'm not sure if this potentially fixes any of the segfaults we have seen
on stopping mavlink instances but it potentially could matter if the
mavlink_receiver thread is killed after a timeout and tries to send any
messages as a zombie.
* Adds configurable I2C address for PCA9685 PWM driver
Introduces a parameter to set the I2C address for the PCA9685 PWM output driver, enhancing flexibility for hardware variations. Updates documentation and board initialization scripts to support the new configuration and streamline device startup.
* Update src/drivers/pca9685_pwm_out/module.yaml
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Update src/drivers/pca9685_pwm_out/module.yaml
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Jacob Dahl <37091262+dakejahl@users.noreply.github.com>
* ci: move px4_msgs sync from jenkins to github actions
I noticed it has not synced in a while, the last time was here:
49a0f6c52c
The difference to before is that now also the release branches will be
synced instead of only 'main'.
---------
Co-authored-by: Beniamino Pozzan <beniamino.pozzan@gmail.com>
In cold weather, fuel engines need to be warmed up. Currently, this is done by switching to stabilized mode and throttle up. The issue is that when not using GNSS data, the vehicle is not detected as "at rest" due to vibrations and cannot switch into auto/takeoff modes.
If EKF2_ENGINE_WRM is enabled, and if the vehicle is armed and landed, constant position fusion is enabled.
When operating fully autonomously (i.e., without manual control or a guaranteed link to the ground station), tuning a vehicle can be difficult since the current autotune process requires either RC input or a GCS command. For these scenarios, it it useful to be able to start autotune inside a mission.