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

New lib for GPIO #99

Merged
merged 15 commits into from
Feb 1, 2024
6 changes: 6 additions & 0 deletions .wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -150,3 +150,9 @@ subprocess
cbus
Dockerfile
unbuffered
libgpiod
REQ
gpiochip
gpiod
Rafal
Gorecki
68 changes: 45 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,27 @@
# Rosbot ROS

ROS2 packages for ROSbot 2R and ROSbot 2 PRO.

## ROS packages

### `rosbot`

Metapackage that contains dependencies to other repositories.

### `rosbot_bringup`

Package that contains launch, which starts all base functionalities. Also configuration for [robot_localization](https://github.com/cra-ros-pkg/robot_localization) and [ros2_controllers](https://github.com/ros-controls/ros2_controllers) are defined there.

### `rosbot_description`

URDF model used as a source of transforms on the physical robot. It was written to be compatible with ROS Industrial and preconfigured for ROS2 control.

### `rosbot_gazebo`

Launch files for Ignition Gazebo working with ROS2 control.

### `rosbot_controller`

ROS2 hardware controllers configuration for ROSbots.

## ROS API
Expand All @@ -31,14 +38,16 @@ For detailed instructions refer to the [rosbot_ros2_firmware repository](https:/

### Prerequisites

Install `colcon`, `vcs` and `rosdep`:
```
Install all necessary tools:

```bash
sudo apt-get update
sudo apt-get install -y python3-colcon-common-extensions python3-vcstool python3-rosdep python3-pip
sudo apt-get install -y ros-dev-tools python3-pip
rafal-gorecki marked this conversation as resolved.
Show resolved Hide resolved
```

Create workspace folder and clone `rosbot_ros` repository:
```

```bash
mkdir -p ros2_ws/src
cd ros2_ws
git clone https://github.com/husarion/rosbot_ros src/
Expand All @@ -47,7 +56,8 @@ git clone https://github.com/husarion/rosbot_ros src/
### Build and run on hardware

Building:
```

```bash
export HUSARION_ROS_BUILD=hardware

source /opt/ros/$ROS_DISTRO/setup.bash
Expand All @@ -65,31 +75,37 @@ rosdep install -i --from-path src --rosdistro $ROS_DISTRO -y
colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release
```

> **Prerequisites**
>
> Before starting the software on the robot please make sure that you're using the latest firmware and run the `micro-ROS` agent (as described in the *Usage on hardware* step).

Running:
```

rafal-gorecki marked this conversation as resolved.
Show resolved Hide resolved
```bash
source install/setup.bash
ros2 launch rosbot_bringup bringup.launch.py
ros2 launch rosbot_bringup combined.launch.py
```

### Build and run Gazebo simulation

Prerequisites:

> **Warning**
> The simulation is compatible with the Gazebo Fortress LTS version. Use [this installation guide ](https://gazebosim.org/docs/fortress/install_ubuntu#binary-installation-on-ubuntu) to install the proper version and remove the another versions e. g. Gazebo Garden:
> `sudo apt remove gz-garden && sudo apt autoremove`
> Look at [the table](https://gazebosim.org/docs/garden/ros_installation#summary-of-compatible-ros-and-gazebo-combinations) to see the compatible ROS 2 and Gazebo versions.
> [!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
Expand All @@ -110,14 +126,16 @@ colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release
```

Running:
```

```bash
source install/setup.bash
ros2 launch rosbot_gazebo simulation.launch.py
```

## Testing package
## Developer info

### pre-commit

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

```bash
Expand All @@ -134,20 +152,23 @@ pre-commit run -a
After initialization [pre-commit configuration](.pre-commit-config.yaml) will applied on every commit.

### Industrial CI
```

```bash
colcon test
```

> [!NOTE]
> Command `colcon test` does not build the code. Remember to build your code after changes.

If tests finish with errors print logs:
```

``` bash
colcon test-result --verbose
```

### Format python code with [Black](https://github.com/psf/black)
```

```bash
cd src/
black rosbot*
```
Expand All @@ -156,18 +177,19 @@ black rosbot*

At fist install [act](https://github.com/nektos/act):

```
```bash
cd /
curl -s https://raw.githubusercontent.com/nektos/act/master/install.sh | sudo bash
```

And test the workflow with:

```
```bash
act -W .github/workflows/industrial_ci.yaml
```

## Demo

Below you can find demos with ROSbots:
| link | description |
| - | - |
Expand Down
6 changes: 3 additions & 3 deletions rosbot/CHANGELOG.rst
rafal-gorecki marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
Changelog for package rosbot
^^^^^^^^^^^^^^^^^^^^^^^^^^^^

0.10.5 (2023-12-05)
-------------------

0.13.0 (2024-01-15)
-------------------

Expand All @@ -17,6 +14,9 @@ Changelog for package rosbot
0.11.0 (2023-12-08)
-------------------

0.10.5 (2023-12-05)
-------------------

0.10.4 (2023-12-01)
-------------------

Expand Down
13 changes: 5 additions & 8 deletions rosbot/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@
<package format="3">
<name>rosbot</name>
<version>0.13.0</version>

<description>Meta package that contains all packages of Rosbot 2 2R PRO</description>
<license>Apache License 2.0</license>

<author email="[email protected]">Jakub Delicat</author>
<maintainer email="[email protected]">Husarion</maintainer>
<maintainer email="[email protected]">Jakub Delicat</maintainer>
<maintainer email="[email protected]">Rafal Gorecki</maintainer>
<license>Apache License 2.0</license>

<url type="website">https://husarion.com/</url>
<url type="repository">https://github.com/husarion/rosbot_ros</url>
Expand All @@ -17,13 +16,11 @@
<buildtool_depend>ament_cmake</buildtool_depend>

<depend>rosbot_bringup</depend>
<depend>rosbot_description</depend>
<depend>rosbot_controller</depend>
<depend>rosbot_description</depend>
<depend>rosbot_utils</depend>

<depend condition="($HUSARION_ROS_BUILD == simulation) and ($SIMULATION_ENGINE == ignition-gazebo)">
rosbot_gazebo
</depend>
<depend condition="($HUSARION_ROS_BUILD == simulation)">rosbot_gazebo</depend>

<export>
<build_type>ament_cmake</build_type>
Expand Down
5 changes: 0 additions & 5 deletions rosbot/rosbot_simulation.repos
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
repositories:
gazebosim/gz_ros2_control:
type: git
url: https://github.com/ros-controls/gz_ros2_control
version: humble

husarion/husarion_office_gz:
type: git
url: https://github.com/husarion/husarion_office_gz
Expand Down
6 changes: 3 additions & 3 deletions rosbot_bringup/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
Changelog for package rosbot_bringup
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

0.10.5 (2023-12-05)
-------------------

0.13.0 (2024-01-15)
-------------------

Expand All @@ -17,6 +14,9 @@ Changelog for package rosbot_bringup
0.11.0 (2023-12-08)
-------------------

0.10.5 (2023-12-05)
-------------------

0.10.4 (2023-12-01)
-------------------

Expand Down
7 changes: 4 additions & 3 deletions rosbot_bringup/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
<name>rosbot_bringup</name>
<version>0.13.0</version>
<description>ROSbot 2, 2R, PRO bringup package</description>
<license>Apache License 2.0</license>

<author email="[email protected]">Jakub Delicat</author>
<maintainer email="[email protected]">Husarion</maintainer>
<maintainer email="[email protected]">Jakub Delicat</maintainer>
<maintainer email="[email protected]">Rafal Gorecki</maintainer>
<license>Apache License 2.0</license>

<url type="website">https://husarion.com/</url>
<url type="repository">https://github.com/husarion/rosbot_ros</url>
Expand All @@ -18,6 +18,7 @@
<exec_depend>rosbot_controller</exec_depend>
<exec_depend>robot_localization</exec_depend>
<exec_depend>micro_ros_agent</exec_depend>
<exec_depend>micro_ros_msgs</exec_depend>

<test_depend>python3-pytest</test_depend>
<test_depend>launch</test_depend>
Expand Down
6 changes: 3 additions & 3 deletions rosbot_controller/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
Changelog for package rosbot_controller
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

0.10.5 (2023-12-05)
-------------------

0.13.0 (2024-01-15)
-------------------

Expand All @@ -17,6 +14,9 @@ Changelog for package rosbot_controller
0.11.0 (2023-12-08)
-------------------

0.10.5 (2023-12-05)
-------------------

0.10.4 (2023-12-01)
-------------------

Expand Down
7 changes: 3 additions & 4 deletions rosbot_controller/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@
<package format="3">
<name>rosbot_controller</name>
<version>0.13.0</version>

<description>Hardware configuration for ROSbot 2, 2R, PRO</description>
<maintainer email="[email protected]">Husarion</maintainer>
<maintainer email="[email protected]">Jakub Delicat</maintainer>
<maintainer email="[email protected]">Rafal Gorecki</maintainer>
<license>Apache License 2.0</license>

<author email="[email protected]">Jakub Delicat</author>
<maintainer email="[email protected]">Husarion</maintainer>

<url type="website">https://husarion.com/</url>
<url type="repository">https://github.com/husarion/rosbot_ros</url>
<url type="bugtracker">https://github.com/husarion/rosbot_ros/issues</url>
Expand Down
6 changes: 3 additions & 3 deletions rosbot_description/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
Changelog for package rosbot_description
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

0.10.5 (2023-12-05)
-------------------

0.13.0 (2024-01-15)
-------------------

Expand All @@ -17,6 +14,9 @@ Changelog for package rosbot_description
0.11.0 (2023-12-08)
-------------------

0.10.5 (2023-12-05)
-------------------

0.10.4 (2023-12-01)
-------------------

Expand Down
8 changes: 3 additions & 5 deletions rosbot_description/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@
<package format="3">
<name>rosbot_description</name>
<version>0.13.0</version>

<description>ROSbot 2, 2R, PRO description package</description>
<maintainer email="[email protected]">Husarion</maintainer>
<maintainer email="[email protected]">Jakub Delicat</maintainer>
<maintainer email="[email protected]">Maciej Stepien</maintainer>
<license>Apache License 2.0</license>

<author email="[email protected]">Jakub Delicat</author>
<author email="[email protected]">Maciej Stepien</author>
<maintainer email="[email protected]">Husarion</maintainer>

<url type="website">https://husarion.com/</url>
<url type="repository">https://github.com/husarion/rosbot_ros</url>
<url type="bugtracker">https://github.com/husarion/rosbot_ros/issues</url>
Expand Down
6 changes: 3 additions & 3 deletions rosbot_gazebo/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
Changelog for package rosbot_gazebo
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

0.10.5 (2023-12-05)
-------------------

0.13.0 (2024-01-15)
-------------------

Expand All @@ -20,6 +17,9 @@ Changelog for package rosbot_gazebo
Test gazebo fix
* Contributors: Dominik Nowak

0.10.5 (2023-12-05)
-------------------

0.10.4 (2023-12-01)
-------------------

Expand Down
Loading
Loading