Skip to content

Commit c9bfdf8

Browse files
authored
Merge pull request #123 from gramaziokohler/ros2
Add minimal support for ROS2
2 parents f60cf8f + cb7e634 commit c9bfdf8

27 files changed

+426
-23
lines changed

.github/workflows/build.yml renamed to .github/workflows/build-ros1.yml

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,24 +11,16 @@ on:
1111
- main
1212

1313
jobs:
14-
build-cpython:
14+
build-ros1:
1515
runs-on: ${{ matrix.os }}
1616
strategy:
1717
matrix:
1818
name: [
19-
"ubuntu-py37",
20-
"ubuntu-py38",
2119
"ubuntu-py39",
2220
"ubuntu-py310",
2321
"ubuntu-py311",
2422
]
2523
include:
26-
- name: "ubuntu-py37"
27-
os: ubuntu-latest
28-
python-version: "3.7"
29-
- name: "ubuntu-py38"
30-
os: ubuntu-latest
31-
python-version: "3.8"
3224
- name: "ubuntu-py39"
3325
os: ubuntu-latest
3426
python-version: "3.9"
@@ -53,15 +45,15 @@ jobs:
5345
python -m pip install --no-cache-dir -r requirements-dev.txt
5446
- name: Set up docker containers
5547
run: |
56-
docker build -t gramaziokohler/rosbridge:integration_tests ./docker
57-
docker run -d -p 9090:9090 --name rosbridge gramaziokohler/rosbridge:integration_tests /bin/bash -c "roslaunch /integration-tests.launch"
48+
docker build -t gramaziokohler/rosbridge:integration_tests_ros1 ./docker/ros1
49+
docker run -d -p 9090:9090 --name rosbridge gramaziokohler/rosbridge:integration_tests_ros1 /bin/bash -c "roslaunch /integration-tests.launch"
5850
docker ps -a
5951
- name: Run linter
6052
run: |
6153
invoke check
6254
- name: Run tests
6355
run: |
64-
pytest
56+
pytest tests/ros1
6557
- name: Tear down docker containers
6658
run: |
6759
docker rm -f rosbridge

.github/workflows/build-ros2.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: build
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
tags:
8+
- 'v*'
9+
pull_request:
10+
branches:
11+
- main
12+
13+
jobs:
14+
build-ros2:
15+
runs-on: ${{ matrix.os }}
16+
strategy:
17+
matrix:
18+
name: [
19+
"ubuntu-py39",
20+
"ubuntu-py310",
21+
"ubuntu-py311",
22+
]
23+
include:
24+
- name: "ubuntu-py39"
25+
os: ubuntu-latest
26+
python-version: "3.9"
27+
- name: "ubuntu-py310"
28+
os: ubuntu-latest
29+
python-version: "3.10"
30+
- name: "ubuntu-py311"
31+
os: ubuntu-latest
32+
python-version: "3.11"
33+
steps:
34+
- uses: actions/checkout@v3
35+
- name: Set up Python ${{ matrix.python-version }}
36+
uses: actions/setup-python@v4
37+
with:
38+
python-version: ${{ matrix.python-version }}
39+
- name: Install dependencies
40+
run: |
41+
python -m pip install --upgrade pip
42+
python -m pip install wheel
43+
- name: Install
44+
run: |
45+
python -m pip install --no-cache-dir -r requirements-dev.txt
46+
- name: Set up docker containers
47+
run: |
48+
docker build -t gramaziokohler/rosbridge:integration_tests_ros2 ./docker/ros2
49+
docker run -d -p 9090:9090 --name rosbridge gramaziokohler/rosbridge:integration_tests_ros2 /bin/bash -c "ros2 launch /integration-tests.launch"
50+
docker ps -a
51+
- name: Run linter
52+
run: |
53+
invoke check
54+
- name: Run tests
55+
run: |
56+
pytest tests/ros2
57+
- name: Tear down docker containers
58+
run: |
59+
docker rm -f rosbridge

AUTHORS.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ Authors
1010
* Hiroyuki Obinata `@obi-t4 <https://github.com/obi-t4>`_
1111
* Pedro Pereira `@MisterOwlPT <https://github.com/MisterOwlPT>`_
1212
* Domenic Rodriguez `@DomenicP <https://github.com/DomenicP>`_
13+
* Ilia Baranov `@iliabaranov <https://github.com/iliabaranov>`_

CHANGELOG.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ Unreleased
1212

1313
**Added**
1414

15+
* Added a ROS2-compatible header class in ``roslibpy.ros2.Header``.
16+
1517
**Changed**
1618

1719
**Fixed**

README.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ local ROS environment, allowing usage from platforms other than Linux.
4444

4545
The API of **roslibpy** is modeled to closely match that of `roslibjs`_.
4646

47+
ROS1 is fully supported. ROS2 support is still in progress.
48+
4749

4850
Main features
4951
-------------

docker/Dockerfile renamed to docker/ros1/Dockerfile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,9 @@ RUN apt-get update && apt-get install -y \
1313
# Clear apt-cache to reduce image size
1414
&& rm -rf /var/lib/apt/lists/*
1515

16-
# Copy entrypoint
17-
COPY ./ros_entrypoint.sh /
16+
# Copy launch
1817
COPY ./integration-tests.launch /
1918

2019
EXPOSE 9090
2120

22-
ENTRYPOINT ["/ros_entrypoint.sh"]
2321
CMD ["bash"]

docker/ros2/Dockerfile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
FROM ros:iron
2+
LABEL maintainer "Gonzalo Casas <[email protected]>"
3+
4+
SHELL ["/bin/bash","-c"]
5+
6+
# Install rosbridge
7+
RUN apt-get update && apt-get install -y \
8+
ros-iron-rosbridge-suite \
9+
# ros-iron-tf2-web-republisher \
10+
# ros-iron-ros-tutorials \
11+
# ros-iron-actionlib-tutorials \
12+
--no-install-recommends \
13+
# Clear apt-cache to reduce image size
14+
&& rm -rf /var/lib/apt/lists/*
15+
16+
# Copy launch
17+
COPY ./integration-tests.launch /
18+
19+
EXPOSE 9090
20+
21+
CMD ["bash"]

docker/ros2/integration-tests.launch

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<launch>
2+
<include file="$(find-pkg-share rosbridge_server)/launch/rosbridge_websocket_launch.xml" />
3+
<!-- <node pkg="tf2_web_republisher" type="tf2_web_republisher" name="tf2_web_republisher"></node> -->
4+
</launch>

docker/ros_entrypoint.sh

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)