Skip to content

catec/ouster_ros

Repository files navigation

ouster_ros

Build Status License

This package is a simpler ROS client implementation for the Ouster lidar sensors with firmware version >=1.14.0. It includes new functionalities that cannot be found in the original ouster_example (see Motivation)

Table of Contents

Motivation / Features

The motivation for creating this package is:

  • Unify the example libraries provided by Ouster in one place, making it easier to compile
  • Avoid the overhead given in the official Ouster example
  • Possibility to disable IMU message processing in case of non-use, freeing up CPU
  • Possibility to inverse TF publication between /os_sensor and /os_lidar
  • Code-level check of the synchronization of published messages when setting up PTP

If you are ok without these functionalities, feel free to use the original ouster_example from Ouster.

Requirements

  • Tested with ROS Melodic on Ubuntu 18.04, but it may work with ROS Kinetic on Ubuntu 16.04 (untested) with some extra packages:
    • ros-melodic-pcl-ros
    • ros-melodic-tf2-geometry-msgs
  • Ouster sensor, firmware [>= 1.14.0]. Tested with OS0-128 and OS1-64, but any other with the proper firmware should work

Instructions

Building

Just clone in your ROS workspace and do catkin_make -DCMAKE_BUILD_TYPE=Release

PTP Configuration

  1. sudo apt install linuxptp chrony ethtool
  2. Make sure the ethernet interface supports PTP with sudo ethtool -T YOUR_INTERFACE
  3. Modify /etc/linuxptp/ptp4l.conf with:
    • clockClass 128
    • boundary_clock_jbod 1
    • [YOUR_INTERFACE] <- append this to the end of the file
  4. Create folder sudo mkdir -p /etc/systemd/system/ptp4l.service.d
  5. Create file /etc/systemd/system/ptp4l.service.d/override.conf with:
    [Service]
    ExecStart=
    ExecStart=/usr/sbin/ptp4l -f /etc/linuxptp/ptp4l.conf
    
  6. Create folder: sudo mkdir -p /etc/systemd/system/phc2sys.service.d
  7. Create file /etc/systemd/system/phc2sys.service.d/override.conf with:
    [Service]
    ExecStart=
    ExecStart=/usr/sbin/phc2sys -w -s CLOCK_REALTIME -c YOUR_INTERFACE
    
  8. Modify /etc/systemd/system/phc2shm.service:
    [Unit]
    Description=Synchronize PTP hardware clock (PHC) to NTP SHM
    Documentation=man:phc2sys
    After=ntpdate.service
    Requires=ptp4l.service
    After=ptp4l.service
    [Service]
    Type=simple
    ExecStart=/usr/sbin/phc2sys -s YOUR_INTERFACE -E ntpshm -w 
    [Install]
    WantedBy=multi-user.target
    

NOTE: Change YOUR_INTERFACE to the ethernet interface used (ex: eno1)

Usage

  1. Start PTP services with rosrun ouster_ros lidar_ptp.sh
  2. In case lidar is in DHCP mode: sudo dnsmasq -C /dev/null -kd -F MIN_IP,MAX_IP -i YOUR_INTERFACE --bind-dynamic (ex: MIN_IP=10.5.0.1, MAX_IP=10.5.0.255, YOUR_INTERFACE=eno1)
  3. roslaunch ouster_ros ouster.launch

Launch files

  • ouster.launch:

    Arguments:

    • sensor_hostname (string) - Lidar IP or ID (ex: 10.5.0.10)
    • udp_dest (string) - Local PC IP (ex: 10.5.0.1)
    • lidar_port (int) - Port to which the sensor should send lidar data (default 7502)
    • imu_port (int) - Port to which the sensor should send imu data (default 7503). If 0, IMU is disabled.
    • lidar_mode (string) - Lidar resolution and rate [512x10, 512x20, 1024x10, 1024x20, 2048x10]
    • timestamp_mode (string) - Method used to timestamp measurements [TIME_FROM_INTERNAL_OSC, TIME_FROM_SYNC_PULSE_IN, TIME_FROM_PTP_1588]
    • tf_prefix (string) - Namespace for tf transform (default = "")
    • tf_inverse (bool) - Inverse tf os_sensor <-> os_lidar.
    • stamp_offset (float) - Seconds to be added to the stamp header before publishing it
    • max_sync_diff (float) - Max admissible delay in the stamp header
    • enable_img_node (bool) - Whether or not enable the image node
    • metadata (string) - Path to metadata file for image node

Nodes

License

See License

This code is distributed with the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of merchantability or fitness for a particular purpose.

All the credits go to the Ouster team and their original repo ouster_example for establishing the basis of this project.

Help / Contribution

  • Contact: Rafael Caballero ([email protected])

    FADA CATEC

  • Found a bug? Create an ISSUE!

  • Do you want to contribute? Create a PULL-REQUEST!

About

An improved and simplier ROS node for Ouster sensors

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published