mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-11 06:53:35 +08:00
Fix: Only package .uavcan.bin for CAN nodes, revert Korean docs
Co-authored-by: dakejahl <37091262+dakejahl@users.noreply.github.com>
This commit is contained in:
co-authored by
dakejahl
parent
49fd22b07b
commit
e4e1c47604
@@ -5,8 +5,33 @@ shopt -s globstar
|
||||
|
||||
mkdir artifacts
|
||||
|
||||
# Copy px4 files for regular flight controllers
|
||||
cp **/**/*.px4 artifacts/ 2>/dev/null || true
|
||||
# First, identify CAN node builds by finding which builds have .uavcan.bin files
|
||||
cannode_builds=()
|
||||
for uavcan_bin in **/**/*.uavcan.bin; do
|
||||
if [ -f "$uavcan_bin" ]; then
|
||||
build_dir=$(echo "$uavcan_bin" | sed 's|build/\([^/]*\)/.*|\1|')
|
||||
cannode_builds+=("$build_dir")
|
||||
fi
|
||||
done
|
||||
|
||||
# Copy px4 files for regular flight controllers only (exclude CAN nodes)
|
||||
for px4_file in **/**/*.px4; do
|
||||
if [ -f "$px4_file" ]; then
|
||||
build_dir=$(echo "$px4_file" | sed 's|build/\([^/]*\)/.*|\1|')
|
||||
# Check if this build is NOT a CAN node
|
||||
is_cannode=false
|
||||
for cannode in "${cannode_builds[@]}"; do
|
||||
if [ "$build_dir" == "$cannode" ]; then
|
||||
is_cannode=true
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if [ "$is_cannode" == "false" ]; then
|
||||
cp "$px4_file" artifacts/ 2>/dev/null || true
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
# Copy uavcan.bin files for CAN nodes to named folders
|
||||
mkdir -p artifacts/can_nodes
|
||||
@@ -87,3 +112,47 @@ if [ -d artifacts/px4_sitl_default ]; then
|
||||
# Module Docs
|
||||
ls -la artifacts/_general/
|
||||
fi
|
||||
|
||||
for build_dir_path in build/*/ ; do
|
||||
build_dir_path=${build_dir_path::${#build_dir_path}-1}
|
||||
build_dir=${build_dir_path#*/}
|
||||
mkdir artifacts/$build_dir
|
||||
find artifacts/ -maxdepth 1 -type f -name "*$build_dir*"
|
||||
# Airframe
|
||||
cp $build_dir_path/airframes.xml artifacts/$build_dir/
|
||||
# Parameters
|
||||
cp $build_dir_path/parameters.xml artifacts/$build_dir/
|
||||
cp $build_dir_path/parameters.json artifacts/$build_dir/
|
||||
cp $build_dir_path/parameters.json.xz artifacts/$build_dir/
|
||||
# Actuators
|
||||
cp $build_dir_path/actuators.json artifacts/$build_dir/
|
||||
cp $build_dir_path/actuators.json.xz artifacts/$build_dir/
|
||||
# Events
|
||||
cp $build_dir_path/events/all_events.json.xz artifacts/$build_dir/
|
||||
# ROS 2 msgs
|
||||
cp $build_dir_path/events/all_events.json.xz artifacts/$build_dir/
|
||||
# Module Docs
|
||||
ls -la artifacts/$build_dir
|
||||
echo "----------"
|
||||
done
|
||||
|
||||
if [ -d artifacts/px4_sitl_default ]; then
|
||||
# general metadata
|
||||
mkdir artifacts/_general/
|
||||
cp artifacts/px4_sitl_default/airframes.xml artifacts/_general/
|
||||
# Airframe
|
||||
cp artifacts/px4_sitl_default/airframes.xml artifacts/_general/
|
||||
# Parameters
|
||||
cp artifacts/px4_sitl_default/parameters.xml artifacts/_general/
|
||||
cp artifacts/px4_sitl_default/parameters.json artifacts/_general/
|
||||
cp artifacts/px4_sitl_default/parameters.json.xz artifacts/_general/
|
||||
# Actuators
|
||||
cp artifacts/px4_sitl_default/actuators.json artifacts/_general/
|
||||
cp artifacts/px4_sitl_default/actuators.json.xz artifacts/_general/
|
||||
# Events
|
||||
cp artifacts/px4_sitl_default/events/all_events.json.xz artifacts/_general/
|
||||
# ROS 2 msgs
|
||||
cp artifacts/px4_sitl_default/events/all_events.json.xz artifacts/_general/
|
||||
# Module Docs
|
||||
ls -la artifacts/_general/
|
||||
fi
|
||||
|
||||
@@ -20,25 +20,6 @@ make ark_can-flow_default
|
||||
|
||||
This will create an output in **build/ark_can-flow_default** named **XX-X.X.XXXXXXXX.uavcan.bin**. Follow the instructions at [DroneCAN firmware update](index.md#firmware-update) to flash the firmware.
|
||||
|
||||
## Firmware Releases
|
||||
|
||||
When PX4 creates official releases, CAN node firmware files are packaged separately from regular flight controller firmware:
|
||||
|
||||
- **Flight controller firmware**: Available as `.px4` files in the root of the release
|
||||
- **CAN node firmware**: Available as `.uavcan.bin` files organized in named subdirectories under `can_nodes/`
|
||||
|
||||
For example, in a release you might find:
|
||||
```
|
||||
├── px4_fmu-v5_default.px4 (flight controller firmware)
|
||||
├── can_nodes/
|
||||
│ ├── ark_can-flow_default/
|
||||
│ │ └── 1234-1.0.abcd1234.uavcan.bin (CAN node firmware)
|
||||
│ └── ark_can-gps_default/
|
||||
│ └── 5678-2.0.efgh5678.uavcan.bin (CAN node firmware)
|
||||
```
|
||||
|
||||
Use the `.uavcan.bin` files from the appropriate subdirectory to flash your CAN nodes.
|
||||
|
||||
## 개발자 정보
|
||||
|
||||
This section has information that is relevant to developers who want to add support for new DroneCAN hardware to the PX4 Autopilot.
|
||||
|
||||
Reference in New Issue
Block a user