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

General changes to maintain the code working #118

Merged
merged 20 commits into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
15 changes: 0 additions & 15 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,6 @@ jobs:
with:
options: --line-length=99

spellcheck:
name: Spellcheck
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Spellcheck
uses: rojopolis/[email protected]

industrial_ci:
name: Industrial CI
runs-on: ubuntu-22.04
Expand All @@ -38,18 +29,13 @@ jobs:
- name: Checkout
uses: actions/checkout@v3

- name: Act + Docker fix
run: |
sudo chown runner:docker /var/run/docker.sock

- name: Setup ROS2 Workspace and Clone Repositories
run: |
mkdir -p src
find . -maxdepth 1 -not -name src -not -name . -exec mv {} src/ \;
python3 -m pip install -U vcstool
vcs import src < src/rosbot/rosbot_hardware.repos
vcs import src < src/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

Expand All @@ -58,7 +44,6 @@ jobs:
- name: Leave only ROSbot tests
shell: bash
run: |
sed '/if(BUILD_TESTING)/,/endif()/d' src/diff_drive_controller/CMakeLists.txt -i
sed '/if(BUILD_TESTING)/,/endif()/d' src/imu_sensor_broadcaster/CMakeLists.txt -i
sed '/if(BUILD_TESTING)/,/endif()/d' src/micro_ros_msgs/CMakeLists.txt -i

Expand Down
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
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
Expand All @@ -16,7 +16,7 @@ repos:
args: [--pytest-test-first]

- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
rev: v2.3.0
hooks:
- id: codespell
name: codespell
Expand All @@ -33,13 +33,13 @@ 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,
Expand Down Expand Up @@ -71,7 +71,7 @@ repos:

# 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]
Expand Down
54 changes: 0 additions & 54 deletions .pyspelling.yaml

This file was deleted.

161 changes: 0 additions & 161 deletions .wordlist.txt

This file was deleted.

44 changes: 11 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ sudo apt-get install -y python3-pip ros-dev-tools stm32flash
Create workspace folder and clone `rosbot_ros` repository:

```bash
mkdir -p ros2_ws/src
mkdir -p ros2_ws
cd ros2_ws
git clone https://github.com/husarion/rosbot_ros src/
git clone https://github.com/husarion/rosbot_ros src/rosbot_ros
```

### Build and run on hardware
Expand All @@ -62,17 +62,14 @@ export HUSARION_ROS_BUILD=hardware

source /opt/ros/$ROS_DISTRO/setup.bash

vcs import src < src/rosbot/rosbot_hardware.repos
vcs import src < src/rosbot_ros/rosbot/rosbot_hardware.repos

# Build only diff_drive_controller and imu_sensor_broadcaster from ros2_controllers
cp -r src/ros2_controllers/diff_drive_controller src && cp -r src/ros2_controllers/imu_sensor_broadcaster src && rm -rf src/ros2_controllers

rm -r src/rosbot_gazebo
rm -r src/rosbot_ros/rosbot_gazebo

sudo rosdep init
rosdep update --rosdistro $ROS_DISTRO
rosdep install -i --from-path src --rosdistro $ROS_DISTRO -y
colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release
colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release
```

Flash firmware:
Expand All @@ -91,42 +88,23 @@ ros2 launch rosbot_bringup combined.launch.py

### Build and run Gazebo simulation

Prerequisites:

> [!TIP]
> The default version of Gazebo Ignition will be installed with the instructions below. If you want to install a different version of the simulator, it is necessary to:
>
> - Check compatible versions of ROS 2 and Gazebo in [this table](https://gazebosim.org/docs/garden/ros_installation#summary-of-compatible-ros-and-gazebo-combinations)
> - [Install the appropriate version](https://gazebosim.org/docs/fortress/install_ubuntu#binary-installation-on-ubuntu),
> - Add the `GZ_VERSION` environment variable appropriate to your version
>
> ```bash
> export GZ_VERSION=fortress
> ```

If you have installed multiple versions of Gazebo use the global variable to select the correct one:

```bash
export GZ_VERSION=fortress
```

Building:

```bash
export HUSARION_ROS_BUILD=simulation

source /opt/ros/$ROS_DISTRO/setup.bash

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

# Build only diff_drive_controller and imu_sensor_broadcaster from ros2_controllers
cp -r src/ros2_controllers/diff_drive_controller src && cp -r src/ros2_controllers/imu_sensor_broadcaster src && rm -rf src/ros2_controllers
# Build only imu_sensor_broadcaster from ros2_controllers
cp -r src/ros2_controllers/imu_sensor_broadcaster src && rm -rf src/ros2_controllers

sudo rosdep init
rosdep update --rosdistro $ROS_DISTRO
rosdep install -i --from-path src --rosdistro $ROS_DISTRO -y
colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release
colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release
```

Running:
Expand Down Expand Up @@ -173,7 +151,7 @@ colcon test-result --verbose
### Format python code with [Black](https://github.com/psf/black)

```bash
cd src/
cd src/rosbot_ros
black rosbot*
```

Expand Down
2 changes: 1 addition & 1 deletion docker/.env
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
SERIAL_PORT=/dev/ttyUSB0
ROS_NAMESPACE=robot1
ROS_NAMESPACE=robot1
Loading