Library / SDK
snape/RVO2 avatar
snape/RVO2

RVO2 lets many agents dodge each other without talking

Optimal Reciprocal Collision Avoidance (C++)

980 stars285 forksC++Apache-2.0

At a glance

What is it?
RVO2 is the open source C++ implementation of optimal reciprocal collision avoidance, a method where each agent takes half the responsibility for avoiding a pairwise collision without any communication. It suits robotics and simulation work in two dimensions, and it is a library rather than a full motion planning stack.
Who is it for?
Adopt RVO2 when you need many agents in a shared two dimensional workspace to move without colliding and without any communication channel between them, especially in robotics simulation or crowd behaviour work. It does not fit a project that needs three dimensional avoidance, global path planning around obstacles, or kinematic prediction of agents that move on rails.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository received new commits within the last day.
What is it written in?
Mainly C++, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on October 23, 2026, and from our analysis. They are not legal advice.

Editorial analysis

Each agent owns half of every collision it is part of

The core idea is a formal approach to reciprocal collision avoidance, where multiple independent mobile robots or agents need to avoid collisions with each other without communication among agents while moving in a common workspace. The formulation, optimal reciprocal collision avoidance or ORCA, provides sufficient conditions for collision free motion by letting each agent take half of the responsibility of avoiding pairwise collisions. That half share is the whole trick. An agent does not need to know where the others are going, because the rule it applies locally already accounts for their likely motion. The result is a decentralised system with no negotiation and no shared state. The README states that the approach was tested on several dense and complex simulation scenario workspaces involving thousands of agents, with collision free actions computed for all of them in only a few milliseconds.

The action comes from solving a low dimensional linear program

Choosing what an agent should do next is not a heuristic in this formulation. Selecting the optimal action for each agent is reduced to solving a low dimensional linear program, and the authors prove that the resulting motions are smooth. Smoothness is the property that separates this from many steering behaviours, which tend to produce visible jitter when agents correct course. A linear program at this size is cheap to solve, which is what makes thousands of agents feasible in a few milliseconds. The library computes velocity choices per agent per simulation step, and the caller keeps integrating those velocities into positions. That division of labour is what makes the library usable from a game, a robotics simulator, or a crowd visualisation without changing the avoidance logic.

You supply obstacles, agents, and preferred velocities

The API is described as simple for third party applications. The user specifies static obstacles, agents, and the preferred velocities of the agents. Nothing else is assumed about your scene. The simulation is performed step by step via a simple call to the library, and the simulation is fully accessible and manipulable during runtime, which means you can add an agent, change a preferred velocity, or move an obstacle in the middle of a run rather than only at setup. That runtime mutability is the feature that separates RVO2 from a precomputed planner. It suits games and interactive simulations, where the world changes under the agents. What you do not get is path planning. The library answers the question of what velocity to take now, given where you want to go and what is nearby.

OpenMP parallelises the simulation across processors

The library exploits multiple processors if they are available using OpenMP for efficient parallelization of the simulation. That is a specific and useful claim to know about, because the step by step structure of the API maps well onto an OpenMP parallel loop over agents. Each agent's local computation reads the neighbourhood, and the work divides cleanly across cores when agent counts reach the thousands. The practical advice is that the benefit appears at scale. A scene with a handful of agents will not notice the difference, and a build without OpenMP support behaves identically apart from running on one core. The repository also carries a Dockerfile and a compose.yaml for a container based build environment, so a team that wants to pin its toolchain can do so without installing a compiler stack on every machine.

Building it with CMake, Bazel, or Meson, or inside the container

The README does not give a one line install command, and it points to the project page at gamma.cs.unc.edu/RVO2 as well as the Zenodo record for the library. The repository itself carries the build configuration for three systems: a CMakeLists.txt with CMakePresets.json and an RVOConfig.cmake.in, a BUILD.bazel and MODULE.bazel with a Bazel version file, and a meson.build with meson.options. The container path is defined in the Dockerfile and the compose service, where the build context is the repository root and the source is mounted into the workspace:

yaml
services:
  dev:
    build:
      context: .
      dockerfile: Dockerfile
    volumes:
      - .:/workspace:cached

