Skip to content

Commit

Permalink
Merge pull request #457 from husarion/ros2-lynx-devel
Browse files Browse the repository at this point in the history
ROS 2 husarion UGV
  • Loading branch information
KmakD authored Dec 6, 2024
2 parents ad89d1e + 05aab48 commit 4fc2d95
Show file tree
Hide file tree
Showing 377 changed files with 10,878 additions and 7,315 deletions.
4 changes: 0 additions & 4 deletions .docs/panther_ros2_api.drawio.svg

This file was deleted.

4 changes: 4 additions & 0 deletions .docs/ros2_system_design.drawio.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 17 additions & 7 deletions .github/workflows/release-candidate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,31 @@ on:
workflow_dispatch:
inputs:
version:
description: Release candidate version. IMPORTANT - required format `X.X.X`, eg `2.0.1`.
description: Release candidate version (format `X.X.X`, e.g. `2.0.1`).
required: true
date:
description: Release candidate date stamp. IMPORTANT - required format `YYYYMMDD`, eg `20240430`.
description: Release candidate date stamp (format `YYYYMMDD`, e.g. `20240430`).
required: true

env:
RC_BRANCH_NAME: ${{ github.event.inputs.version }}-${{ github.event.inputs.date }}

jobs:
# TODO: Add unit testing for panther_ros when ready
check_docs:
name: Check docs build
runs-on: ubuntu-22.04
steps:
- name: Trigger repository build workflow
uses: convictional/[email protected]
with:
owner: husarion
repo: docs_new
github_token: ${{ secrets.GH_PAT }}
workflow_file_name: test-release.yml
ref: master
client_payload: '{"husarion_ugv_branch": "ros2-devel"}'

