Skip to content

V2X simulator for connected and automated vehicle environment simulation by UMich NGMS lab

Notifications You must be signed in to change notification settings

next-generation-mobility-systems-lab/v2xsim

Repository files navigation

User Manual: V2X Simulator for Connected and Automated Vehicle Environment Simulation

Ethan Zhang, Neda Masoud

Next Generation Mobility System Lab, University of Michigan, Ann Arbor, MI, USA

System setup

Ubuntu 18.04 (Bionic Beaver)

Gazebo 9.8.0

CMake 3.10.2

Robot Operating System (optional)

Installation

The simulator runs on top of Gazebo engine. The proposed simulator is developed under the Ubuntu OS, for future integration with Robot Operating System (ROS) when necessary, which always runs on top of linux kernal. The simulator adopt Ubuntu 18.04 (Bionic Beaver). Instructions to install and use Ubuntu 18.04 can be found at the Ubuntu releases--18.04.4 LTS.

Check out the Gazebo to install Gazebo with version 9 and above. After installing Gazebo, install and setup Gazebo developer library libgazebo9-dev.

CMake is used to compile the C++ script and build pulgins. Visit CMake installation to build, install and setup CMake for the Ubuntu System.

(optional) Visit ROS installation to install and setup your ROS if necessary.

Clone this repo into your working folder.

Run the simulator

Run with default setting

Properly set the system environment. In the terminal, before calling Gazebo, make sure to set the path to your current Gazebo build directory:

export GAZEBO_PLUGIN_PATH=${GAZEBO_PLUGIN_PATH}:~/your_working_directory/v2x/build

In your working directory, compile the plugins, then call and run the V2X simulator from the terminal:

cd build

cmake ..

make

gazebo ../v2x.world --verbose

Then the simulator window should prompt and starts simulation. It uses Gazebo as backend simulation engine. Terminate the simulation using control + c. Once terminated, under the build directory you can find Basic Safety Messages (BSMs) collected by the virtual road side unit (RSU) in .txt format.

Customization

Users can add, delete, or update models provided in the v2x.world file. And control models by adding, deleting, or updating plugins or APIs correspondingly.

Customization with Plugins

In the source file, plugin scripts (e.g., veh_plugin.cc) can be found at the working directory. Users can directly modify plugin code to customize the plugins provided in this repo, so as to control vehicles in a different way. To test an algorithm, customizing plugins is more recommended, because algorithm details can be implemented under Gazebo namespace. When customizing the plugin, the CMakeLists.txt should be updated accordingly with following CMake rules. To make the plugin be executable, users should use CMake to compile and link the Gazebo plugin to the model built the Gazebo engine. If you are not using CMake 3.10.2, you should make sure your existing CMake support the C++11 standard. Once built by CMake, you can find the executable plugin under build directory. The compiled plugin files will have names in lib*.so format, for example, libveh_plugin.so. In order to link compiled plugins to models when the simulator is running, add them to your .world file and link it to the corresponding model in XML format.

Plugins provided in this repo are developed to provide a demonstration of the intelligent driver model(IDM) demonstration.

Customization with APIs

In the source file, customized APIs are provided. For example, vel.cc is an API that can directly send out commands to vehicle models which are running in simulator. To execute the API, go to the build directory and call the API from the terminal like calling normal executable file ./vel When customizing API, the CMakeLists.txt should be updated accordingly by following CMake rules.

Demo

Please check out the Demo video for detail regarding the performance of the simulator (click to play on Youtube: http://www.youtube.com/watch?v=zYFRgLpN8L8).

About

V2X simulator for connected and automated vehicle environment simulation by UMich NGMS lab

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published