Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jazzy - General code maintenance #123

Merged
merged 52 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
b02dfa7
support for RPi5
DominikN Sep 18, 2024
f6840b5
restart ros2_control_node if error
DominikN Sep 27, 2024
a95f8d8
minor fixes
DominikN Sep 27, 2024
177c0c6
Update controller.launch.py
DominikN Sep 27, 2024
85a6544
fix mecanum lauch
DominikN Nov 17, 2024
3b64118
Fix controller namespace (#115)
rafal-gorecki Nov 19, 2024
353eebf
use husarion-controller from main branch (#116)
DominikN Nov 21, 2024
39504b8
Cleaner logs from flash script (#108)
rafal-gorecki Nov 27, 2024
1f2a8ae
Clean up unused arguments (#118)
rafal-gorecki Nov 28, 2024
f09c16a
Applied xml schemas for xmllint (#101)
delihus Nov 28, 2024
57c3629
Merge Jazzy into devel
rafal-gorecki Nov 29, 2024
31be74a
Some fixes
rafal-gorecki Nov 29, 2024
7f35021
test
rafal-gorecki Nov 29, 2024
678324d
Pre-commit
rafal-gorecki Nov 29, 2024
d8e9002
pre-commit
rafal-gorecki Nov 29, 2024
9c3307c
Humble docker (#124)
rafal-gorecki Dec 2, 2024
cef7b92
Jazzy docker (#125)
rafal-gorecki Dec 2, 2024
a75745c
Add healthcheck + clean up
rafal-gorecki Dec 3, 2024
63eb8d6
Add healthcheck + clean up
rafal-gorecki Dec 3, 2024
48dfc63
Remove combined.launch.py
rafal-gorecki Dec 4, 2024
a529cbd
Add User env to docker
rafal-gorecki Dec 4, 2024
cf003b1
Merge branch 'humble-devel' into jazzy-devel
rafal-gorecki Dec 4, 2024
91f095d
Add devcontainer
rafal-gorecki Dec 4, 2024
bff9ad1
Changes in healthcheck
rafal-gorecki Dec 4, 2024
82b1466
Fix simulation
rafal-gorecki Dec 4, 2024
45359b8
Red error info
rafal-gorecki Dec 4, 2024
c74f922
Change healthcheck
rafal-gorecki Dec 4, 2024
02c5b46
Remove healthcheck arg
rafal-gorecki Dec 4, 2024
604b8d0
Fix workflow
rafal-gorecki Dec 4, 2024
019acde
Remove building imu_broadcaster
rafal-gorecki Dec 4, 2024
3996ec1
One more removal
rafal-gorecki Dec 4, 2024
9196959
update repos
rafal-gorecki Dec 4, 2024
db0ad25
Clean up
rafal-gorecki Dec 5, 2024
482a944
Update docs
rafal-gorecki Dec 5, 2024
87a0bee
Merge branch 'humble-devel' into jazzy-devel
rafal-gorecki Dec 5, 2024
c15d21b
Add launch arguments info
rafal-gorecki Dec 5, 2024
3119040
Merge branch 'humble-devel' into jazzy-devel
rafal-gorecki Dec 5, 2024
24f19f0
Add status info
rafal-gorecki Dec 5, 2024
5037817
add unsaved
rafal-gorecki Dec 5, 2024
8e67f27
Merge branch 'humble-devel' into jazzy-devel
rafal-gorecki Dec 5, 2024
b807171
fix
rafal-gorecki Dec 5, 2024
0ea96ec
Simplify
rafal-gorecki Dec 5, 2024
252192f
Update URDF, fix mecanum sim, fix laser_filter ns, remove tf renaming
rafal-gorecki Dec 9, 2024
267e678
pre-commit
rafal-gorecki Dec 10, 2024
a3b6a17
Fix ros2 controller with namespace
rafal-gorecki Dec 10, 2024
1cb0bdb
Fix building instructions
rafal-gorecki Dec 10, 2024
9a2f81d
Fix indent
rafal-gorecki Dec 10, 2024
d48291f
Fix mecanum controller
rafal-gorecki Dec 10, 2024
3cc31b1
Remove camera test from sim
rafal-gorecki Dec 10, 2024
61e27a7
update
rafal-gorecki Dec 10, 2024
ca77bf4
Adjust wheel_separation_multiplier param
rafal-gorecki Dec 11, 2024
ff895fd
Simplify docker
rafal-gorecki Dec 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
FROM husarnet/ros:jazzy-ros-base

ARG USERNAME=husarion
ARG UID=1001
ARG GID=$UID

# Install development tools
RUN apt update -q && \
apt upgrade -q -y && \
apt install -y --no-install-recommends \
python3-pip \
ros-dev-tools \
ros-$ROS_DISTRO-plotjuggler \
ros-$ROS_DISTRO-plotjuggler-ros \
ros-$ROS_DISTRO-rqt* \
ros-$ROS_DISTRO-rviz2 \
ros-$ROS_DISTRO-teleop-twist-keyboard

# Create and switch to user
RUN groupadd -g $GID $USERNAME && \
useradd -lm -u $UID -g $USERNAME -s /bin/bash $USERNAME && \
echo "$USERNAME ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
USER $USERNAME

# Setup workspace
WORKDIR /home/$USERNAME/ros2_ws
RUN mkdir -p /home/$USERNAME/ros2_ws/src && \
echo 'source /opt/ros/'$ROS_DISTRO'/setup.bash' >> /home/$USERNAME/.bashrc && \
echo 'source /home/'$USERNAME'/ros2_ws/install/setup.bash' >> /home/$USERNAME/.bashrc

ENV TERM=xterm-256color
ENV RCUTILS_COLORIZED_OUTPUT=1

# Setup entrypoint
COPY ./ros_entrypoint.sh /
ENTRYPOINT ["/ros_entrypoint.sh"]
CMD ["bash"]
25 changes: 25 additions & 0 deletions .devcontainer/compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
services:
devcontainer:
build: .
ipc: host
network_mode: host
privileged: true
tty: true
runtime: nvidia
volumes:
- ros2_ws_volume:/home/husarion/ros2_ws
- ../:/home/husarion/ros2_ws/src/rosbot_ros:cached
- /tmp/.X11-unix:/tmp/.X11-unix
- /home/${USER}/.ssh:/home/husarion/.ssh
- /lib/modules:/lib/modules:ro
environment:
- DISPLAY
- RMW_IMPLEMENTATION
- QT_X11_NO_MITSHM=1
- NVIDIA_VISIBLE_DEVICES=all
- NVIDIA_DRIVER_CAPABILITIES=all
- PIP_BREAK_SYSTEM_PACKAGES=1
command: sleep infinity

volumes:
ros2_ws_volume:
35 changes: 35 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"dockerComposeFile": "compose.yaml",
"initializeCommand": "xhost +local:docker",
"service": "devcontainer",
"workspaceFolder": "/home/husarion/ros2_ws/src",
// "postCreateCommand": "~/ros2_ws/src/ros/.vscode/scripts/install_dependencies.sh && ~/ros2_ws/src/ros/.vscode/scripts/install_dependencies.sh",
"shutdownAction": "stopCompose",
"customizations": {
"vscode": {
"extensions": [
"althack.ament-task-provider",
"charliermarsh.ruff",
"eamodio.gitlens",
"GitHub.copilot",
"ms-python.python",
"ms-iot.vscode-ros",
"ms-vscode.cpptools-extension-pack",
"smilerobotics.urdf",
"redhat.vscode-xml",
"tamasfe.even-better-toml",
"timonwong.shellcheck",
"streetsidesoftware.code-spell-checker",
"yzhang.markdown-all-in-one"
],
"settings": {
"files.associations": {
"*.rviz": "yaml",
"*.srdf": "xml",
"*.urdf": "xml",
"*.xacro": "xml"
}
}
}
}
}
5 changes: 5 additions & 0 deletions .devcontainer/ros_entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
# shellcheck disable=SC1090,SC1091
set -e

exec "$@"
48 changes: 15 additions & 33 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,11 @@ on:
workflow_dispatch:

jobs:
black:
name: Black
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Black
uses: psf/[email protected]
with:
options: --line-length=99

spellcheck:
name: Spellcheck
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Spellcheck
uses: rojopolis/[email protected]
pre-commit:
name: Pre-commit
uses: ros-controls/ros2_control_ci/.github/workflows/reusable-pre-commit.yml@master
with:
ros_distro: jazzy

industrial_ci:
name: Industrial CI
Expand All @@ -36,35 +22,31 @@ jobs:
ROS_DISTRO: [jazzy]
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Act + Docker fix
run: |
sudo chown runner:docker /var/run/docker.sock
uses: actions/checkout@v4

- name: Setup ROS2 Workspace and Clone Repositories
run: |
mkdir -p src
find . -maxdepth 1 -not -name src -not -name . -exec mv {} src/ \;
mkdir -p src/rosbot_ros
find . -maxdepth 1 -not -name src -not -name . -exec mv {} src/rosbot_ros \;
python3 -m pip install -U vcstool
vcs import src < src/rosbot/rosbot_hardware.repos
vcs import src < src/rosbot/rosbot_simulation.repos
vcs import src < src/rosbot_ros/rosbot/rosbot_hardware.repos
vcs import src < src/rosbot_ros/rosbot/rosbot_simulation.repos
cp -r src/ros2_controllers/diff_drive_controller src/
cp -r src/ros2_controllers/imu_sensor_broadcaster src/
rm -rf src/ros2_controllers

# Package micro_ros_msgs does not have industrial ci and tests does not pass.
# For more information see https://github.com/micro-ROS/micro_ros_msgs/issues/7
- name: Leave only ROSbot tests
shell: bash
run: |
sed '/if(BUILD_TESTING)/,/endif()/d' src/micro_ros_msgs/CMakeLists.txt -i

- name: Fix pip
shell: bash
run: |
echo -e "[global]\nbreak-system-packages = true" >> ~/.config/pip/pip.conf
sed '/if(BUILD_TESTING)/,/endif()/d' src/ros_components_description/CMakeLists.txt -i

- name: Running ROS Industrial CI
uses: ros-industrial/industrial_ci@master
env:
PIP_BREAK_SYSTEM_PACKAGES: 1
ROS_DISTRO: ${{matrix.ROS_DISTRO}}
DOCKER_IMAGE: ros:${{matrix.ROS_DISTRO}}-ros-base
IMMEDIATE_TEST_OUTPUT: true
69 changes: 46 additions & 23 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,27 +1,51 @@
---
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v5.0.0
hooks:
- id: check-merge-conflict
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-xml
- id: check-added-large-files
# mesh files has to be taken into account
args: [--maxkb=3000]
- id: check-ast
- id: check-json
exclude: ^.vscode/|^.devcontainer/
- id: check-merge-conflict
- id: check-symlinks
- id: check-xml
- id: check-yaml
- id: debug-statements
- id: destroyed-symlinks
- id: detect-private-key
- id: end-of-file-fixer
- id: fix-byte-order-marker
- id: name-tests-test
files: ^.*\/test\/.*$
args: [--pytest-test-first]
- id: mixed-line-ending
- id: trailing-whitespace

- repo: https://github.com/PyCQA/isort
rev: 5.13.2
hooks:
- id: isort
args: [--profile, black]

- repo: https://github.com/cheshirekow/cmake-format-precommit
rev: v0.6.13
hooks:
- id: cmake-format

- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v19.1.4
hooks:
- id: clang-format

- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
rev: v2.3.0
hooks:
- id: codespell
name: codespell
description: Checks for common misspellings in text files.
entry: codespell *
entry: codespell
exclude_types: [rst, svg]
language: python
types: [text]

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

- repo: https://github.com/psf/black
rev: 24.4.0
rev: 24.10.0
hooks:
- id: black
args: [--line-length=99]

- repo: https://github.com/PyCQA/flake8
rev: 7.0.0
rev: 7.1.1
hooks:
- id: flake8
args: ['--ignore=E501,W503'] # ignore too long line and line break before binary operator,
# black checks it

- repo: https://github.com/PyCQA/isort
rev: 5.13.2
hooks:
- id: isort
args: [--profile, black]
args: ['--ignore=E501,W503']

- repo: local
hooks:
Expand All @@ -65,14 +82,20 @@ repos:
- id: ament_copyright
name: ament_copyright
description: Check if copyright notice is available in all files.
stages: [commit]
stages: [pre-commit]
entry: ament_copyright
language: system
exclude: ^.*\.md$

# Docs - RestructuredText hooks
- repo: https://github.com/PyCQA/doc8
rev: v1.1.1
rev: v1.1.2
hooks:
- id: doc8
args: [--max-line-length=100, --ignore=D001]
exclude: ^.*\/CHANGELOG\.rst/.*$

- repo: https://github.com/tier4/pre-commit-hooks-ros
rev: v0.10.0
hooks:
- id: prettier-package-xml
- id: sort-package-xml
54 changes: 0 additions & 54 deletions .pyspelling.yaml

This file was deleted.

Loading
Loading