The container image is based on ubuntu:26.04 and carries OCI labels naming the authors, the licence, and the upstream project URL. There is also a package.xml for ROS packaging, an RVO.pc.in for pkg-config, and a set of example programs in the examples directory.

The example sources show the three scene shapes it targets

The examples directory is the fastest way to understand the intended use, and the file names describe three distinct scenarios. Circle.cc is the classic case, a group of agents arranged around a circle, where the visual result of the avoidance rule is easy to check by eye. Blocks.cc covers rectangular obstacles, so the static obstacle handling has a visible result. Roadmap.cc is the one to look at if your scene is a corridor or a lane, since narrow passages are where reciprocal avoidance rules get stressed. All three are C++ files with their own CMakeLists.txt and meson.build, so they are built by the same systems as the library. Read them before writing your own loop, because the ordering of steps, where you call the simulation update relative to integrating positions and drawing, is the part of the API that is easy to get subtly wrong.

The code is Apache-2.0, but the README documentation is CC-BY-SA-4.0

The licence story has two layers and it is worth separating them. The project is distributed under Apache-2.0, and the code files carry SPDX headers reading SPDX-License-Identifier: Apache-2.0 with copyright 2008 University of North Carolina at Chapel Hill. The README file itself, however, opens with an SPDX header for Creative Commons Attribution-ShareAlike 4.0 International, and it includes the full CC-BY-SA text. Practically, that means the source code can be used, modified, and redistributed under permissive Apache terms including in commercial products, while reusing the README prose as documentation carries attribution and share alike conditions. The repository has a LICENSES directory and a QUALITY_DECLARATION.md, and it uses the REUSE specification, with license files for the metadata files such as the Zenodo and Bazel version files, so the project is careful about this distinction rather than accidental about it.

Old releases, current pushes, and a modernised build

The version history is lopsided and the repository layout explains why. The tagged releases are v2.0.1 from 2013 and v2.0.2 from 2016, and there are no GitHub releases since, while the last push to the repository was on 2026-10-10. Between those two dates the project has clearly been modernised rather than versioned: the tree now holds a Bazel setup, a Meson setup, CMake presets, a devcontainer, a compose file, a Dockerfile, Renovate configuration, a pre-commit configuration, clang-format and clang-tidy settings, cpplint configuration, and a CI workflow. The source also remains C++98, which the README states as a feature of the implementation, meaning it still compiles on older toolchains. The labelling in the Dockerfile names the image version 2.0.3, so the version in the container does not correspond to a tagged release on the project page.

Editorial conclusion

Adopt RVO2 when you need many agents in a shared two dimensional workspace to move without colliding and without any communication channel between them, especially in robotics simulation or crowd behaviour work. It does not fit a project that needs three dimensional avoidance, global path planning around obstacles, or kinematic prediction of agents that move on rails. Before you commit, confirm your toolchain can build a C++98 library, read the example sources in the examples directory for Blocks, Circle, and Roadmap to see how you wire agents and obstacles into a simulation loop, and check the licence files in the LICENSES directory, because the README documentation and the code are under different licences.

Frequently asked questions

What problem does RVO2 solve?

RVO2 implements optimal reciprocal collision avoidance, so multiple independent agents in a common workspace can avoid collisions with each other without any communication between them. Each agent takes half the responsibility for avoiding a pairwise collision.

Does RVO2 handle path planning and obstacles?

The library lets you specify static obstacles, agents, and the preferred velocities of the agents, and it computes the next velocity for each. Path planning is not part of the described API.

Which build systems does the RVO2 repository support?

The repository includes CMakeLists.txt with CMake presets, BUILD.bazel and MODULE.bazel for Bazel, and meson.build for Meson, plus a Dockerfile and a compose.yaml for a container build environment.

What licence applies to RVO2?

The code is licensed under Apache-2.0 with copyright held by the University of North Carolina at Chapel Hill. The README documentation itself carries a Creative Commons Attribution-ShareAlike 4.0 header, and the repository includes a LICENSES directory.

Official sources

  1. License: Apache-2.0
  2. Project website
  3. README
  4. Releases
  5. snape/RVO2 on GitHub
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/snape-rvo2.svg)](https://hysenlabs.com/projects/snape-rvo2)

Was this useful?