Skip to content

Commit

Permalink
Update README about ROS2 and the new multicast feature + carry over s…
Browse files Browse the repository at this point in the history
…ome of the code improvements from ROS2 branch (#52)

* remove defaulting to C++14 standard and address an issue causing the parsed json file lose non legacy fields.
* remove duplicate strategy item from the jobs
* Update change log and rename project title in the readme
* update copyright dates
* Remove wrongly identified dep tf2-geometry-msgs
* Address potential vulnerability when saving metadata to file
* Populate readme with more details about (ros2 & multicast) + code refactor
* Remove unrequired using statement + formatting
* Add status badges to the readme and fix typo
* Bump up package number
* Be specific about the platform we are building against currently
  • Loading branch information
Samahu authored Feb 22, 2023
1 parent 927f216 commit e18781c
Show file tree
Hide file tree
Showing 15 changed files with 308 additions and 164 deletions.
33 changes: 18 additions & 15 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,29 @@
name: Docker Image CI
name: ouster-ros

on:
push:
branches: [ "master" ]
branches:
- master
pull_request:
branches: [ "master" ]
branches:
- master

jobs:

build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ros_distro: [melodic, noetic]

ros_distro:
- melodic
- noetic
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Build the Docker image
run: |
docker build . \
--build-arg ROS_DISTRO=${{ matrix.ros_distro }} \
--file Dockerfile \
--tag ouster-ros-${{ matrix.ros_distro }}:$(date +%s)
- uses: actions/checkout@v3
with:
submodules: true
- name: Build the Docker image
run: |
docker build . \
--build-arg ROS_DISTRO=${{ matrix.ros_distro }} \
--file Dockerfile \
--tag ouster-ros-${{ matrix.ros_distro }}:$(date +%s)
20 changes: 20 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,26 @@
Changelog
=========

[unreleased]
============

ouster_ros(1)
-------------
* EOL notice: ouster-ros driver will drop support for ``ROS melodic`` by May 2023.
* bugfix: Address an issue causing the driver to warn about missing non-legacy fields even they exist
in the original metadata file.
* added a new launch file ``sensor_mtp.launch`` for multicast use case (experimental).

ouster_ros(2)
-------------
* MVP ouster-ros targeting ros2 distros (beta release)
* introduced a ``reset`` service to the ``os_sensor`` node

ouster_client
-------------
* added a new method ``mtp_init_client`` to init the client with multicast support (experimental).


[20230114]
==========

Expand Down
2 changes: 0 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ find_package(
nodelet)

# ==== Options ====
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
add_compile_options(-Wall -Wextra)
option(CMAKE_POSITION_INDEPENDENT_CODE "Build position independent code." ON)

Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Upstream-Contact: Ouster Sensor SDK Developers <[email protected]>
Source: https://github.com/ouster-lidar/ouster_example

Files: *
Copyright: 2018-2022 Ouster, Inc
Copyright: 2018-2023 Ouster, Inc
License: BSD-3-Clause

Files: include/optional-lite/*
Expand Down
126 changes: 109 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,35 @@
# Official ROS driver for Ouster sensors

[Requirements](#requirements) | [Getting Started](#getting-started) | [Usage](#usage) | [License](#license)
# Official ROS1/ROS2 drivers for Ouster sensors

[ROS1 (melodic/noetic)](https://github.com/ouster-lidar/ouster-ros/tree/master) |
[ROS2 (rolling/humble)](https://github.com/ouster-lidar/ouster-ros/tree/ros2) |
[ROS2 (foxy)](https://github.com/ouster-lidar/ouster-ros/tree/ros2)

<p style="float: right;"><img width="20%" src="docs/images/logo.png" /></p>

| ROS Version | Build Status (Linux) |
|:-----------:|:------:|
| ROS1 (melodic/noetic) | [![melodic/noetic](https://github.com/ouster-lidar/ouster-ros/actions/workflows/docker-image.yml/badge.svg?branch=master)](https://github.com/ouster-lidar/ouster-ros/actions/workflows/docker-image.yml)
| ROS2 (rolling/humble) | [![rolling/humble](https://github.com/ouster-lidar/ouster-ros/actions/workflows/docker-image.yml/badge.svg?branch=ros2)](https://github.com/ouster-lidar/ouster-ros/actions/workflows/docker-image.yml)
| ROS2 (foxy) | [![foxy](https://github.com/ouster-lidar/ouster-ros/actions/workflows/docker-image.yml/badge.svg?branch=ros2-foxy)](https://github.com/ouster-lidar/ouster-ros/actions/workflows/docker-image.yml)

- [Overview](#overview)
- [Requirements](#requirements)
- [Getting Started](#getting-started)
- [Usage](#usage)
- [Launching Nodes](#launching-nodes)
- [Sensor Mode](#sensor-mode)
- [Replay Mode](#replay-mode)
- [Recording Mode](#recording-mode)
- [Multicast Mode (experimental)](#multicast-mode-experimental)
- [Invoking Services](#invoking-services)
- [GetMetadata](#getmetadata)
- [GetConfig](#getconfig)
- [SetConfig (experimental)](#setconfig-experimental)
- [License](#license)


## Overview

This ROS package provide support for all Ouster sensors with FW v2.0 or later. Upon launch the driver
will configure and connect to the selected sensor device, once connected the driver will handle
incoming IMU and lidar packets, decode lidar frames and publish corresponding ROS messages on the
Expand All @@ -13,27 +38,34 @@ configured to use this capability, then another topic will published named `/ous
corresponds to the second point cloud.

## Requirements
This driver only supports Melodic and Noetic ROS distros.
This package only supports **Melodic** and **Noetic** ROS distros. Please refer to ROS online
documentation on how to setup ros on your machine before proceeding with the remainder of this guide.

In addition to the base ROS installation, the following ROS packages are required:
```bash
sudo apt install -y \
ros-$ROS_DISTRO-pcl-ros \
ros-$ROS_DISTRO-rviz \
ros-$ROS_DISTRO-tf2-geometry-msgs
ros-$ROS_DISTRO-rviz
```

where `$ROS-DISTRO` is either ``melodic`` or ``noetic``.

> **Note**
> Installing `ros-$ROS_DISTRO-rviz` package is optional in case you didn't need to visualize the
> point cloud using rviz but remember to always set `viz` launch arg to `false`.

Additional dependenices:
```bash
sudo apt install -y \
build-essential \
libeigen3-dev \
libjsoncpp-dev \
libspdlog-dev \
sudo apt install -y \
build-essential \
libeigen3-dev \
libjsoncpp-dev \
libspdlog-dev \
libcurl4-openssl-dev \
cmake
```
> **Note**
> You may choose a different ssl backend for the curl library such as `libcurl4-gnutls-dev` or `libcurl4-nss-dev`
## Getting Started
To build the driver using ROS you need to clone the project into the `src` folder of a catkin workspace
Expand All @@ -58,31 +90,91 @@ Specifying `Release` as the build type is important to have a reasonable perform


## Usage
The package supports three modes of interaction, you can connect to a live senosr, replay a recorded bag or record a new
bag file using the corresponding launch files. The commands are listed below
### Launching Nodes
The package supports three modes of interaction, you can connect to a _live senosr_, _replay_ a
recorded bag or _record_ a new bag file using the corresponding launch files. Recently, we have
added a new mode that supports multicast. The commands are listed below:

### Sensor Mode
#### Sensor Mode
```bash
roslaunch ouster_ros sensor.launch \
sensor_hostname:=<sensor host name> \
metadata:=<json file name> # metadata is optional
```

### Replay Mode
#### Replay Mode
```bash
roslaunch ouster_ros replay.launch \
metadata:=<json file name> \
bag_file:=<path to rosbag file>
```

### Recording Mode
#### Recording Mode
```bash
roslaunch ouster_ros record.launch \
sensor_hostname:=<sensor host name> \
metadata:=<json file name> \
bag_file:=<optional bag file name>
```

#### Multicast Mode (experimental)
The multicast launch mode supports configuring the sensor to broadcast lidar packets from the same
sensor (live) to multiple active clients. You initiate this mode by using `sensor_mtp.launch` file
to start the node. You will need to specify a valid multicast group for the **udp_dest** argument
which the sensor is going to broadcast data to it. You will also need to set **mtp_main** argument
to **true**, this is need to configure the sensor with the specified **udp_dest** and any other
sensor settings. You can control on which ip (IP4 only) you wish to receive the data on this machine
from the multicast group using the **mtp_dest** argument
follows:
```bash
roslaunch ouster_ros sensor_mtp.launch \
sensor_hostname:=<sensor host name> \
udp_dest:=<multicast group ip (ipv4)> \
mtp_main:=true \
mtp_dest:=<client ip to receive data> # mtp_dest is optional
```
Using a different machine that belongs to the same netwok subnet, you can start another instance of
the client to start receiving sensor messages through the multicast group as shown below (note that
**mtp_main** is set to **false**):
```bash
roslaunch ouster_ros sensor_mtp.launch \
sensor_hostname:=<sensor host name> \
udp_dest:=<multicast group ip (ipv4)> \
mtp_main:=false \
mtp_dest:=<client ip to receive data> # mtp_dest is optional
```

> **Note:**
> In both cases the **mtp_dest** is optional and if left unset the client will utilize the first
available interface.

### Invoking Services
To execute any of the following service, first you need to open a new terminal
and source the castkin workspace again by running the command:
`source catkin_ws/devel/setup.bash`
#### GetMetadata
To get metadata while connected to a live sensor or during a replay session invoke
the following command:
```bash
rosservice call /ouster/get_metadata
```

#### GetConfig
To get the current config of a live sensor, invoke the command:
```bash
rosservice call /ouster/get_config
```

#### SetConfig (experimental)
To change config via a file while connected to a live sensor, invoke the command:
```bash
rosservice call /ouster/set_config "config_file: '<path to sensor config>'"
```

> **Note**
> Changing settings is not yet fully support during a reset operation (more on this)

For further detailed instructions refer to the [main guide](./docs/index.rst)


Expand Down
2 changes: 1 addition & 1 deletion include/ouster_ros/os_client_base_nodelet.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2018-2022, Ouster, Inc.
* Copyright (c) 2018-2023, Ouster, Inc.
* All rights reserved.
*
* @file os_client_base_nodelet.h
Expand Down
2 changes: 1 addition & 1 deletion include/ouster_ros/os_point.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2018-2022, Ouster, Inc.
* Copyright (c) 2018-2023, Ouster, Inc.
* All rights reserved.
*
* @file point.h
Expand Down
2 changes: 1 addition & 1 deletion include/ouster_ros/os_ros.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2018-2022, Ouster, Inc.
* Copyright (c) 2018-2023, Ouster, Inc.
* All rights reserved.
*
* @file os_ros.h
Expand Down
2 changes: 1 addition & 1 deletion package.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<package format="3">
<name>ouster_ros</name>
<version>0.7.3</version>
<version>0.7.4</version>
<description>Ouster ROS driver</description>
<maintainer email="[email protected]">ouster developers</maintainer>
<license file="LICENSE">BSD</license>
Expand Down
15 changes: 10 additions & 5 deletions src/os_client_base_nodelet.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2018-2022, Ouster, Inc.
* Copyright (c) 2018-2023, Ouster, Inc.
* All rights reserved.
*
* @file os_client_base_nodelet.cpp
Expand All @@ -9,6 +9,7 @@
#include "ouster_ros/os_client_base_nodelet.h"

#include <ouster/impl/build.h>

#include "ouster_ros/GetMetadata.h"

namespace sensor = ouster::sensor;
Expand All @@ -30,10 +31,14 @@ void OusterClientBase::onInit() {
}

void OusterClientBase::display_lidar_info(const sensor::sensor_info& info) {
NODELET_INFO("Client version: %s", ouster::SDK_VERSION_FULL);
NODELET_INFO("Using lidar_mode: %s", sensor::to_string(info.mode).c_str());
NODELET_INFO("%s sn: %s firmware rev: %s", info.prod_line.c_str(),
info.sn.c_str(), info.fw_rev.c_str());
auto lidar_profile = info.format.udp_profile_lidar;
NODELET_INFO_STREAM(
"ouster client version: "
<< ouster::SDK_VERSION_FULL << "\n"
<< "product: " << info.prod_line << ", sn: " << info.sn
<< ", firmware rev: " << info.fw_rev << "\n"
<< "lidar mode: " << sensor::to_string(info.mode) << ", "
<< "lidar udp profile: " << sensor::to_string(lidar_profile));
}

} // namespace nodelets_os
Loading

0 comments on commit e18781c

Please sign in to comment.