Skip to content

Commit

Permalink
Added and aplied precommit
Browse files Browse the repository at this point in the history
Signed-off-by: Jakub Delicat <jakub.delicat@husarion.com>
  • Loading branch information
delihus committed Oct 24, 2023
1 parent ac0baa2 commit 8f48429
Show file tree
Hide file tree
Showing 13 changed files with 190 additions and 187 deletions.
135 changes: 68 additions & 67 deletions .github/workflows/ros-docker-image.yaml
Original file line number Diff line number Diff line change
@@ -1,77 +1,78 @@
---
name: Build/Publish ROS Docker Image

on:
workflow_dispatch:
inputs:
build_type:
description: "Is it a \"development\" or a \"stable\" release?"
required: true
default: 'development'
type: choice
options:
- development
- stable
target_distro:
description: "In case of \"stable\" release specify the ROS distro of the existing docker image (eg. humble)"
type: string
default: "ardent"
target_release:
description: "In case of \"stable\" release specify the version of the existing docker image (eg. 1.0.12)"
type: string
default: "0.0.0"
target_date:
description: "In case of \"stable\" release specify the date of the existing docker image in format YYYYMMDD (eg. 20220124)"
type: string
default: "20131206"
repository_dispatch:
types: [rebuild, ros-package-update]
pull_request:
types:
- closed
- opened
workflow_dispatch:
inputs:
build_type:
description: Is it a "development" or a "stable" release?
required: true
default: development
type: choice
options:
- development
- stable
target_distro:
description: In case of "stable" release specify the ROS distro of the existing docker image (eg. humble)
type: string
default: ardent
target_release:
description: In case of "stable" release specify the version of the existing docker image (eg. 1.0.12)
type: string
default: 0.0.0
target_date:
description: In case of "stable" release specify the date of the existing docker image in format YYYYMMDD (eg. 20220124)
type: string
default: '20131206'
repository_dispatch:
types: [rebuild, ros-package-update]
pull_request:
types:
- closed
- opened

jobs:
build:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
build:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:

include:
- dockerfile: Dockerfile.hardware
repo_name: ""
platforms: "linux/amd64, linux/arm64"
ros_distro: "humble"
- dockerfile: Dockerfile.simulation
repo_name: "rosbot-gazebo"
platforms: "linux/amd64"
ros_distro: "humble"
- dockerfile: Dockerfile.hardware
repo_name: ""
platforms: "linux/amd64, linux/arm64"
ros_distro: "iron"
- dockerfile: Dockerfile.simulation
repo_name: "rosbot-gazebo"
platforms: "linux/amd64"
ros_distro: "iron"
include:
- dockerfile: Dockerfile.hardware
repo_name: ''
platforms: linux/amd64, linux/arm64
ros_distro: humble
- dockerfile: Dockerfile.simulation
repo_name: rosbot-gazebo
platforms: linux/amd64
ros_distro: humble
- dockerfile: Dockerfile.hardware
repo_name: ''
platforms: linux/amd64, linux/arm64
ros_distro: iron
- dockerfile: Dockerfile.simulation
repo_name: rosbot-gazebo
platforms: linux/amd64
ros_distro: iron

steps:
steps:

- name: Checkout
uses: actions/checkout@v2
- name: Checkout
uses: actions/checkout@v2

- name: ${{ matrix.dockerfile }} | ${{ matrix.ros_distro }} | Build
uses: husarion-ci/ros-docker-img-action@v0.4
with:
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub_token: ${{ secrets.DOCKERHUB_TOKEN }}
main_branch_name: ros2
dockerfile: ${{ matrix.dockerfile }}
repo_name: ${{ matrix.repo_name }}
build_type: ${{ inputs.build_type }}
ros_distro: ${{ matrix.ros_distro }}
platforms: ${{ matrix.platforms }}
- name: ${{ matrix.dockerfile }} | ${{ matrix.ros_distro }} | Build
uses: husarion-ci/ros-docker-img-action@v0.4
with:
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub_token: ${{ secrets.DOCKERHUB_TOKEN }}
main_branch_name: ros2
dockerfile: ${{ matrix.dockerfile }}
repo_name: ${{ matrix.repo_name }}
build_type: ${{ inputs.build_type }}
ros_distro: ${{ matrix.ros_distro }}
platforms: ${{ matrix.platforms }}
# variables important only for stable release
target_distro: ${{ inputs.target_distro }}
target_release: ${{ inputs.target_release }}
target_date: ${{ inputs.target_date }}
target_distro: ${{ inputs.target_distro }}
target_release: ${{ inputs.target_release }}
target_date: ${{ inputs.target_date }}
121 changes: 61 additions & 60 deletions .github/workflows/vulcanexus-docker-image.yaml
Original file line number Diff line number Diff line change
@@ -1,70 +1,71 @@
---
name: Build/Publish Vulcanexus Docker Image

