Skip to content

Commit

Permalink
Add CI for checking markdown format. (#221)
Browse files Browse the repository at this point in the history
Signed-off-by: ChenYing Kuo <[email protected]>
  • Loading branch information
evshary authored Dec 18, 2024
1 parent 1ef1551 commit d421bc1
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 28 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,15 @@ jobs:
env:
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse

markdown_lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: DavidAnson/markdownlint-cli2-action@v18
with:
config: '.markdownlint.yaml'
globs: '**/README.md'

# NOTE: In GitHub repository settings, the "Require status checks to pass
# before merging" branch protection rule ensures that commits are only merged
# from branches where specific status checks have passed. These checks are
Expand All @@ -99,7 +108,7 @@ jobs:
ci:
name: CI status checks
runs-on: ubuntu-latest
needs: [check, test]
needs: [check, test, markdown_lint]
if: always()
steps:
- name: Check whether all jobs pass
Expand Down
6 changes: 6 additions & 0 deletions .markdownlint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"MD013": false, # Line length limitation
"MD033": false, # Enable Inline HTML
"MD041": false, # Allow first line heading
"MD045": false, # Allow Images have no alternate text
}
65 changes: 38 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,25 @@
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)

# Eclipse Zenoh

The Eclipse Zenoh: Zero Overhead Pub/sub, Store/Query and Compute.

Zenoh (pronounce _/zeno/_) unifies data in motion, data at rest and computations. It carefully blends traditional pub/sub with geo-distributed storages, queries and computations, while retaining a level of time and space efficiency that is well beyond any of the mainstream stacks.

