Skip to content
Library implementing the Responsibility Sensitive Safety model (RSS) for Autonomous Vehicles
C++ CMake Shell
Branch: master
Clone or download

C++ Library for Responsibility Sensitive Safety

License GitHub tag (latest SemVer) Build Status Code Coverage

Table of contents

  1. Introduction
  2. License
  3. Releases
    1. Release 1.x
  4. Getting Started
    1. Supported Systems
  5. Building the library
  6. Contributing


This library intends to provide a C++ implementation of the Responsibility Sensitive Safety model (RSS) for Autonomous Vehicles.

RSS is described in the following papers. Potential users of this C++ library are encouraged to read these papers in order to become familiar with the concepts and functions provided by the library.

The RSS module in this library receives (processed) sensor information as input and provides actuator command restrictions as output. The input to the RSS module is an object list, with information about all objects (road agents) in the surrounding environment of the ego vehicle. For each object, the RSS module creates a description of the object-ego vehicle pair and their properties, called a "situation". For each situation, the relevant RSS safety checks are performed and a proper response is calculated. Finally, one overall response is obtained by combining the responses calculated for each object-ego vehicle situation. The resulting actuation command restrictions, in the form of longitudinal and lateral limits on acceleration are provided as output.

This library contains a stand-alone C++ implementation of the RSS module.

  • Conversion of AV sensor data to the input object list required by the RSS module is outside the scope of this library. This includes conversion of object location and motion in a Cartesian world coordinate system into a situation based coordinate system.
  • Conversion of the output acceleration restrictions to real AV actuation commands (enforcing the restrictions) is outside the scope of this library. This conversion depends strongly on the software and hardware setup of the actual (or simulated)vehicle.

The scope, design and architecture of this C++ library for RSS is described in more detail in the following document packaged with this release. This documentation includes guidance on the usage of the RSS library and its integration into an autonomous driving system. Users of this library are strongly encouraged to read this documentation prior to integration of the library.

  • C++ Library for Responsibility Sensitive Safety, Intel, 2018

Usage of ad-rss-lib

If you use ad-rss-lib, please cite our IV'2019 paper:

   title={Towards Standardization of AV Safety: C++ Library for Responsibility Sensitive Safety}
   author={Gassmann, Bernd and Oboril, Fabian and Buerkle, Cornelius and Liu, Shuang and Yan, Shoumeng and Elli, Maria Soledad and Alvarez, Ignacio and Aerrabotu, Naveen and Jaber, Suhel and van Beek, Peter and Iyer, Darshan and Weast, Jack}
   booktitle={2019 IEEE Intelligent Vehicles Symposium (IV)}

Usage within CARLA

This library can be used together with the open-source driving simulator CARLA to investigate the behavior of RSS. A first version is shown in the following video sequence: RSS safety sensor in CARLA

Usage within Baidu Apollo

In addition, the library is already integrated and used in Baidu's Apollo Open Platform stack:

RSS integration in Apollo


This software library is provided under the BSD 3-clause open-source license:

In addition, the terms in the following apply: RELEASE NOTES AND DISCLAIMERS.


Visit the project's GitHub page to access the online version of the full documentation of this library. This includes:

If you have any additional question not answered therein, you might find more in:


Release 1.x.x

The initial release of the C++ software library for RSS implements a subset of the rules and calculations specified in the published RSS paper. This means that this release handles a subset of autonomous driving scenarios, described below. Scenarios other than this subset cannot be handled.

Features & Limitations

This release implements the RSS calculations and rules corresponding to the following scenarios:

  • Multi-lane roads, i.e. longitudinal and lateral safe distance and proper response determination; and
  • Intersections, i.e. two or more routes of different geometry, rules for intersections of routes, with priority/right of way, and longitudinal and lateral proper response determination. However, in the case of intersections, it is assumed that there is always a lateral conflict.

The following parts of RSS are NOT implemented in this release of the library software:

  • Unstructured roads, e.g. parking lots and wide round-abouts;
  • Pedestrians, bicyclists and other vulnerable road users;
  • Occlusions;
  • Longitudinal or lateral evasive maneuvers as defined by RSS; and
  • Intersections without a lateral conflict.

Note: The RSS module in this library does not initiate evasive manuevers. At the same time, it would not hinder an evasive manuever being executed by the AV driving policy and planning modules, as long as it is compliant with the required RSS proper response.

Getting started

Installation of dependencies

Currently, the focused operating system is Ubuntu 16.04. Nevertheless, the library should work in a similar way for any other Linux OS. To install the dependencies for Ubuntu 16.04 execute the following command:

 user$> sudo apt-get install git build-essential cmake 

If you want to use doxygen for API documentation, please also install:

 user$> sudo apt-get install doxygen graphviz

Get the library

To download the library, you may run:

 user$> git clone
 user$> cd ad-rss-lib

Supported systems

Besides Ubuntu 16.04 we are currently supporting the following Linux OS and compiler combinations:

Ubuntu 14.04 Ubuntu 16.04 Ubuntu 18.04
Clang 3.4 x
Clang 3.8/3.9 x x
Clang 5.0 x
Clang 6.0 x x
GCC 4.8 x
GCC 5.4/5.5 x
GCC 6.0 x
GCC 7.3 x x

Important: cmake is required to be at least version 3.5!

Building the library

Build instructions

The RSS library is built with a standard cmake toolchain. Simply run the following commands to build the library:

 ad_rss$> mkdir build
 ad_rss$> cd build
 build$>  cmake ..
 build$>  make

Unit tests

Run the following commands to run the unit-tests:

 build$>  make test

API documentation

Please run the following command to build the API documentation, if desired:

 build$>  cmake -DBUILD_DOC=1 ..
 build$>  make apidoc

Build hardening

Usually, build hardening is injected by the surrounding build system. Nevertheless, the CMakeLists.txt defines hardening flags to ensure the code is compatible to respective flags. To enable hardening compiler and linker flags:

 build$>  cmake -DBUILD_HARDENING=1 ..
 build$>  make

Full documentation

The full documentation is written in Asciidoc. To generate a PDF of the full documentation, it is recommended to use Asciidoctor asciidoctor-pdf. Therefore, the following commands have to be executed within Ubuntu:

ad_rss$>  sudo apt-get install asciidoctor
ad_rss$>  sudo -E gem install asciidoctor-pdf --pre
ad_rss$>  sudo -E gem install coderay
ad_rss$>  asciidoctor-pdf ./doc/Main.adoc -n


Contibutions are very welcome!

Before submitting a pull request, please ensure that your code compiles successfully and that the tests run successfully. Please also check that your code formatting complies to the provided clang style. To do so, you can run:

ad_rss$> sudo apt-get install clang-format-3.9
ad_rss$> find -iname *.cpp -o -iname *.hpp | xargs clang-format-3.9 -style=file -i

This command will automatically update the code formatting to be compliant with our style.

In addition, please perform a static code analysis, if possible.

ad_rss$> sudo apt-get install clang-tidy
ad_rss$> make clang-tidy

This may provide a list of possible improvements that you would like to consider in your pull request.

You can’t perform that action at this time.