mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-01 14:41:36 +08:00
The previous cleanup logic conflated two independent concerns into
SDLOG_MAX_SIZE: the maximum size of a single log file (rotation
trigger) AND the minimum free space to maintain. That was broken:
the 4095 MB default meant "keep 4 GB free", which over-cleaned on
large SD cards and was impossible to satisfy on small flash.
Disentangle the two:
- SDLOG_ROTATE (new, int %, default 90): maximum disk usage percentage.
Cleanup guarantees at least (100 - SDLOG_ROTATE)% free even during
writing of a new log file. Setting 0 disables space-based cleanup;
100 allows filling the disk completely.
- SDLOG_MAX_SIZE (default lowered from 4095 to 1024): pure max file
size. The value is added on top of the rotate-derived threshold as
headroom for the next file write, so the rotate guarantee holds
even mid-write.
- SDLOG_DIRS_MAX: removed. Directory count limits were confusing and
orthogonal to the space-management goal; free-space cleanup alone
covers the use case. Drop the param and all remaining overrides
(rc.board_defaults, rcS, rc.replay, 1002_standard_vtol.hil).
Cleanup threshold is now:
((100 - SDLOG_ROTATE)% of disk) + SDLOG_MAX_SIZE
Small-flash boards can override SDLOG_MAX_SIZE to get more retained
logs within the available space. kakuteh7v2 and airbrainh743 drop
their SDLOG_DIRS_MAX overrides accordingly.
Update docs/en/dev_log/logging.md with the new semantics and a
worked example for the typical 8 GB SD case.
30 lines
704 B
Bash
30 lines
704 B
Bash
#!/bin/sh
|
|
|
|
# EKF2 replay script
|
|
|
|
# shellcheck disable=SC2154
|
|
if [ ! -f ${replay} ]; then
|
|
echo "Invalid replay log file ${replay}"
|
|
exit 1
|
|
fi
|
|
|
|
if [ ! -f replay_params.txt ]; then
|
|
echo "Creating $(pwd)/replay_params.txt"
|
|
ulog_params -i "${replay}" -l ' ' | grep -e '^EKF2' > replay_params.txt
|
|
fi
|
|
|
|
publisher_rules_file="orb_publisher.rules"
|
|
cat <<EOF > "$publisher_rules_file"
|
|
restrict_topics: sensor_combined, vehicle_gps_position, vehicle_land_detected
|
|
module: replay
|
|
ignore_others: false
|
|
EOF
|
|
|
|
param set SDLOG_PROFILE 3
|
|
|
|
# apply all params before ekf starts, as some params cannot be changed after startup
|
|
replay tryapplyparams
|
|
ekf2 start -r
|
|
logger start -f -t -b 1000 -p vehicle_attitude
|
|
replay start
|