Skip to content

Commit

Permalink
Technical/finish up package (#1)
Browse files Browse the repository at this point in the history
* Readme update

* Workflow added

* Demo created

* gitignore added

* workflow fix

* Added time synchro

* Removed unnecessary events from workflow

* Removed unnecessary time synchro container

* Update Dockerfile and demo

* Update docker containers

* small fixes

* containers configuration update

* fix typo

Co-authored-by: Pawel Kowalski <[email protected]>
  • Loading branch information
pawelirh and pkowalsk1 authored Oct 12, 2022
1 parent 1f72dcc commit 17703d0
Show file tree
Hide file tree
Showing 10 changed files with 314 additions and 62 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/build-docker-image.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Build/Publish Docker Image

on:
push:
branches:
- "main"

jobs:
build:
runs-on: ubuntu-20.04

steps:
- name: Checkout
uses: actions/checkout@v1
with:
ref: ${{ github.event.inputs.branch }}

- name: Set up QEMU
uses: docker/setup-qemu-action@v1

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
with:
version: latest

- name: Login to Docker Registry
uses: docker/login-action@v1
with:
registry: docker.io
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push base tag
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
platforms: linux/arm64, linux/amd64
push: true
tags: husarion/ouster:melodic
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/.vscode
51 changes: 23 additions & 28 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,29 @@ FROM ros:${ROS_DISTRO}-ros-core

SHELL ["/bin/bash", "-c"]

ENV DEBIAN_FRONTEND=noninteractive \
BUILD_HOME=/ros_ws \
OUSTER_SDK_PATH=/opt/ouster_example

# Kinetic and melodic have python3 packages but they seem to conflict
RUN [ $ROS_DISTRO = "noetic" ] && PY=python3 || PY=python && \
# Turn off installing extra packages globally to slim down rosdep install
echo 'APT::Install-Recommends "0";' > /etc/apt/apt.conf.d/01norecommend && \
apt-get update && apt-get install -y \
git \
build-essential cmake \
fakeroot dpkg-dev debhelper \
$PY-rosdep $PY-rospkg $PY-bloom \
linuxptp \
ros-melodic-tf && \
git clone https://github.com/ouster-lidar/ouster_example.git ${OUSTER_SDK_PATH}

RUN apt-get update && \
rosdep init && \
rosdep update --rosdistro=${ROS_DISTRO} && \
rosdep install -y --from-paths ${OUSTER_SDK_PATH}

WORKDIR ${BUILD_HOME}

RUN mkdir src && \
ln -s ${OUSTER_SDK_PATH} ./src

RUN /opt/ros/${ROS_DISTRO}/env.sh catkin_make -DCMAKE_BUILD_TYPE=Release
RUN apt-get update && apt-get install -y \
build-essential \
cmake \
curl \
debhelper \
dpkg-dev \
fakeroot \
python-bloom \
python-rosdep \
python-rospkg

WORKDIR /ros_ws

RUN git clone --recurse-submodules https://github.com/ouster-lidar/ouster-ros.git src/ouster-ros

# RUN apt-get update && \
RUN rosdep init && \
rosdep update --rosdistro=$ROS_DISTRO && \
rosdep install --from-paths src --ignore-src -y && \
source /opt/ros/$ROS_DISTRO/setup.bash && \
catkin_make -DCATKIN_ENABLE_TESTING=0 -DCMAKE_BUILD_TYPE=Release && \
apt clean && \
rm -rf /var/lib/apt/lists/*

COPY ./ros_entrypoint.sh /

Expand Down
50 changes: 49 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,50 @@
# ouster-docker
Building docker images for Ouster LIDARs

Dockerized Ouster LiDAR package from [ouster-lidar/ouster-ros](https://github.com/ouster-lidar/ouster-ros) repository.

## Time synchronizing

Before launching the Ouster ROS driver, the Precision Time Protocol (PTP) should be configured on the host computer.

```bash
sudo ptp4l -i eno1 -m [global] tx_timestamp_timeout 10
```

## Running a Docker container

```bash
docker run --rm -it \
husarion/ouster:melodic \
roslaunch ouster_ros sensor.launch \
timestamp_mode:=TIME_FROM_PTP_1588 \
metadata:=/ouster_metadata.json \
sensor_hostname:=10.15.20.5 \
lidar_mode:=1024x20
```

## ROS node

For more information about the Ouster ROS package itself, please refer to [README.md](https://github.com/ouster-lidar/ouster-ros#readme)

## Demo

### Ouster LiDAR container + rviz container

Connect Ouster LiDAR to the first computer and run:

```bash
git clone https://github.com/husarion/ouster-docker.git
cd ouster-docker/demo

source ./config/setup_virtual_desktop.sh

docker compose \
-f compose.ouster.yaml \
-f compose.rviz.yaml \
-f compose.vnc.yaml \
up
```

On the second computer connected to the same LAN with a connected display open `http://localhost:8080/vnc_auto.html` in the web browser


33 changes: 0 additions & 33 deletions compose.ouster.yaml

This file was deleted.

17 changes: 17 additions & 0 deletions demo/compose.ouster.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
services:

ouster-lidar:
image: husarion/ouster:melodic
container_name: ouster-ros
restart: on-failure
network_mode: host
environment:
- ROS_IP=10.15.20.3
- ROS_MASTER_URI=http://10.15.20.2:11311
command: >
roslaunch ouster_ros sensor.launch
timestamp_mode:=TIME_FROM_PTP_1588
metadata:=/ouster_metadata.json
viz:=false
sensor_hostname:=10.15.20.5
lidar_mode:=1024x20
16 changes: 16 additions & 0 deletions demo/compose.rviz.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
services:

rviz:
image: husarion/rviz:noetic
container_name: rviz
restart: on-failure
network_mode: host
ipc: host
volumes:
- /tmp/.X11-unix:/tmp/.X11-unix:rw
- ./config/default.rviz:/root/.rviz/default.rviz
environment:
- DISPLAY
- LIBGL_ALWAYS_SOFTWARE=1
- ROS_IP=10.15.20.3
- ROS_MASTER_URI=http://10.15.20.2:11311
14 changes: 14 additions & 0 deletions demo/compose.vnc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
services:

remote-desktop:
image: donowak/remote-desktop:lan
container_name: vnc-remote-desktop
restart: on-failure
volumes:
- /tmp/.X11-unix:/tmp/.X11-unix:rw
ipc: host
ports:
- 8080:8080
environment:
- VNC_PASSWORD=husarion
- DISPLAY
146 changes: 146 additions & 0 deletions demo/config/default.rviz
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
Panels:
- Class: rviz/Displays
Help Height: 0
Name: Displays
Property Tree Widget:
Expanded: ~
Splitter Ratio: 0.49561402201652527
Tree Height: 1004
- Class: rviz/Selection
Name: Selection
- Class: rviz/Tool Properties
Expanded:
- /2D Pose Estimate1
- /2D Nav Goal1
- /Publish Point1
Name: Tool Properties
Splitter Ratio: 0.5886790156364441
- Class: rviz/Views
Expanded:
- /Current View1
Name: Views
Splitter Ratio: 0.5
- Class: rviz/Time
Experimental: false
Name: Time
SyncMode: 0
SyncSource: PointCloud2
Preferences:
PromptSaveOnExit: true
Toolbars:
toolButtonStyle: 2
Visualization Manager:
Class: ""
Displays:
- Alpha: 0.5
Cell Size: 1
Class: rviz/Grid
Color: 160; 160; 164
Enabled: true
Line Style:
Line Width: 0.029999999329447746
Value: Lines
Name: Grid
Normal Cell Count: 0
Offset:
X: 0
Y: 0
Z: 0
Plane: XY
Plane Cell Count: 10
Reference Frame: <Fixed Frame>
Value: true
- Alpha: 1
Autocompute Intensity Bounds: true
Autocompute Value Bounds:
Max Value: 10
Min Value: -10
Value: true
Axis: Z
Channel Name: intensity
Class: rviz/PointCloud2
Color: 255; 255; 255
Color Transformer: Intensity
Decay Time: 0
Enabled: true
Invert Rainbow: false
Max Color: 255; 255; 255
Min Color: 0; 0; 0
Name: PointCloud2
Position Transformer: XYZ
Queue Size: 10
Selectable: true
Size (Pixels): 3
Size (m): 0.009999999776482582
Style: Flat Squares
Topic: /ouster/points
Unreliable: false
Use Fixed Frame: true
Use rainbow: true
Value: true
Enabled: true
Global Options:
Background Color: 48; 48; 48
Default Light: true
Fixed Frame: os_sensor
Frame Rate: 30
Name: root
Tools:
- Class: rviz/Interact
Hide Inactive Objects: true
- Class: rviz/MoveCamera
- Class: rviz/Select
- Class: rviz/FocusCamera
- Class: rviz/Measure
- Class: rviz/SetInitialPose
Theta std deviation: 0.2617993950843811
Topic: /initialpose
X std deviation: 0.5
Y std deviation: 0.5
- Class: rviz/SetGoal
Topic: /move_base_simple/goal
- Class: rviz/PublishPoint
Single click: true
Topic: /clicked_point
Value: true
Views:
Current:
Class: rviz/Orbit
Distance: 11.139487266540527
Enable Stereo Rendering:
Stereo Eye Separation: 0.05999999865889549
Stereo Focal Distance: 1
Swap Stereo Eyes: false
Value: false
Field of View: 0.7853981852531433
Focal Point:
X: -0.24446001648902893
Y: 1.0967316627502441
Z: -1.2604460716247559
Focal Shape Fixed Size: true
Focal Shape Size: 0.05000000074505806
Invert Z Axis: false
Name: Current View
Near Clip Distance: 0.009999999776482582
Pitch: 0.800398051738739
Target Frame: <Fixed Frame>
Yaw: 0.8753982186317444
Saved: ~
Window Geometry:
Displays:
collapsed: false
Height: 1149
Hide Left Dock: false
Hide Right Dock: false
QMainWindow State: 000000ff00000000fd00000004000000000000015600000427fc020000000bfb0000001200530065006c0065006300740069006f006e00000001e10000009b0000005c00fffffffb0000001e0054006f006f006c002000500072006f007000650072007400690065007302000001ed000001df00000185000000a3fb000000120056006900650077007300200054006f006f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f0070006500720074006900650073003203000002880000011d000002210000017afb000000100044006900730070006c006100790073010000003b00000427000000c700fffffffb0000002000730065006c0065006300740069006f006e00200062007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261fb000000280020002d0020005400720061006a006500630074006f0072007900200053006c00690064006500720000000000ffffffff0000000000000000fb0000001c004d006f00740069006f006e0050006c0061006e006e0069006e0067000000003b000002f80000000000000000fb00000044004d006f00740069006f006e0050006c0061006e006e0069006e00670020002d0020005400720061006a006500630074006f0072007900200053006c0069006400650072000000003b000002f80000000000000000000000010000010f000002f8fc0200000003fb0000001e0054006f006f006c002000500072006f00700065007200740069006500730100000041000000780000000000000000fb0000000a00560069006500770073000000003b000002f8000000a000fffffffb0000001200530065006c0065006300740069006f006e010000025a000000b200000000000000000000000200000490000000a9fc0100000001fb0000000a00560069006500770073030000004e00000080000002e100000197000000030000061e0000003efc0100000002fb0000000800540069006d006500000000000000061e0000042700fffffffb0000000800540069006d00650100000000000004500000000000000000000006100000042700000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000
Selection:
collapsed: false
Time:
collapsed: false
Tool Properties:
collapsed: false
Views:
collapsed: false
Width: 1900
X: 0
Y: 27
8 changes: 8 additions & 0 deletions demo/config/setup_virtual_desktop.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#! /bin/bash

# init virtual desktop
vncserver

# make desktop accessible
export DISPLAY=:1
xhost local:root

0 comments on commit 17703d0

Please sign in to comment.