Skip to content

Commit d831164

Browse files
authored
Initialize jazzy
0 parents  commit d831164

22 files changed

Lines changed: 1060 additions & 0 deletions

.devcontainer/Dockerfile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
FROM althack/ros2:jazzy-dev
2+
3+
# ** [Optional] Uncomment this section to install additional packages. **
4+
#
5+
# ENV DEBIAN_FRONTEND=noninteractive
6+
# RUN apt-get update \
7+
# && apt-get -y install --no-install-recommends <your-package-list-here> \
8+
# #
9+
# # Clean up
10+
# && apt-get autoremove -y \
11+
# && apt-get clean -y \
12+
# && rm -rf /var/lib/apt/lists/*
13+
# ENV DEBIAN_FRONTEND=dialog
14+
15+
# Set up auto-source of workspace for ros user
16+
ARG WORKSPACE
17+
RUN echo "if [ -f ${WORKSPACE}/install/setup.bash ]; then source ${WORKSPACE}/install/setup.bash; fi" >> /home/ros/.bashrc

.devcontainer/devcontainer.json

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
// See https://aka.ms/vscode-remote/devcontainer.json for format details.
2+
{
3+
"dockerFile": "Dockerfile",
4+
"build": {
5+
"args": {
6+
"WORKSPACE": "${containerWorkspaceFolder}"
7+
}
8+
},
9+
"remoteUser": "ros",
10+
"runArgs": [
11+
"--network=host",
12+
"--cap-add=SYS_PTRACE",
13+
"--security-opt=seccomp:unconfined",
14+
"--security-opt=apparmor:unconfined",
15+
"--volume=/tmp/.X11-unix:/tmp/.X11-unix",
16+
"--volume=/mnt/wslg:/mnt/wslg",
17+
"--ipc=host"
18+
// uncomment to use intel iGPU
19+
// "--device=/dev/dri"
20+
],
21+
"containerEnv": {
22+
"DISPLAY": "${localEnv:DISPLAY}", // Needed for GUI try ":0" for windows
23+
"WAYLAND_DISPLAY": "${localEnv:WAYLAND_DISPLAY}",
24+
"XDG_RUNTIME_DIR": "${localEnv:XDG_RUNTIME_DIR}",
25+
"PULSE_SERVER": "${localEnv:PULSE_SERVER}",
26+
"LIBGL_ALWAYS_SOFTWARE": "1" // Needed for software rendering of opengl
27+
},
28+
// Set *default* container specific settings.json values on container create.
29+
"customizations": {
30+
"vscode": {
31+
"extensions": [
32+
"althack.ament-task-provider",
33+
"betwo.b2-catkin-tools",
34+
"DotJoshJohnson.xml",
35+
"ms-azuretools.vscode-docker",
36+
"ms-iot.vscode-ros",
37+
"ms-python.python",
38+
"ms-vscode.cpptools",
39+
"redhat.vscode-yaml",
40+
"smilerobotics.urdf",
41+
"streetsidesoftware.code-spell-checker",
42+
"twxs.cmake",
43+
"yzhang.markdown-all-in-one",
44+
"zachflower.uncrustify"
45+
]
46+
}
47+
}
48+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import glob
2+
import os
3+
import subprocess
4+
import yaml
5+
6+
prefix="src"
7+
8+
def add_git_submodule(repo_name, repo_url, repo_version):
9+
subprocess.call(['git', 'submodule', 'add', '-b', repo_version, repo_url, repo_name])
10+
11+
def is_submodule(repo_name):
12+
try:
13+
subprocess.check_output(['git', 'submodule', 'status', repo_name], stderr=subprocess.DEVNULL)
14+
return True
15+
except subprocess.CalledProcessError:
16+
return False
17+
18+
def parse_repos_file(file_path):
19+
with open(file_path, 'r') as file:
20+
repos_data = yaml.safe_load(file)
21+
repositories = repos_data['repositories']
22+
23+
for repo_name, repo_info in repositories.items():
24+
if 'type' in repo_info and repo_info['type'] == 'git':
25+
repo_url = repo_info['url']
26+
repo_version = repo_info['version']
27+
submodule_name = os.path.join(prefix, repo_name)
28+
29+
if not is_submodule(submodule_name):
30+
add_git_submodule(submodule_name, repo_url, repo_version)
31+
print(f"Added {repo_name} as a submodule.")
32+
33+
# Find .repos files within the src directory
34+
repos_files = glob.glob('src/**/*.repos', recursive=True)
35+
36+
# Process each .repos file
37+
for repos_file in repos_files:
38+
parse_repos_file(repos_file)

.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
PYTHONPATH=src:install/lib/python3.12/site-packages

.github/actions/lint/action.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
name: 'Lint'
2+
description: 'Lint using devcontainer'
3+
runs:
4+
using: 'docker'
5+
image: '../../../.devcontainer/Dockerfile'
6+
entrypoint: ".github/actions/lint/run.sh"

.github/actions/lint/run.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
set -e
3+
4+
./setup.sh
5+
6+
case "$LINTER" in
7+
"uncrustify"|"cppcheck"|"cpplint")
8+
if [ -z "$(find src/ -name '*.cpp' -o -name '*.hpp' -o -name '*.c' -o -name '*.h')" ]; then
9+
echo "No C/C++ files found. Skipping $LINTER."
10+
exit 0
11+
fi
12+
;;
13+
"flake8"|"pep257")
14+
if [ -z "$(find src/ -name '*.py')" ]; then
15+
echo "No Python files found. Skipping $LINTER."
16+
exit 0
17+
fi
18+
;;
19+
esac
20+
21+
ament_${LINTER} src/

.github/actions/test/action.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
name: 'Test'
2+
description: 'Test using devcontainer'
3+
runs:
4+
using: 'docker'
5+
image: '../../../.devcontainer/Dockerfile'
6+
entrypoint: ".github/actions/test/run.sh"

.github/actions/test/run.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash
2+
set -e
3+
4+
./setup.sh
5+
./build.sh
6+
./test.sh

.github/dependabot.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: github-actions
4+
directory: "/"
5+
schedule:
6+
interval: daily
7+
open-pull-requests-limit: 10

.github/workflows/docs.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: docs
2+
3+
on:
4+
release:
5+
push:
6+
tags:
7+
- 'v*'
8+
workflow_dispatch:
9+
10+
jobs:
11+
publish:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
- name: Build and push docs
17+
uses: athackst/mkdocs-simple-plugin@v3.2.0

0 commit comments

Comments
 (0)