Add automated MAVLink log collection to drones_postflight workflow #21
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR implements automated MAVLink log collection from drone flight controllers, integrating it seamlessly into the existing
drones_postflight.ymlansible workflow.Problem
Previously, the postflight system only collected ROS bag files and system logs, missing critical low-level flight controller data stored in MAVLink logs. This data includes parameter changes, system status messages, detailed flight performance metrics, and error logs that are essential for comprehensive flight analysis and debugging.
Solution
Added a new Python script that uses the existing
pymavlinkdependency to automatically download flight logs from each drone's flight controller:New Components
ansible/scripts/get_mavlogs.pyLOG_REQUEST_LISTmessagesLOG_REQUEST_DATAwith proper chunking.binformat for tool compatibilityEnhanced
ansible/drones_postflight.ymlUsage
The MAVLink log collection now runs automatically as part of the standard postflight workflow:
cd /path/to/swarmnxt/ansible ansible-playbook -i inventory.ini drones_postflight.yml -KThis will collect both ROS bag files and MAVLink logs from all configured drones, consolidating them into timestamped directories on the host computer.
Log Storage
MAVLink logs are saved to
${drone_base_path}/logs/latest/mavlink/with filenames likemavlink_log_{id}_{timestamp}.bin, and are automatically included in the consolidated log collection.Documentation
Updated both
docs/software-common-tasks.mdanddocs/flying.mdwith comprehensive documentation covering the new postflight log collection capabilities, including log formats, locations, and analysis workflows.Compatibility
pymavlinkandlogurudependencies💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.