Check the website [zenoh.io](http://zenoh.io) and the [roadmap](https://github.com/eclipse-zenoh/roadmap) for more detailed information.

-------------------------------

# ROS1 to Zenoh Bridge plugin

:point_right: **Install latest release:** see [below](#How-to-install-it)
:point_right: **Install latest release:** see [below](#how-to-install-it)

:point_right: **Docker image:** see [below](#Docker-image)
:point_right: **Docker image:** see [below](#docker-image)

:point_right: **Build "main" branch:** see [below](#How-to-build-it)
:point_right: **Build "main" branch:** see [below](#how-to-build-it)

## Background

ROS1 is a well-known mature platform for building robotic systems. Despite the fact that next generation of ROS - ROS2 is released long time ago, many developers still prefer using ROS1. In order to integrate ROS1 systems to Zenoh infrastructure, [as it was done for DDS/ROS2](https://github.com/eclipse-zenoh/zenoh-plugin-dds), ROS1 to Zenoh Bridge was designed.

## How to install it
Expand All @@ -34,15 +37,17 @@ To install the latest release of either the ROS1 plugin for the Zenoh router, ei
### Manual installation (all platforms)

All release packages can be downloaded from:
- https://download.eclipse.org/zenoh/zenoh-plugin-ros1/latest/

Each subdirectory has the name of the Rust target. See the platforms each target corresponds to on https://doc.rust-lang.org/stable/rustc/platform-support.html
- [https://download.eclipse.org/zenoh/zenoh-plugin-ros1/latest/](https://download.eclipse.org/zenoh/zenoh-plugin-ros1/latest/)

Each subdirectory has the name of the Rust target. See the platforms each target corresponds to on [https://doc.rust-lang.org/stable/rustc/platform-support.html](https://doc.rust-lang.org/stable/rustc/platform-support.html)

Choose your platform and download:
- the `zenoh-plugin-ros1-<version>-<platform>.zip` file for the plugin.
Then unzip it in the same directory than `zenohd` or to any directory where it can find the plugin library (e.g. /usr/lib)
- the `zenoh-bridge-ros1-<version>-<platform>.zip` file for the standalone executable.
Then unzip it where you want, and run the extracted `zenoh-bridge-ros1` binary.

- the `zenoh-plugin-ros1-<version>-<platform>.zip` file for the plugin.
Then unzip it in the same directory than `zenohd` or to any directory where it can find the plugin library (e.g. /usr/lib)
- the `zenoh-bridge-ros1-<version>-<platform>.zip` file for the standalone executable.
Then unzip it where you want, and run the extracted `zenoh-bridge-ros1` binary.

### Linux Debian

Expand All @@ -52,63 +57,68 @@ Add Eclipse Zenoh private repository to the sources list:
echo "deb [trusted=yes] https://download.eclipse.org/zenoh/debian-repo/ /" | sudo tee -a /etc/apt/sources.list > /dev/null
sudo apt update
```

Then either:
- install the plugin with: `sudo apt install zenoh-plugin-ros1`.
- install the standalone executable with: `sudo apt install zenoh-bridge-ros1`.

- install the plugin with: `sudo apt install zenoh-plugin-ros1`.
- install the standalone executable with: `sudo apt install zenoh-bridge-ros1`.

## How to build it

> :warning: **WARNING** :warning: : Zenoh and its ecosystem are under active development. When you build from git, make sure you also build from git any other Zenoh repository you plan to use (e.g. binding, plugin, backend, etc.). It may happen that some changes in git are not compatible with the most recent packaged Zenoh release (e.g. deb, docker, pip). We put particular effort in mantaining compatibility between the various git repositories in the Zenoh project.
>
> :warning: **WARNING** :warning: : As Rust doesn't have a stable ABI, the plugins should be
built with the exact same Rust version than `zenohd`, and using for `zenoh` dependency the same version (or commit number) than 'zenohd'.
Otherwise, incompatibilities in memory mapping of shared types between `zenohd` and the library can lead to a `"SIGSEV"` crash.

>
> :warning: **WARNING** :warning: : We failed to build the plugin's tests on the system with 2(1)GB of RAM(swap) as ld ran out of memory, please pay attention to this fact!
In order to build the ROS1 to Zenoh Bridge, you need first to install the following dependencies:

- [Rust](https://www.rust-lang.org/tools/install). If you already have the Rust toolchain installed, make sure it is up-to-date with:

```bash
$ rustup update
rustup update
```

- On Linux, make sure the `llvm` and `clang` development packages are installed:
- on Debians do: `sudo apt install llvm-dev libclang-dev`
- on CentOS or RHEL do: `sudo yum install llvm-devel clang-devel`
- on Alpine do: `apk install llvm11-dev clang-dev`
- on Debians do: `sudo apt install llvm-dev libclang-dev`
- on CentOS or RHEL do: `sudo yum install llvm-devel clang-devel`
- on Alpine do: `apk install llvm11-dev clang-dev`

Once these dependencies are in place, you may clone the repository on your machine:

```bash
$ git clone https://github.com/eclipse-zenoh/zenoh-plugin-ros1.git
$ cd zenoh-plugin-ros1
$ cargo build --release
git clone https://github.com/eclipse-zenoh/zenoh-plugin-ros1.git
cd zenoh-plugin-ros1
cargo build --release
```

The standalone executable binary `zenoh-bridge-ros1` and a plugin shared library (`*.so` on Linux, `*.dylib` on Mac OS, `*.dll` on Windows) to be dynamically
The standalone executable binary `zenoh-bridge-ros1` and a plugin shared library (`*.so` on Linux, `*.dylib` on Mac OS, `*.dll` on Windows) to be dynamically
loaded by the zenoh router `zenohd` will be generated in the `target/release` subdirectory.


## Docker image

The **`zenoh-bridge-ros1`** standalone executable is also available as a [Docker images](https://hub.docker.com/r/eclipse/zenoh-bridge-ros1/tags?page=1&ordering=last_updated) for both amd64 and arm64. To get it, do:
- `docker pull eclipse/zenoh-bridge-ros1:latest` for the latest release
- `docker pull eclipse/zenoh-bridge-ros1:main` for the main branch version (nightly build)

- `docker pull eclipse/zenoh-bridge-ros1:latest` for the latest release
- `docker pull eclipse/zenoh-bridge-ros1:main` for the main branch version (nightly build)

Usage: **`docker run --init --net host eclipse/zenoh-bridge-ros1`**
It supports the same command line arguments than the `zenoh-bridge-ros1` (see below or check with `-h` argument).

## A quick test with built-in examples

If you want to run examples or tests, you need to install ROS1:

```bash
$ sudo apt install -y ros-base
sudo apt install -y ros-base
```

There is a set of example utilities illustarating bridge in operation.
Here is a description on how to configure the following schema:
```

```raw
_____________________________ ________________________________
| | | |
| rosmaster_1 | | rosmaster_2 |
Expand All @@ -135,9 +145,10 @@ Once completed, you will see the following exchange between ROS1 publisher and s
<img src="ros_pubsub.png">

## Implementation

Currently, ROS1 to Zenoh Bridge is based on [rosrust library fork](https://github.com/ZettaScaleLabs/rosrust). Some limitations are applied due to rosrust's implementation details, and we are re-engineering rosrust to overcome this

## Limitations

- all topic names are bridged as-is
- there is a performance impact coming from rosrust

0 comments on commit d421bc1

Please sign in to comment.