# TODO: Add unit testing for panther_ros when ready
unit_test_panther_ros:
name: Run unit tests for panther_ros
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -55,7 +69,6 @@ jobs:
github_token: ${{ secrets.GH_PAT }}
workflow_file_name: update-tags-in-compose.yaml
ref: ${{ env.RC_BRANCH_NAME }}
wait_interval: 10
client_payload: |
{
"branch_name": "${{ env.RC_BRANCH_NAME }}",
Expand All @@ -76,7 +89,6 @@ jobs:
github_token: ${{ secrets.GH_PAT }}
workflow_file_name: ros-docker-image.yaml
ref: ${{ env.RC_BRANCH_NAME }}
wait_interval: 10
client_payload: |
{
"panther_codebase_version": "${{ env.RC_BRANCH_NAME }}",
Expand All @@ -98,7 +110,6 @@ jobs:
github_token: ${{ secrets.GH_PAT }}
workflow_file_name: build_and_deploy_image.yaml
ref: ${{ env.RC_BRANCH_NAME }}
wait_interval: 10
client_payload: |
{
"dev_image": "true",
Expand All @@ -121,7 +132,6 @@ jobs:
github_token: ${{ secrets.GH_PAT }}
workflow_file_name: build_and_deploy_flash_os_image.yaml
ref: ${{ env.RC_BRANCH_NAME }}
wait_interval: 10
client_payload: |
{
"image_tag": "${{ github.event.inputs.version }}"
Expand Down
77 changes: 21 additions & 56 deletions .github/workflows/release-project.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: Release Panther project
name: Release project

on:
workflow_dispatch:
Expand Down Expand Up @@ -30,19 +30,18 @@ env:
MAIN_BRANCH: ros2

jobs:
release_panther_msgs:
name: Release panther_msgs repository
release_project:
name: Release Husarion UGV project
runs-on: ubuntu-22.04
steps:
- name: Trigger repository release workflow
- name: Release panther_msgs repository
uses: convictional/[email protected]
with:
owner: husarion
repo: panther_msgs
github_token: ${{ secrets.GH_PAT }}
workflow_file_name: release-repository.yaml
ref: ${{ env.RC_BRANCH_NAME }}
wait_interval: 10
client_payload: |
{
"release_candidate": "${{ env.RC_BRANCH_NAME }}",
Expand All @@ -52,21 +51,14 @@ jobs:
"prerelease": "${{ github.event.inputs.prerelease }}"
}
release_panther_ros:
name: Release panther_ros repository
needs:
- release_panther_msgs
runs-on: ubuntu-22.04
steps:
- name: Trigger panther_ros release workflow
- name: Release panther_ros repository
uses: convictional/[email protected]
with:
owner: husarion
repo: panther_ros
github_token: ${{ secrets.GITHUB_TOKEN }} # Use the default GITHUB_TOKEN for local repository
workflow_file_name: release-repository.yaml
ref: ${{ env.RC_BRANCH_NAME }}
wait_interval: 10
client_payload: |
{
"release_candidate": "${{ env.RC_BRANCH_NAME }}",
Expand All @@ -76,43 +68,29 @@ jobs:
"prerelease": "${{ github.event.inputs.prerelease }}"
}
rebuild_and_push_docker_images:
name: Rebuild panther docker images with new version
runs-on: ubuntu-22.04
needs:
- release_panther_ros
steps:
- name: Trigger repository build workflow
- name: Rebuild panther docker images with new version
uses: convictional/[email protected]
with:
owner: husarion
repo: panther-docker
github_token: ${{ secrets.GH_PAT }}
workflow_file_name: ros-docker-image.yaml
ref: ${{ env.RC_BRANCH_NAME }}
wait_interval: 10
client_payload: |
{
"panther_codebase_version": "${{ github.event.inputs.version }}",
"build_type": "development",
"target_distro": "humble"
}
release_panther_docker:
name: Release panther-docker repository
needs:
- rebuild_and_push_docker_images
runs-on: ubuntu-22.04
steps:
- name: Trigger repository release workflow
- name: Release panther-docker repository
uses: convictional/[email protected]
with:
owner: husarion
repo: panther-docker
github_token: ${{ secrets.GH_PAT }}
workflow_file_name: release-repository.yaml
ref: ${{ env.RC_BRANCH_NAME }}
wait_interval: 10
client_payload: |
{
"release_candidate": "${{ env.RC_BRANCH_NAME }}",
Expand All @@ -122,22 +100,14 @@ jobs:
"prerelease": "${{ github.event.inputs.prerelease }}"
}
release_panther_rpi_os_image:
name: Release panther-rpi-os-img repository
if: ${{ fromJSON(github.event.inputs.automatic_mode) == true }}
needs:
- release_panther_docker
runs-on: ubuntu-22.04
steps:
- name: Trigger repository release workflow
- name: Release panther-rpi-os-img repository
uses: convictional/[email protected]
with:
owner: husarion
repo: panther-rpi-os-img
github_token: ${{ secrets.GH_PAT }}
workflow_file_name: release-repository.yaml
ref: ${{ env.RC_BRANCH_NAME }}
wait_interval: 10
client_payload: |
{
"release_candidate": "${{ env.RC_BRANCH_NAME }}",
Expand All @@ -147,46 +117,41 @@ jobs:
"prerelease": "${{ github.event.inputs.prerelease }}"
}
build_and_publish_rpi_image:
name: Build panther system image
if: ${{ fromJSON(github.event.inputs.automatic_mode) == true }}
needs:
- release_panther_rpi_os_image
runs-on: ubuntu-22.04
steps:
- name: Trigger repository build workflow
- name: Build panther system image
if: ${{ fromJSON(github.event.inputs.automatic_mode) == true }}
uses: convictional/[email protected]
with:
owner: husarion
repo: panther-rpi-os-img
github_token: ${{ secrets.GH_PAT }}
workflow_file_name: build_and_deploy_image.yaml
ref: ${{ env.MAIN_BRANCH }}
wait_interval: 10
client_payload: |
{
"dev_image": "false",
"panther_codebase_version": "${{ github.event.inputs.version }}",
"image_tag": "${{ github.event.inputs.version }}"
}
build_and_publish_rpi_flash_os_image:
name: Build panther flash OS image
if: ${{ fromJSON(github.event.inputs.automatic_mode) == true }}
needs:
- build_and_publish_rpi_image
runs-on: ubuntu-22.04
steps:
- name: Trigger repository build workflow
- name: Build panther flash OS image
if: ${{ fromJSON(github.event.inputs.automatic_mode) == true }}
uses: convictional/[email protected]
with:
owner: husarion
repo: panther-rpi-os-img
github_token: ${{ secrets.GH_PAT }}
workflow_file_name: build_and_deploy_flash_os_image.yaml
ref: ${{ env.MAIN_BRANCH }}
wait_interval: 10
client_payload: |
{
"image_tag": "${{ github.event.inputs.version }}"
}
- name: Trigger repository build workflow
uses: convictional/[email protected]
with:
owner: husarion
repo: docs_new
github_token: ${{ secrets.GH_PAT }}
workflow_file_name: build.yml
ref: master
12 changes: 6 additions & 6 deletions .github/workflows/run-unit-tests.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: Run panther unit tests
name: Run unit tests

on:
workflow_dispatch:
Expand Down Expand Up @@ -28,12 +28,12 @@ jobs:
uses: actions/checkout@v3
with:
ref: ${{ github.ref }}
path: ros2_ws/src/panther_ros
path: ros2_ws/src/husarion_ugv

- name: Resolve dependencies
working-directory: ros2_ws
run: |
vcs import < src/panther_ros/panther/panther_hardware.repos src
vcs import < src/husarion_ugv/husarion_ugv/hardware_deps.repos src
sudo apt update
rosdep update --rosdistro $ROS_DISTRO
rosdep install -i --from-path src --rosdistro $ROS_DISTRO -y
Expand All @@ -43,15 +43,15 @@ jobs:
run: |
source /opt/ros/$ROS_DISTRO/setup.bash
if [ -f install/setup.bash ]; then source install/setup.bash; fi
colcon build --symlink-install --parallel-workers $(nproc) --packages-up-to panther --cmake-args -DCMAKE_CXX_FLAGS='-fprofile-arcs -ftest-coverage'
colcon build --symlink-install --parallel-workers $(nproc) --packages-up-to husarion_ugv --cmake-args -DCMAKE_CXX_FLAGS='-fprofile-arcs -ftest-coverage'
- name: Test
working-directory: ros2_ws
run: |
source install/setup.bash
colcon test --packages-up-to panther --retest-until-pass 10 --event-handlers console_cohesion+ --return-code-on-test-failure
colcon test --packages-up-to husarion_ugv --retest-until-pass 10 --event-handlers console_cohesion+ --return-code-on-test-failure
echo "result=$?" >> ${{ runner.temp }}/${{ env.TEST_RESULT_FILENAME }}
colcon lcov-result --packages-up-to panther --verbose >> ${{ runner.temp }}/${{ env.COVERAGE_RESULT_FILENAME }}
colcon lcov-result --packages-up-to husarion_ugv --verbose >> ${{ runner.temp }}/${{ env.COVERAGE_RESULT_FILENAME }}
lines_cov=$(cat ${{ runner.temp }}/${{ env.COVERAGE_RESULT_FILENAME }} | grep -E 'lines' | head -1)
functions_cov=$(cat ${{ runner.temp }}/${{ env.COVERAGE_RESULT_FILENAME }} | grep -E 'functions' | head -1)
branches_cov=$(cat ${{ runner.temp }}/${{ env.COVERAGE_RESULT_FILENAME }} | grep -E 'branches' | head -1)
Expand Down
6 changes: 2 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
devel/
logs/
build/
log/
install/
bin/
lib/
msg_gen/
Expand All @@ -13,8 +13,6 @@ msg/*Feedback.msg
msg/*Goal.msg
msg/*Result.msg
msg/_*.py
build_isolated/
devel_isolated/

# Generated by dynamic reconfigure
*.cfgc
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ repos:
entry: codespell
args:
[
"--exclude-file=panther_hardware_interfaces/config/roboteq_motor_controllers_v80_21a.eds",
"--exclude-file=husarion_ugv_hardware_interfaces/config/roboteq_motor_controllers_v80_21a.eds",
"--ignore-words-list",
"ned" # north, east, down (NED)
]
Expand Down
Loading

0 comments on commit 4fc2d95

Please sign in to comment.