Skip to content

Commit 9ffafaa

Browse files
rafal-goreckiDominikNdelihus
authored
Jazzy - General code maintenance (#123)
* support for RPi5 * restart ros2_control_node if error * minor fixes * Update controller.launch.py * fix mecanum lauch * Fix controller namespace (#115) * Fix controller namespace * spellcheck fix * use husarion-controller from main branch (#116) * added docker setup for local build * ros2 humble works without custom controllers * Cleaner logs from flash script (#108) * Clean up output of flash script * Pre commit * Cleaner * Specify concrete commands * Simplify * pre-commit fix * Clean up usb firmware * Clean up unused arguments (#118) * Add scan filter * Clean up * undo * added docker setup for local build * broken ros2 controller - previous worked fine * Clean up unused arguments * Fix workflow: Remove spellcheck (redundant), fix integration check * Fix multiple robot spawn * fixes * Delete tools folder * Pre-commit update and remove redundant flake8 * Fix some tests and set hash in vcs * Clean up * Move controller test to bringup and reduce test time * Fix lidar in simulation * Rename test files * Fix tests * Add scan_filtered test and improve workpace tree --------- Co-authored-by: Dominik Nowak <dominik.nwk@gmail.com> * Applied xml schemas for xmllint (#101) * applied package.xml template Signed-off-by: Jakub Delicat <jakub.delicat@husarion.com> * chronology Signed-off-by: Jakub Delicat <jakub.delicat@husarion.com> * Support Signed-off-by: Jakub Delicat <jakub.delicat@husarion.com> * Removed unnecessary dep Signed-off-by: Jakub Delicat <jakub.delicat@husarion.com> * DDS xml lint --------- Signed-off-by: Jakub Delicat <jakub.delicat@husarion.com> Co-authored-by: rafal-gorecki <rafal.gorecki@husarion.com> * Some fixes * test * Pre-commit * pre-commit * Humble docker (#124) * Add hardware and sim Docker * Fix hardware docker * Fixes * Use packages-up-to * Add description to compose * Jazzy docker (#125) * Add hardware and sim Docker * Fix hardware docker * Fixes * Fixes * Simulation gz_gui fixes + use TwistStamped * Use packages-up-to * Add healthcheck + clean up * Add healthcheck + clean up * Remove combined.launch.py * Add User env to docker * Add devcontainer * Changes in healthcheck * Fix simulation * Red error info * Change healthcheck * Remove healthcheck arg * Fix workflow * Remove building imu_broadcaster * One more removal * update repos * Clean up * Update docs * Add launch arguments info * Add status info * add unsaved * fix * Simplify * Update URDF, fix mecanum sim, fix laser_filter ns, remove tf renaming * pre-commit * Fix ros2 controller with namespace * Fix building instructions * Fix indent * Fix mecanum controller * Remove camera test from sim * update * Adjust wheel_separation_multiplier param * Simplify docker --------- Signed-off-by: Jakub Delicat <jakub.delicat@husarion.com> Co-authored-by: dominikn <dominik.nwk@gmail.com> Co-authored-by: Jakub Delicat <109142865+delihus@users.noreply.github.com>
1 parent 2760517 commit 9ffafaa

File tree

75 files changed

+1467
-2269
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+1467
-2269
lines changed

.devcontainer/Dockerfile

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
FROM husarnet/ros:jazzy-ros-base
2+
3+
ARG USERNAME=husarion
4+
ARG UID=1001
5+
ARG GID=$UID
6+
7+
# Install development tools
8+
RUN apt update -q && \
9+
apt upgrade -q -y && \
10+
apt install -y --no-install-recommends \
11+
python3-pip \
12+
ros-dev-tools \
13+
ros-$ROS_DISTRO-plotjuggler \
14+
ros-$ROS_DISTRO-plotjuggler-ros \
15+
ros-$ROS_DISTRO-rqt* \
16+
ros-$ROS_DISTRO-rviz2 \
17+
ros-$ROS_DISTRO-teleop-twist-keyboard
18+
19+
# Create and switch to user
20+
RUN groupadd -g $GID $USERNAME && \
21+
useradd -lm -u $UID -g $USERNAME -s /bin/bash $USERNAME && \
22+
echo "$USERNAME ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
23+
USER $USERNAME
24+
25+
# Setup workspace
26+
WORKDIR /home/$USERNAME/ros2_ws
27+
RUN mkdir -p /home/$USERNAME/ros2_ws/src && \
28+
echo 'source /opt/ros/'$ROS_DISTRO'/setup.bash' >> /home/$USERNAME/.bashrc && \
29+
echo 'source /home/'$USERNAME'/ros2_ws/install/setup.bash' >> /home/$USERNAME/.bashrc
30+
31+
ENV TERM=xterm-256color
32+
ENV RCUTILS_COLORIZED_OUTPUT=1
33+
34+
# Setup entrypoint
35+
COPY ./ros_entrypoint.sh /
36+
ENTRYPOINT ["/ros_entrypoint.sh"]
37+
CMD ["bash"]

.devcontainer/compose.yaml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
services:
2+
devcontainer:
3+
build: .
4+
ipc: host
5+
network_mode: host
6+
privileged: true
7+
tty: true
8+
runtime: nvidia
9+
volumes:
10+
- ros2_ws_volume:/home/husarion/ros2_ws
11+
- ../:/home/husarion/ros2_ws/src/rosbot_ros:cached
12+
- /tmp/.X11-unix:/tmp/.X11-unix
13+
- /home/${USER}/.ssh:/home/husarion/.ssh
14+
- /lib/modules:/lib/modules:ro
15+
environment:
16+
- DISPLAY
17+
- RMW_IMPLEMENTATION
18+
- QT_X11_NO_MITSHM=1
19+
- NVIDIA_VISIBLE_DEVICES=all
20+
- NVIDIA_DRIVER_CAPABILITIES=all
21+
- PIP_BREAK_SYSTEM_PACKAGES=1
22+
command: sleep infinity
23+
24+
volumes:
25+
ros2_ws_volume:

.devcontainer/devcontainer.json

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"dockerComposeFile": "compose.yaml",
3+
"initializeCommand": "xhost +local:docker",
4+
"service": "devcontainer",
5+
"workspaceFolder": "/home/husarion/ros2_ws/src",
6+
// "postCreateCommand": "~/ros2_ws/src/ros/.vscode/scripts/install_dependencies.sh && ~/ros2_ws/src/ros/.vscode/scripts/install_dependencies.sh",
7+
"shutdownAction": "stopCompose",
8+
"customizations": {
9+
"vscode": {
10+
"extensions": [
11+
"althack.ament-task-provider",
12+
"charliermarsh.ruff",
13+
"eamodio.gitlens",
14+
"GitHub.copilot",
15+
"ms-python.python",
16+
"ms-iot.vscode-ros",
17+
"ms-vscode.cpptools-extension-pack",
18+
"smilerobotics.urdf",
19+
"redhat.vscode-xml",
20+
"tamasfe.even-better-toml",
21+
"timonwong.shellcheck",
22+
"streetsidesoftware.code-spell-checker",
23+
"yzhang.markdown-all-in-one"
24+
],
25+
"settings": {
26+
"files.associations": {
27+
"*.rviz": "yaml",
28+
"*.srdf": "xml",
29+
"*.urdf": "xml",
30+
"*.xacro": "xml"
31+
}
32+
}
33+
}
34+
}
35+
}

.devcontainer/ros_entrypoint.sh

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
# shellcheck disable=SC1090,SC1091
3+
set -e
4+
5+
exec "$@"

.github/workflows/tests.yaml

+15-33
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,11 @@ on:
66
workflow_dispatch:
77

88
jobs:
9-
black:
10-
name: Black
11-
runs-on: ubuntu-24.04
12-
steps:
13-
- name: Checkout
14-
uses: actions/checkout@v3
15-
- name: Black
16-
uses: psf/black@23.11.0
17-
with:
18-
options: --line-length=99
19-
20-
spellcheck:
21-
name: Spellcheck
22-
runs-on: ubuntu-24.04
23-
steps:
24-
- name: Checkout
25-
uses: actions/checkout@v3
26-
- name: Spellcheck
27-
uses: rojopolis/spellcheck-github-actions@0.33.1
9+
pre-commit:
10+
name: Pre-commit
11+
uses: ros-controls/ros2_control_ci/.github/workflows/reusable-pre-commit.yml@master
12+
with:
13+
ros_distro: jazzy
2814

2915
industrial_ci:
3016
name: Industrial CI
@@ -36,35 +22,31 @@ jobs:
3622
ROS_DISTRO: [jazzy]
3723
steps:
3824
- name: Checkout
39-
uses: actions/checkout@v3
40-
41-
- name: Act + Docker fix
42-
run: |
43-
sudo chown runner:docker /var/run/docker.sock
25+
uses: actions/checkout@v4
4426

4527
- name: Setup ROS2 Workspace and Clone Repositories
4628
run: |
47-
mkdir -p src
48-
find . -maxdepth 1 -not -name src -not -name . -exec mv {} src/ \;
29+
mkdir -p src/rosbot_ros
30+
find . -maxdepth 1 -not -name src -not -name . -exec mv {} src/rosbot_ros \;
4931
python3 -m pip install -U vcstool
50-
vcs import src < src/rosbot/rosbot_hardware.repos
51-
vcs import src < src/rosbot/rosbot_simulation.repos
32+
vcs import src < src/rosbot_ros/rosbot/rosbot_hardware.repos
33+
vcs import src < src/rosbot_ros/rosbot/rosbot_simulation.repos
34+
cp -r src/ros2_controllers/diff_drive_controller src/
35+
cp -r src/ros2_controllers/imu_sensor_broadcaster src/
36+
rm -rf src/ros2_controllers
5237
5338
# Package micro_ros_msgs does not have industrial ci and tests does not pass.
5439
# For more information see https://github.com/micro-ROS/micro_ros_msgs/issues/7
5540
- name: Leave only ROSbot tests
5641
shell: bash
5742
run: |
5843
sed '/if(BUILD_TESTING)/,/endif()/d' src/micro_ros_msgs/CMakeLists.txt -i
59-
60-
- name: Fix pip
61-
shell: bash
62-
run: |
63-
echo -e "[global]\nbreak-system-packages = true" >> ~/.config/pip/pip.conf
44+
sed '/if(BUILD_TESTING)/,/endif()/d' src/ros_components_description/CMakeLists.txt -i
6445
6546
- name: Running ROS Industrial CI
6647
uses: ros-industrial/industrial_ci@master
6748
env:
49+
PIP_BREAK_SYSTEM_PACKAGES: 1
6850
ROS_DISTRO: ${{matrix.ROS_DISTRO}}
6951
DOCKER_IMAGE: ros:${{matrix.ROS_DISTRO}}-ros-base
7052
IMMEDIATE_TEST_OUTPUT: true

.pre-commit-config.yaml

+46-23
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,51 @@
11
---
22
repos:
33
- repo: https://github.com/pre-commit/pre-commit-hooks
4-
rev: v4.5.0
4+
rev: v5.0.0
55
hooks:
6-
- id: check-merge-conflict
7-
- id: trailing-whitespace
8-
- id: end-of-file-fixer
9-
- id: check-yaml
10-
- id: check-xml
116
- id: check-added-large-files
7+
# mesh files has to be taken into account
8+
args: [--maxkb=3000]
129
- id: check-ast
1310
- id: check-json
11+
exclude: ^.vscode/|^.devcontainer/
12+
- id: check-merge-conflict
13+
- id: check-symlinks
14+
- id: check-xml
15+
- id: check-yaml
16+
- id: debug-statements
17+
- id: destroyed-symlinks
18+
- id: detect-private-key
19+
- id: end-of-file-fixer
20+
- id: fix-byte-order-marker
1421
- id: name-tests-test
15-
files: ^.*\/test\/.*$
16-
args: [--pytest-test-first]
22+
- id: mixed-line-ending
23+
- id: trailing-whitespace
24+
25+
- repo: https://github.com/PyCQA/isort
26+
rev: 5.13.2
27+
hooks:
28+
- id: isort
29+
args: [--profile, black]
30+
31+
- repo: https://github.com/cheshirekow/cmake-format-precommit
32+
rev: v0.6.13
33+
hooks:
34+
- id: cmake-format
35+
36+
- repo: https://github.com/pre-commit/mirrors-clang-format
37+
rev: v19.1.4
38+
hooks:
39+
- id: clang-format
1740

1841
- repo: https://github.com/codespell-project/codespell
19-
rev: v2.2.6
42+
rev: v2.3.0
2043
hooks:
2144
- id: codespell
2245
name: codespell
2346
description: Checks for common misspellings in text files.
24-
entry: codespell *
47+
entry: codespell
48+
exclude_types: [rst, svg]
2549
language: python
2650
types: [text]
2751

@@ -33,23 +57,16 @@ repos:
3357
args: [--mapping, '2', --sequence, '4', --offset, '2', --width, '100']
3458

3559
- repo: https://github.com/psf/black
36-
rev: 24.4.0
60+
rev: 24.10.0
3761
hooks:
3862
- id: black
3963
args: [--line-length=99]
4064

4165
- repo: https://github.com/PyCQA/flake8
42-
rev: 7.0.0
66+
rev: 7.1.1
4367
hooks:
4468
- id: flake8
45-
args: ['--ignore=E501,W503'] # ignore too long line and line break before binary operator,
46-
# black checks it
47-
48-
- repo: https://github.com/PyCQA/isort
49-
rev: 5.13.2
50-
hooks:
51-
- id: isort
52-
args: [--profile, black]
69+
args: ['--ignore=E501,W503']
5370

5471
- repo: local
5572
hooks:
@@ -65,14 +82,20 @@ repos:
6582
- id: ament_copyright
6683
name: ament_copyright
6784
description: Check if copyright notice is available in all files.
68-
stages: [commit]
85+
stages: [pre-commit]
6986
entry: ament_copyright
7087
language: system
88+
exclude: ^.*\.md$
7189

72-
# Docs - RestructuredText hooks
7390
- repo: https://github.com/PyCQA/doc8
74-
rev: v1.1.1
91+
rev: v1.1.2
7592
hooks:
7693
- id: doc8
7794
args: [--max-line-length=100, --ignore=D001]
7895
exclude: ^.*\/CHANGELOG\.rst/.*$
96+
97+
- repo: https://github.com/tier4/pre-commit-hooks-ros
98+
rev: v0.10.0
99+
hooks:
100+
- id: prettier-package-xml
101+
- id: sort-package-xml

.pyspelling.yaml

-54
This file was deleted.

0 commit comments

Comments
 (0)