on:
workflow_dispatch:
inputs:
build_type:
description: "Is it a \"development\" or a \"stable\" release?"
required: true
default: 'development'
type: choice
options:
- development
- stable
target_distro:
description: "In case of \"stable\" release specify the ROS distro of the existing docker image (eg. humble)"
type: string
default: "ardent"
target_release:
description: "In case of \"stable\" release specify the version of the existing docker image (eg. 1.0.12)"
type: string
default: "0.0.0"
target_date:
description: "In case of \"stable\" release specify the date of the existing docker image in format YYYYMMDD (eg. 20220124)"
type: string
default: "20131206"
repository_dispatch:
types: [rebuild, ros-package-update]
pull_request:
types:
- closed
- opened
workflow_dispatch:
inputs:
build_type:
description: Is it a "development" or a "stable" release?
required: true
default: development
type: choice
options:
- development
- stable
target_distro:
description: In case of "stable" release specify the ROS distro of the existing docker image (eg. humble)
type: string
default: ardent
target_release:
description: In case of "stable" release specify the version of the existing docker image (eg. 1.0.12)
type: string
default: 0.0.0
target_date:
description: In case of "stable" release specify the date of the existing docker image in format YYYYMMDD (eg. 20220124)
type: string
default: '20131206'
repository_dispatch:
types: [rebuild, ros-package-update]
pull_request:
types:
- closed
- opened

jobs:
build:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
build:
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:

include:
- dockerfile: Dockerfile.hardware
repo_name: ""
platforms: "linux/amd64, linux/arm64"
ros_distro: "humble"
- dockerfile: Dockerfile.simulation
repo_name: "rosbot-gazebo"
platforms: "linux/amd64"
ros_distro: "humble"
include:
- dockerfile: Dockerfile.hardware
repo_name: ''
platforms: linux/amd64, linux/arm64
ros_distro: humble
- dockerfile: Dockerfile.simulation
repo_name: rosbot-gazebo
platforms: linux/amd64
ros_distro: humble

steps:
steps:

- name: Checkout
uses: actions/checkout@v2
- name: Checkout
uses: actions/checkout@v2

