Skip to content
Open
1 change: 1 addition & 0 deletions .github/workflows/test-ros1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,6 @@ jobs:
run: |
pytest tests/ros1
- name: Tear down docker containers
if: always()
run: |
docker rm -f rosbridge
58 changes: 58 additions & 0 deletions .github/workflows/transport-benchmark.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Transport benchmark

on:
push:
branches:
- main
tags:
- 'v*'
pull_request:
branches:
- main
workflow_dispatch:

jobs:
transport-benchmark:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Python 3.11
uses: actions/setup-python@v6
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install wheel
- name: Install
run: |
python -m pip install --no-cache-dir -r requirements-dev.txt
python -m pip install --no-cache-dir uvloop
- name: Set up docker containers
run: |
docker build -t gramaziokohler/rosbridge:integration_tests_ros1 ./docker/ros1
docker run -d -p 9090:9090 --name rosbridge gramaziokohler/rosbridge:integration_tests_ros1 /bin/bash -c "roslaunch /integration-tests.launch"
docker ps -a
- name: Run transport benchmark
continue-on-error: true
run: |
python benchmarks/transport.py \
--host 127.0.0.1 \
--port 9090 \
--cases twisted asyncio asyncio-uvloop asyncio-no-compression asyncio-uvloop-no-compression \
--service-count 300 \
--topic-count 500 \
--markdown transport-benchmark.md
cat transport-benchmark.md >> "$GITHUB_STEP_SUMMARY"
- name: Upload transport benchmark
if: always()
continue-on-error: true
uses: actions/upload-artifact@v4
with:
name: transport-benchmark
path: transport-benchmark.md
if-no-files-found: ignore
- name: Tear down docker containers
if: always()
run: |
docker rm -f rosbridge
13 changes: 13 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: 2

build:
os: ubuntu-22.04
tools:
python: "3.11"

sphinx:
configuration: docs/conf.py

python:
install:
- requirements: docs/requirements.txt
5 changes: 5 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ Unreleased

**Added**

* Added an asyncio transport backend selectable with ``ROSLIBPY_TRANSPORT``,
``set_default_transport()``, or the ``Ros(..., transport=...)`` argument.
* Added transport-parametrized ROS integration tests for CPython, while
keeping IronPython on the ``cli`` transport.

**Changed**

**Fixed**
Expand Down
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
graft docs
graft src
graft tests
graft benchmarks

prune docker

include .bumpversion.cfg
include .editorconfig
include .readthedocs.yaml

include AUTHORS.rst
include CHANGELOG.rst
Expand Down
16 changes: 16 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,29 @@ To install **roslibpy**, simply use ``pip``::

pip install roslibpy

The default WebSocket transport on CPython uses Twisted/Autobahn. An asyncio
transport is also available and can be installed with::

pip install roslibpy[asyncio]

For IronPython, the ``pip`` command is slightly different::

ipy -X:Frames -m pip install --user roslibpy

Remember that you will need a working ROS setup including the
**rosbridge server** and **TF2 web republisher** accessible within your network.

Transport selection
-------------------

CPython uses the ``twisted`` transport by default; IronPython uses ``cli``. To
select the asyncio transport, either pass it per client, set the process-wide
default, or set the environment variable::

roslibpy.Ros(host='localhost', port=9090, transport='asyncio')
roslibpy.set_default_transport('asyncio')
ROSLIBPY_TRANSPORT=asyncio python my_script.py


Documentation
-------------
Expand Down
Loading
Loading