Skip to content

Commit

Permalink
Various smaller fixes for ROS Kinetic
Browse files Browse the repository at this point in the history
- Updated Dockerfiles, fix Rviz crash by adding dedicated GPU docker image, remove indigo as distro is outdated
- Fix build warnings in laser_features and rwth_ground_plane
- Use find_package(Eigen3) instead of find_package(Eigen)
- Reduce logging level at nodelet startup to remove logging clutter
- Bugfix for #78, blocked aggregator nodelets due to detector stall. Fix by monitoring if any message are actually received on detections topic, before advertising publisher.
- Add missing install targets for spencer_leg_detector_wrapper (fix for #64)
- Configurable odom and base footprint frame IDs (fixes #53)
- Updated README
  • Loading branch information
tlind committed Aug 22, 2020
1 parent bb16ce3 commit 1176546
Show file tree
Hide file tree
Showing 33 changed files with 247 additions and 101 deletions.
13 changes: 6 additions & 7 deletions .docker/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,16 @@ help:
@echo "-- Help Menu"
@echo ""
@echo " 1. make build - build images"
# @echo " 1. make build_gpu - build gpu image"
@echo " 1. make build_gpu - build gpu image"
# @echo " 1. make pull - pull all images"
# @echo " 1. make clean - remove all images"
@echo ""

build:
cd .. && \
docker build --tag=spencer/spencer_people_tracking:indigo --file=.docker/indigo/Dockerfile . && \
docker build --tag=spencer/spencer_people_tracking:kinetic --file=.docker/kinetic/Dockerfile .
docker build --tag=spencer/spencer_people_tracking:kinetic --file=.docker/kinetic/Dockerfile

build_gpu:
cd .. && \
docker build --tag=spencer/spencer_people_tracking_gpu:kinetic-gpu --file=.docker/kinetic-gpu/Dockerfile .

# build_gpu:
# cd .. && \
# docker build --tag=spencer/spencer_people_tracking_gpu:indigo --file=.docker/indigo/Dockerfile_gpu . && \
# docker build --tag=spencer/spencer_people_tracking_gpu:kinetic --file=.docker/kinetic/Dockerfile_gpu .
30 changes: 0 additions & 30 deletions .docker/indigo/Dockerfile

This file was deleted.

48 changes: 48 additions & 0 deletions .docker/kinetic-gpu/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# GPU support (only works if nvidia-container-toolkit is installed on the docker host)!
FROM nvidia/cudagl:10.1-runtime-ubuntu16.04
RUN apt-get update && apt-get install -y lsb-release && rm -rf /var/lib/apt/lists/*
ENV NVIDIA_VISIBLE_DEVICES ${NVIDIA_VISIBLE_DEVICES:-all}
ENV NVIDIA_DRIVER_CAPABILITIES ${NVIDIA_DRIVER_CAPABILITIES:+$NVIDIA_DRIVER_CAPABILITIES,}graphics

# Following block originates from https://github.com/osrf/docker_images/blob/master/ros/kinetic/ubuntu/xenial/ros-core/Dockerfile
# and http://wiki.ros.org/kinetic/Installation/Ubuntu
# Copyright 2020 Open Source Robotics Foundation (CC-BY 3.0 license)
RUN echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list
RUN apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
RUN apt-get update && apt-get install -y --no-install-recommends ros-kinetic-perception && rm -rf /var/lib/apt/lists/*
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8
ENV ROS_DISTRO kinetic

# Install build tools
RUN apt-get update && apt-get install -y \
python-catkin-tools tmux vim \
&& rm -rf /var/lib/apt/lists/*

# Setup workspace
ENV CATKIN_WS=/root/catkin_ws
RUN mkdir -p $CATKIN_WS/src
WORKDIR $CATKIN_WS/src

# Acquire source
#RUN git clone https://github.com/spencer-project/spencer_people_tracking.git
COPY . spencer_people_tracking/

# Install dependencies
RUN apt-get update && \
apt-get install -y \
wget && \
rosdep init && \
rosdep update && \
rosdep install -y -r --from-paths . --ignore-src --rosdistro ${ROS_DISTRO} --as-root=apt:false && \
rm -rf /var/lib/apt/lists/*

# Build repo
WORKDIR $CATKIN_WS
ENV TERM xterm
ENV PYTHONIOENCODING UTF-8
RUN catkin config --extend /opt/ros/$ROS_DISTRO && \
catkin build -c -s

# Initialize bashrc
RUN echo "source ~/catkin_ws/devel/setup.bash" >> /root/.bashrc
12 changes: 8 additions & 4 deletions .docker/kinetic/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# ROS base image without GPU support
FROM ros:kinetic-perception

# Install build tools
RUN apt-get update && apt-get install -y \
python-catkin-tools \
python-catkin-tools tmux vim \
&& rm -rf /var/lib/apt/lists/*

# Setup workspace
Expand All @@ -11,8 +12,8 @@ RUN mkdir -p $CATKIN_WS/src
WORKDIR $CATKIN_WS/src

# Acquire source
RUN git clone https://github.com/spencer-project/spencer_people_tracking.git
# COPY . spencer_people_tracking/
#RUN git clone https://github.com/spencer-project/spencer_people_tracking.git
COPY . spencer_people_tracking/

# Install dependencies
RUN apt-get update && \
Expand All @@ -27,4 +28,7 @@ WORKDIR $CATKIN_WS
ENV TERM xterm
ENV PYTHONIOENCODING UTF-8
RUN catkin config --extend /opt/ros/$ROS_DISTRO && \
catkin build
catkin build -c -s

# Initialize bashrc
RUN echo "source ~/catkin_ws/devel/setup.bash" >> /root/.bashrc
30 changes: 30 additions & 0 deletions .docker/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash

# Command-line arguments:
# $1 - name of docker image variant (e.g. indigo, kinetic, kinetic-gpu, noetic)

# Following lines are based upon code from the ROS wiki
# See http://wiki.ros.org/docker/Tutorials/Hardware%20Acceleration#nvidia-docker2
# Copyright 2020 Open Source Robotics Foundation (CC-BY 3.0 license)
XAUTH=/tmp/.docker.xauth
if [ ! -f $XAUTH ]
then
xauth_list=$(xauth nlist :0 | sed -e 's/^..../ffff/')
if [ ! -z "$xauth_list" ]
then
echo $xauth_list | xauth -f $XAUTH nmerge -
else
touch $XAUTH
fi
chmod a+r $XAUTH
fi

docker run -it \
--env="DISPLAY=$DISPLAY" \
--env="QT_X11_NO_MITSHM=1" \
--volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" \
--env="XAUTHORITY=$XAUTH" \
--volume="$XAUTH:$XAUTH" \
--runtime=nvidia \
spencer/spencer_people_tracking:$1 \
tmux
6 changes: 5 additions & 1 deletion AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,17 @@ The framework was initially created and is being maintained by:
Stefan Breuers

For the authors of the individual ROS packages, please check the respective README or package.xml files.
We are also very thankful to the following additional contributors:
We are also very thankful to the following additional contributors (the ones prefixed by @ are Github user names):

Lucas Beyer
Christian Dondrup
Fabian Girrbach
João Avelino
Kota Weaver
Marc Hanheide
Manuel Fernandez-Carmona
@rpg711
@Sangheli
@dandedrick

...and anybody who we, by accident, forgot to mention here!
45 changes: 30 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
- **Extensible and reusable:** Well-structured ROS message types and clearly defined interfaces make it easy to integrate custom detection and tracking components.
- **Powerful visualization:** A series of reusable RViz plugins that can be configured via mouse click, plus scripts for generating animated (2D) SVG files.
- **Evaluation tools:** Metrics (CLEAR-MOT, OSPA) for evaluation of tracking performance.
- **ROS integration:** All components are fully integrated with ROS and written in C++ or Python. ROS Indigo and Kinetic are supported, Noetic is work in progress.
- **ROS integration:** All components are fully integrated with ROS and written in C++ or Python. ROS Kinetic, Melodic and Noetic are supported.

#### Motivation

Expand Down Expand Up @@ -132,37 +132,42 @@ With this configuration, the components run in real-time at 20-25 Hz (with visua

#### Installation from L-CAS package repository

A packaged version of the entire framework for *ROS Kinetic* on *Ubuntu 16.04 (Xenial)* is kindly provided by the Lincoln Research Centre for Autonomous Systems (L-CAS) and built by their continuous integration system. You must first add their package repository to your apt/sources.list [as described here](https://github.com/LCAS/rosdistro/wiki#using-the-l-cas-repository-if-you-just-want-to-use-our-software). Then, install the framework via
A packaged version of the entire framework for *ROS Kinetic (Ubuntu 16.04 Xenial)* and *ROS Melodic (Ubuntu 18.04 Bionic)* is kindly provided by the Lincoln Research Centre for Autonomous Systems (L-CAS) and built by their continuous integration system. You must first add their package repository to your apt/sources.list [as described here](https://github.com/LCAS/rosdistro/wiki#using-the-l-cas-repository-if-you-just-want-to-use-our-software). Then, install the framework via

sudo apt-get install ros-kinetic-spencer-people-tracking-full
sudo apt-get install ros-${ROS_DISTRO}-spencer-people-tracking-full

Note that the `groundHOG` detector in the packaged version is non-functional.

#### Installation from source
#### Building from source

The people and group detection and tracking framework has been tested on Ubuntu 14.04 / ROS Indigo and Ubuntu 16.04 / ROS Kinetic. For more information on the Robot Operating System (ROS), please refer to [ros.org](http://www.ros.org/).
In this paragraph, we describe how to build the framework from source code. This is useful, for example, if you want to conduct larger changes in the supplied launch files. You can either follow this step-by-step guide, or use one of the [exemplary Docker files](/.docker) to automate these steps and isolate the build process from your existing ROS installation.

The people and group detection and tracking framework has been tested on Ubuntu 16.04 (ROS Kinetic), Ubuntu 18.04 (ROS Melodic) and Ubuntu 20.04 (ROS Noetic). For more information on the Robot Operating System (ROS), please refer to [ros.org](http://www.ros.org/).

*NOTE: The entire framework only works on 64-bit systems. On 32-bit systems, you will encounter Eigen-related alignment issues (failed assertions). See issue [#1](https://github.com/spencer-project/spencer_people_tracking/issues/1)*

##### 1. Cloning the source code repository

As we currently do not yet provide any pre-built Debian packages, you have to build our framework from source code. As a first step, create a folder for a new catkin workspace and clone the GitHub repository into the `src` subfolder:
First create an empty folder for a new catkin workspace and clone the GitHub repository into the `src` subfolder:

cd ~/Code
mkdir -p spencer-people-tracking-ws/src
cd spencer-people-tracking-ws/src
git clone https://github.com/spencer-project/spencer_people_tracking.git
git checkout $ROS_DISTRO

where in the last step, `$ROS_DISTRO$` should refer to one of the available git branches specific to the particular ROS distribution (`kinetic`, `melodic` or `noetic`).

##### 2. Installing required dependencies

Assuming you have ROS Indigo or ROS Kinetic already installed, we recommend installing the required depencencies of our framework via:
Assuming you have ROS itself already installed, we recommend installing the required depencencies of our framework via:

rosdep update
rosdep install -r --from-paths . --ignore-src

##### 3. Initializing the catkin workspace

Next, we suggest to use `catkin` (available via `sudo apt-get install python-catkin-tools`) to setup the workspace:
Next, we suggest to use `catkin` (available via `sudo apt-get install python-catkin-tools` or `python3-catkin-tools` in ROS Noetic) to setup the workspace:

cd ..
catkin config --init --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo
Expand All @@ -180,9 +185,9 @@ After building the workspace, source it via:
source devel/setup.bash


##### Special note on CUDA SDK for the groundHOG detector
##### Special note on CUDA SDK for the groundHOG far-range detector

The cudaHOG library used by `rwth_ground_hog` requires an nVidia graphics card and an installed CUDA SDK (recommended version: 6.5). As installing CUDA (especially on laptops with Optimus/Bumblebee) and compiling the library is not straightforward, detailled installation instructions are provided [here](/detection/monocular_detectors/3rd_party). Once these instructions have been followed, the `rwth_ground_hog` package needs to be rebuilt using catkin. If no CUDA SDK is installed, the ROS package will still compile, but it will not provide any functionality.
The cudaHOG library used by `rwth_ground_hog` requires an nVidia graphics card and an installed CUDA SDK (recommended version: 6.5). As installing CUDA (especially on laptops with Optimus/Bumblebee) and compiling the library is not straightforward, detailled installation instructions are provided [here](/detection/monocular_detectors/3rd_party). Once these instructions have been followed, the `rwth_ground_hog` package needs to be rebuilt using catkin. If no CUDA SDK is installed, the ROS package will still compile, but it will not provide any functionality. As this detector is slightly outdated, we recommend to ignore this unless really needed. We hope to incorporate a more recent far-range person detector based upon a modern deep learning framework in the future.

#### Quick start tutorial

Expand All @@ -198,7 +203,7 @@ Then, you can launch

roslaunch spencer_people_tracking_launch tracking_on_bagfile.launch

which will start playing back a bagfile (as soon as you unpause by pressing `SPACE`) and run Rviz for visualization.
which will start playing back a bagfile (as soon as you unpause by pressing `SPACE`) and run Rviz for visualization. If everything went well, you should see detections from the upper-body detector, the 2D laser detector, and resulting person tracks.

###### Using the PCL people detector instead of the upper-body detector ######

Expand Down Expand Up @@ -267,12 +272,12 @@ Note that the fusion pipeline reconfigures automatically if only a subset of the
The multi-modal "Motion Capture" sequence from our ICRA 2016 paper is available upon request to let you evaluate your own detection / tracking algorithms on our dataset. For a fair comparison, please use the CLEAR-MOT metrics implementation contained in this repository, if possible. The raw data from the airport sequence cannot be shared for privacy reasons, though we might provide the extracted detections at a later point.


#### Credits, license & how to cite
#### Credits & How to cite

The software in this repository is maintained by:

- [Timm Linder](http://www.timmlinder.com), Social Robotics Lab, Albert-Ludwigs-Universität Freiburg
- [Stefan Breuers](http://www.vision.rwth-aachen.de/people/stefan-breuers), Computer Vision Group, RWTH Aachen University
- [Timm Linder](http://www.timmlinder.com), formerly at the Social Robotics Lab, Albert-Ludwigs-Universität Freiburg
- [Stefan Breuers](http://www.vision.rwth-aachen.de/people/stefan-breuers), formerly at the Computer Vision Group, RWTH Aachen University

Credits of the different ROS packages go to the particular authors listed in the respective `README.md` and `package.xml` files. See also the `AUTHORS.md` file for a list of further contributors.

Expand All @@ -291,7 +296,17 @@ also optionally:
> Robot Operating System (ROS): The Complete Reference (Vol. 1).
> Springer Studies in Systems, Decision and Control, 2016
Most of the software in this repository is released under a BSD license. For details, however, please check the individual ROS packages.
The framework is further described in the PhD thesis:

> Multi-Modal Human Detection, Tracking and Analysis for Robots in Crowded Environments
> Linder, T.
> PhD thesis, Technical Faculty, University of Freiburg, 2020
#### License & disclaimer

This software is a research prototype. It is not ready for production use. However, the license conditions of the applicable Open Source licenses allow you to adapt the software to your needs. Before using it in a safety relevant setting, make sure that the software fulfills your requirements and adjust it according to any applicable safety standards (e.g. ISO 26262).

Most of the ROS packages in this repository are released under a BSD license. For details, however, please check the individual ROS packages (`package.xml` or `LICENSE` file) as there are some exceptions.


#### References
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,13 @@ cmake_minimum_required(VERSION 2.8.3)
project(spencer_leg_detector_wrapper)

find_package(catkin REQUIRED COMPONENTS)

install(DIRECTORY launch/
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch
PATTERN ".svn" EXCLUDE
)

install(DIRECTORY configs/
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/configs
PATTERN ".svn" EXCLUDE
)
4 changes: 2 additions & 2 deletions detection/rgbd_detectors/pcl_people_detector/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ find_package(OpenCV 2 REQUIRED)
message(STATUS "Using OpenCV version ${OpenCV_VERSION} installed at: ${OpenCV_INCLUDE_DIRS}")
message(STATUS "OpenCV supported compute capabilities are: ${OpenCV_COMPUTE_CAPABILITIES}")

find_package(Eigen REQUIRED)
find_package(Eigen3 REQUIRED)
find_package(PCL REQUIRED)

catkin_package()

include_directories(include src ${catkin_INCLUDE_DIRS} ${Eigen_INCLUDE_DIRS} ${PCL_INCLUDE_DIRS} ${OpenCV_INCLUDE_DIRS})
include_directories(include src ${catkin_INCLUDE_DIRS} ${Eigen3_INCLUDE_DIRS} ${PCL_INCLUDE_DIRS} ${OpenCV_INCLUDE_DIRS})


add_executable(detect_people src/detect_people.cpp)
Expand Down
4 changes: 2 additions & 2 deletions detection/spencer_detected_person_association/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ project(spencer_detected_person_association)
find_package(catkin REQUIRED COMPONENTS rospy roscpp message_filters spencer_tracking_msgs std_msgs message_generation nodelet eigen_conversions tf_conversions cmake_modules)


FIND_PACKAGE(Eigen REQUIRED)
include_directories(${Eigen_INCLUDE_DIRS} ${catkin_INCLUDE_DIRS})
FIND_PACKAGE(Eigen3 REQUIRED)
include_directories(${Eigen3_INCLUDE_DIRS} ${catkin_INCLUDE_DIRS})

add_service_files(
FILES
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<launch>
<arg name="rgbd" default="true"/>
<arg name="common_frame_id" default="base_footprint"/>

<!-- Nodelet manager for all detected person association-related nodelets -->
<group ns="/spencer/perception_internal/detected_person_association">
Expand All @@ -10,16 +11,25 @@
<!-- That also allows to spread the association load across two laptops -->

<!-- Aggregate laser detections -->
<include file="$(find spencer_detected_person_association)/launch/aggregate_lasers.launch"/>
<include file="$(find spencer_detected_person_association)/launch/aggregate_lasers.launch">
<arg name="common_frame_id" value="$(arg common_frame_id)"/>
</include>

<!-- Aggregate high-recall laser detectors -->
<include file="$(find spencer_detected_person_association)/launch/aggregate_high_recall_lasers.launch"/>
<include file="$(find spencer_detected_person_association)/launch/aggregate_high_recall_lasers.launch">
<arg name="common_frame_id" value="$(arg common_frame_id)"/>
</include>


<!-- Aggregate RGB-D detections (optional) -->
<group if="$(arg rgbd)">
<include file="$(find spencer_detected_person_association)/launch/aggregate_rgbd_upper_body.launch"/>
<include file="$(find spencer_detected_person_association)/launch/aggregate_rgbd_ground_hog.launch"/>
<include file="$(find spencer_detected_person_association)/launch/aggregate_rgbd_upper_body.launch">
<arg name="common_frame_id" value="$(arg common_frame_id)"/>
</include>

<include file="$(find spencer_detected_person_association)/launch/aggregate_rgbd_ground_hog.launch">
<arg name="common_frame_id" value="$(arg common_frame_id)"/>
</include>
</group>


Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
<launch>
<!-- Launch file arguments -->
<arg name="rgbd" default="false"/>
<arg name="common_frame_id" default="base_footprint"/>

<!-- Aggregate detections from all detectors -->
<include file="$(find spencer_detected_person_association)/launch/aggregate_all.launch">
<arg name="rgbd" value="$(arg rgbd)"/>
<arg name="common_frame_id" value="$(arg common_frame_id)"/>
</include>

<!-- If RGB-D is enabled, fuse lasers and RGB-D -->
Expand Down
Loading

0 comments on commit 1176546

Please sign in to comment.