- name: ${{ matrix.dockerfile }} | ${{ matrix.ros_distro }} | Build
uses: husarion-ci/ros-docker-img-action@v0.4
with:
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub_token: ${{ secrets.DOCKERHUB_TOKEN }}
main_branch_name: ros2
dockerfile: ${{ matrix.dockerfile }}
repo_name: ${{ matrix.repo_name }}
build_type: ${{ inputs.build_type }}
ros_distro: ${{ matrix.ros_distro }}
platforms: ${{ matrix.platforms }}
prefix: "vulcanexus-"
- name: ${{ matrix.dockerfile }} | ${{ matrix.ros_distro }} | Build
uses: husarion-ci/ros-docker-img-action@v0.4
with:
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
dockerhub_token: ${{ secrets.DOCKERHUB_TOKEN }}
main_branch_name: ros2
dockerfile: ${{ matrix.dockerfile }}
repo_name: ${{ matrix.repo_name }}
build_type: ${{ inputs.build_type }}
ros_distro: ${{ matrix.ros_distro }}
platforms: ${{ matrix.platforms }}
prefix: vulcanexus-
# variables important only for stable release
target_distro: ${{ inputs.target_distro }}
target_release: ${{ inputs.target_release }}
target_date: ${{ inputs.target_date }}
target_distro: ${{ inputs.target_distro }}
target_release: ${{ inputs.target_release }}
target_date: ${{ inputs.target_date }}
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
rosbot_ros/
rosbot_ros/
2 changes: 1 addition & 1 deletion Dockerfile.simulation
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ RUN MYDISTRO=${PREFIX:-ros}; MYDISTRO=${MYDISTRO//-/} && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

RUN echo $(cat /ros2_ws/src/rosbot_gazebo/package.xml | grep '<version>' | sed -r 's/.*<version>([0-9]+.[0-9]+.[0-9]+)<\/version>/\1/g') > /version.txt
RUN echo $(cat /ros2_ws/src/rosbot_gazebo/package.xml | grep '<version>' | sed -r 's/.*<version>([0-9]+.[0-9]+.[0-9]+)<\/version>/\1/g') > /version.txt
19 changes: 17 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ In *docker-compose.yaml* you have to change `device` passed to docker. For more
docker run \
--rm -it --privileged \
husarion/rosbot:humble \
print-serial-number.py
print-serial-number.py
```

## ROS node
Expand All @@ -49,6 +49,21 @@ For more details on what is being published and subscribed by nodes running in t
- [rosbot_ros](https://github.com/husarion/rosbot_ros/tree/humble)
- [rosbot_ros2_firmware](https://github.com/husarion/rosbot_ros2_firmware/)


## Developing
[pre-commit configuration](.pre-commit-config.yaml) prepares plenty of tests helping for developing and contributing. Usage:

```bash
# install pre-commit
pip install pre-commit

# initialize pre-commit workspace
pre-commit install

# manually run tests
pre-commit run -a
```

## How to use `rosbot` Docker image?

Find available projects below:
Expand All @@ -57,5 +72,5 @@ Find available projects below:
| - | - |
| [rosbot-sensors](https://github.com/husarion/rosbot-sensors) | Visualize all ROSbot sensors |
| [rosbot-gamepad](https://github.com/husarion/rosbot-gamepad) | Control the robot manually using a Logitech F710 gamepad |
| [rosbot-mapping](https://github.com/husarion/rosbot-mapping) | Create a map (using [slam_toolbox](https://github.com/SteveMacenski/slam_toolbox)) of the unknow environment with ROSbot controlled in LAN or over the Internet |
| [rosbot-mapping](https://github.com/husarion/rosbot-mapping) | Create a map (using [slam_toolbox](https://github.com/SteveMacenski/slam_toolbox)) of the unknown environment with ROSbot controlled in LAN or over the Internet |
| [rosbot-navigation](https://github.com/husarion/rosbot-navigation) | Autonomous navigation (using [navigation2](https://github.com/ros-planning/navigation2)) on a given map. |
2 changes: 1 addition & 1 deletion demo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ and run inside `teleop_twist_keyboard` to drive the ROSbot
ros2 run teleop_twist_keyboard teleop_twist_keyboard
```

With keys `i`, `j`, `l`, `,` you can drive forward, counter clockwise, clockwise and backwards. If you are using macanum wheels (see `demo/.env` file) hold `Shift` key that way the ROSbot goes left and right with `j` and `l` keys instead rotates.
With keys `i`, `j`, `l`, `,` you can drive forward, counter clockwise, clockwise and backwards. If you are using macanum wheels (see `demo/.env` file) hold `Shift` key that way the ROSbot goes left and right with `j` and `l` keys instead rotates.
2 changes: 1 addition & 1 deletion demo/compose.simulation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ services:
volumes:
- /tmp/.X11-unix:/tmp/.X11-unix:rw
- /dev:/dev
command: ros2 launch rosbot_gazebo simulation.launch.py mecanum:=${MECANUM:-False}
command: ros2 launch rosbot_gazebo simulation.launch.py mecanum:=${MECANUM:-False}
2 changes: 1 addition & 1 deletion demo/net.env
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ RMW_IMPLEMENTATION=rmw_cyclonedds_cpp

# 4. Cyclone DDS + VPN
# RMW_IMPLEMENTATION=rmw_cyclonedds_cpp
# CYCLONEDDS_URI=file:///husarnet-cyclonedds.xml
# CYCLONEDDS_URI=file:///husarnet-cyclonedds.xml
Loading

0 comments on commit 8f48429

Please sign in to comment.