Skip to content

Make tutorial for creating first mission. (#434) #319

Make tutorial for creating first mission. (#434)

Make tutorial for creating first mission. (#434) #319

Workflow file for this run

name: ARM Artifact
on:
push:
branches: [main, master, integration]
paths:
- ".github/workflows/arm-artifact.yml"
- "controls/sae_2025_ws/**"
workflow_dispatch:
permissions:
contents: write
packages: read
concurrency:
group: arm-artifact-${{ github.ref }}
cancel-in-progress: true
jobs:
build_hardware_artifact_ci_image:
name: Build Raspberry Pi Artifact
runs-on: ubuntu-22.04-arm
container:
image: ${{ vars.ROS_CI_IMAGE_ARM64 }}
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Mark checkout as safe
run: git config --global --add safe.directory "$GITHUB_WORKSPACE" || true
- name: Build ARM workspace packages
run: bash controls/sae_2025_ws/scripts/ci/build_arm_artifact.sh
- name: Get short SHA
id: sha
run: |
SHORT_SHA=$(git rev-parse --short HEAD 2>/dev/null || echo "${GITHUB_SHA:0:7}")
echo "short_sha=$SHORT_SHA" >> "$GITHUB_OUTPUT"
echo "artifact_name=ros2-build-$SHORT_SHA.tar.gz" >> "$GITHUB_OUTPUT"
- name: Get build info
id: info
run: |
echo "timestamp=$(date -u +%Y%m%d-%H%M%S)" >> "$GITHUB_OUTPUT"
echo "full_sha=${{ github.sha }}" >> "$GITHUB_OUTPUT"
- name: Package ARM runtime artifact
env:
SHORT_SHA: ${{ steps.sha.outputs.short_sha }}
BUILD_TIME: ${{ steps.info.outputs.timestamp }}
GITHUB_SHA: ${{ steps.info.outputs.full_sha }}
BRANCH_NAME: ${{ github.ref_name }}
ARTIFACT_NAME: ${{ steps.sha.outputs.artifact_name }}
run: bash controls/sae_2025_ws/scripts/ci/package_arm_artifact.sh
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: ros2-build-${{ steps.sha.outputs.short_sha }}
path: controls/sae_2025_ws/${{ steps.sha.outputs.artifact_name }}
retention-days: 30
- name: Create GitHub Release
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master')
uses: softprops/action-gh-release@v2
with:
tag_name: build-${{ steps.sha.outputs.short_sha }}
name: ROS 2 Build ${{ steps.sha.outputs.short_sha }}
body: |
## ROS 2 Build for Raspberry Pi (ARM64)
**Commit:** ${{ github.sha }}
**Built:** ${{ steps.info.outputs.timestamp }}
**Branch:** ${{ github.ref_name }}
### Quick Deploy to Raspberry Pi
```bash
mkdir -p ~/uav_ws && cd ~/uav_ws
wget https://github.com/${{ github.repository }}/releases/download/build-${{ steps.sha.outputs.short_sha }}/${{ steps.sha.outputs.artifact_name }}
tar -xzvf ${{ steps.sha.outputs.artifact_name }}
rm ${{ steps.sha.outputs.artifact_name }}
sudo apt-get update
sudo apt-get install -y python3-pip build-essential cmake git
python3 -m pip install --user "pydantic>=2,<3" apriltag
cd /tmp
git clone --depth 1 https://github.com/joan2937/pigpio.git
cd pigpio
cmake . -DBUILD_SHARED_LIBS=ON
make -j$(nproc)
sudo make install
sudo ldconfig
sudo /usr/local/bin/pigpiod
source /opt/ros/jazzy/setup.bash
source install/setup.bash
ros2 launch uav main.launch.py
```
### Configuration
Edit `install/uav/share/uav/launch/launch_params.yaml` or mission files under `install/uav/share/uav/missions`.
files: controls/sae_2025_ws/${{ steps.sha.outputs.artifact_name }}
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}