Skip to content

Commit cd9619c

Browse files
authored
Initial commit
0 parents  commit cd9619c

39 files changed

+1447
-0
lines changed

.clang-format

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
BasedOnStyle: LLVM
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: C++ Formatting Check
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
cpp_formatter:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Checkout code
10+
uses: actions/checkout@v4
11+
12+
- name: Clang Formatter
13+
uses: DoozyX/clang-format-lint-action@v0.18.1
14+
with:
15+
clangFormatVersion: 14
16+
source: "src"

.github/workflows/mkdocs.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: ci
2+
on:
3+
push:
4+
branches:
5+
- main
6+
permissions:
7+
contents: write
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
- uses: actions/setup-python@v4
14+
with:
15+
python-version: 3.x
16+
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
17+
- uses: actions/cache@v3
18+
with:
19+
key: mkdocs-material-${{ env.cache_id }}
20+
path: .cache
21+
restore-keys: |
22+
mkdocs-material-
23+
- run: sudo apt-get -y install doxygen
24+
- run: pip install mkdocs-material
25+
- run: pip install mkdoxy
26+
- run: mkdocs gh-deploy --force
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Build Debian Packages (ROS2 Jazzy)
2+
on:
3+
workflow_dispatch:
4+
release:
5+
types: [created]
6+
jobs:
7+
build-debian-packages:
8+
runs-on: ubuntu-latest
9+
env:
10+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
11+
steps:
12+
- name: Install required packages
13+
run: sudo apt-get update && sudo apt-get install libsdl2-dev -y
14+
- name: Checkout this repository
15+
uses: actions/checkout@v2.3.4
16+
- name: Build Debian packages
17+
uses: ichiro-its/ros2-build-debian-action@main
18+
with:
19+
ros2-distro: jazzy
20+
- name: Upload Release Asset
21+
env:
22+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23+
run: |
24+
REPO_FULL=$(gh repo view --json nameWithOwner --jq .nameWithOwner)
25+
TAG_NAME=$(gh release view --repo "$REPO_FULL" --json tagName --jq ".tagName")
26+
27+
gh release upload "$TAG_NAME" package/*.deb --repo "$REPO_FULL"
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: ros2_jazzy_code_compiles
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
pull_request:
7+
branches: ["main"]
8+
workflow_dispatch: {}
9+
10+
jobs:
11+
build:
12+
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
13+
# You can convert this to a matrix build if you need cross-platform coverage.
14+
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
15+
runs-on: ubuntu-24.04
16+
17+
steps:
18+
- uses: actions/checkout@v3
19+
- uses: ros-tooling/setup-ros@v0.7
20+
with:
21+
required-ros-distributions: jazzy
22+
23+
- name: Install required packages
24+
# To compile and run the code we require cmake, ninja and opencv
25+
run: sudo apt-get update && sudo apt-get install build-essential cmake ninja-build ros-jazzy-diagnostic-updater libsdl2-dev
26+
27+
- name: Install dependencies
28+
working-directory: ${{ github.workspace }}
29+
run: |
30+
sudo rosdep init || true
31+
rosdep update --rosdistro=jazzy
32+
33+
- name: Colcon build
34+
working-directory: ${{ github.workspace }}
35+
run: |
36+
source /opt/ros/jazzy/setup.bash
37+
colcon build
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: ROS2 Jazzy with Pixi on Windows
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
jobs:
10+
build:
11+
runs-on: windows-latest
12+
13+
steps:
14+
- name: Checkout Repository
15+
uses: actions/checkout@v4
16+
- name: Setup Pixi
17+
uses: prefix-dev/setup-pixi@v0.8.3
18+
19+
- name: Run colcon build (Release Mode)
20+
shell: cmd
21+
run: pixi run build
22+
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Create ROS2 Jazzy package on Linux
2+
3+
on:
4+
workflow_dispatch:
5+
release:
6+
types: [created]
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout Repository
12+
uses: actions/checkout@v4
13+
14+
- name: Install Pixi
15+
uses: prefix-dev/setup-pixi@v0.8.3
16+
17+
- name: Build package with Pixi
18+
env:
19+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20+
shell: pixi run bash -e {0}
21+
run: |
22+
source rattler/set_build_var.sh
23+
rattler-build build --recipe rattler/recipe.yaml -c conda-forge -c https://prefix.dev/robostack-jazzy --package-format tar-bz2
24+
- name: Upload Release Asset
25+
env:
26+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27+
run: |
28+
REPO_FULL=$(gh repo view --json nameWithOwner --jq .nameWithOwner)
29+
TAG_NAME=$(gh release view --repo "$REPO_FULL" --json tagName --jq ".tagName")
30+
31+
gh release upload "$TAG_NAME" output/linux-64/ros-jazzy-*.tar.bz2 --repo "$REPO_FULL"
32+
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Create ROS2 Jazzy package on Windows
2+
3+
on:
4+
workflow_dispatch:
5+
release:
6+
types: [created]
7+
8+
jobs:
9+
build:
10+
runs-on: windows-latest
11+
12+
steps:
13+
- name: Checkout Repository
14+
uses: actions/checkout@v4
15+
16+
- name: Install Pixi
17+
uses: prefix-dev/setup-pixi@v0.8.3
18+
19+
20+
- name: Build package with Pixi (Windows)
21+
env:
22+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23+
shell: pwsh
24+
run: |
25+
rattler/set_build_var.ps1
26+
pixi run rattler-build build --recipe rattler/recipe.yaml -c conda-forge -c https://prefix.dev/robostack-jazzy --package-format tar-bz2
27+
28+
29+
- name: Upload Windows Conda Package to GitHub Release
30+
env:
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32+
shell: pwsh
33+
run: |
34+
$ErrorActionPreference = "Stop"
35+
36+
$repo = (gh repo view --json nameWithOwner | ConvertFrom-Json).nameWithOwner
37+
38+
$tag = gh release view --repo $repo --json tagName --jq ".tagName"
39+
40+
$pkg = Get-ChildItem "output/win-64/ros-jazzy-*.tar.bz2" |
41+
Where-Object { $_.Extension -in ".bz2", ".conda" } |
42+
Sort-Object LastWriteTime -Descending |
43+
Select-Object -First 1
44+
45+
if (-not $pkg) {
46+
Write-Error "❌ No conda package found in win-64."
47+
}
48+
49+
if ($pkg.Name -like "*.tar.bz2") {
50+
$renamed = $pkg.FullName -replace '\.tar.bz2$', '-win.tar.bz2'
51+
Copy-Item $pkg.FullName $renamed
52+
} else {
53+
$renamed = $pkg.FullName
54+
}
55+
56+
gh release upload $tag $renamed --repo $repo --clobber

.gitignore

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Prerequisites
2+
*.d
3+
4+
# Compiled Object files
5+
*.slo
6+
*.lo
7+
*.o
8+
*.obj
9+
10+
# Precompiled Headers
11+
*.gch
12+
*.pch
13+
14+
# Compiled Dynamic libraries
15+
*.so
16+
*.dylib
17+
*.dll
18+
19+
# Fortran module files
20+
*.mod
21+
*.smod
22+
23+
# Compiled Static libraries
24+
*.lai
25+
*.la
26+
*.a
27+
*.lib
28+
29+
# Executables
30+
*.exe
31+
*.out
32+
*.app
33+
34+
# ROS2 build folders
35+
build/
36+
install/
37+
log/
38+
39+
40+
# Rattler build folders
41+
output/
42+
43+
# IDE folders
44+
.vscode/
45+
46+
# Pixi artifacts
47+
pixi.lock
48+
.pixi/

CMakeLists.txt

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
cmake_minimum_required(VERSION 3.1...3.14)
2+
project(custom_pkg C CXX)
3+
4+
find_package(ament_cmake REQUIRED)
5+
find_package(rclcpp REQUIRED)
6+
find_package(builtin_interfaces REQUIRED)
7+
find_package(rosidl_default_generators REQUIRED)
8+
find_package(std_msgs REQUIRED)
9+
10+
11+
rosidl_generate_interfaces(${PROJECT_NAME}
12+
msg/Custom.msg
13+
DEPENDENCIES std_msgs
14+
)
15+
16+
ament_export_dependencies(rosidl_default_runtime)
17+
rosidl_get_typesupport_target(cpp_typesupport_target ${PROJECT_NAME} "rosidl_typesupport_cpp")
18+
19+
add_executable(custom_node src/custom_node.cpp)
20+
21+
ament_target_dependencies(custom_node
22+
rclcpp
23+
std_msgs
24+
)
25+
target_link_libraries(custom_node "${cpp_typesupport_target}")
26+
27+
if(UNIX AND NOT APPLE) # Linux only
28+
target_compile_options(custom_node PRIVATE -Wall)
29+
endif()
30+
31+
install(TARGETS
32+
custom_node
33+
DESTINATION lib/${PROJECT_NAME})
34+
35+
ament_package()

0 commit comments

Comments
 (0)