[Application][WIP] Open-source simulator for autonomous driving research.
GPL-3.0 License
Note: this repo is given 'as it' since I'm currently have no time to work on it. There are lot of things to do before having a complete simulator.
Fig 1 - A parallel automatic maneuver. Click on the image to run the video.
This simulator has not the pretention to revolutionize the world of the vehicle simulation but is just a personal challenge for offering an intuitive API for autonomous driving research.
When I tried Carla simulator, I did not like the following points:
carla.Actor: defines actors as anything that plays a role in the simulation or can be moved around. That includes: pedestrians, vehicles, sensors and traffic signs ...
but when reading other Actor methods we reach close_door()
... We can interrogate if this API has been really thought.In my opinion, a simulator has to help the developper by offering the possibility to interact with all objects in the word. For example the simulator has to reply to question such as "give me the list of pedestrians around the car" ... a reference list that can be compared at run time with the list of pedestrians detected by your IA/sensors/ECU of your ego vehicle. This idea can be extended to any mobile/static object in the city: pedestrian, cars, roads, traffic signs, zebras, parking slot, spawning points ... all of them shall interact with the ego vehicle and share their states (ie traffic light: the color of the light, the content of any road signs ie "Nationale 20" ...).
Ideally, the API shall distinguish helper methods to twick the simulation from real physical behavior by explicit methods for example apply a constant velocity along its longitudinal side.
Here a list of things a simulator can help and that I did not find in Carla:
This code depends on:
sudo apt-get install libsfml-dev
.sudo apt-get install swi-prolog
. Prolog is a logic programming language associated with artificial intelligence and computational linguistics. Currently it is not used.To compile and install the standalone application:
git clone [email protected]:Lecrapouille/Highway.git --recursive --depth=1
make download-external-libs
make compile-external-libs
Once you can compile the project.
make -j8
If you prefer instead to choose a different compiler, i.e:
make CXX=clang++-13 -j8
Scenario files are automatically compiled. You have to do nothing. Here what is made (hidden):
for i in `ls Scenarios` do
(cd $i
make clean
make -j8)
end
cp Scenarios/*/build/*.so data/Scenarios/
The compiled simulation files are in Scenarios/xxx/build/xxx.so
but then are copied
into the data/Scenarios folder to be loaded by the application. There are pure shared libraries that
can be opened by with dlopen()
function.
To run the standalone application.
./build/Highway
To run the standalone application and running a given scenario (shared library). This will skip some IHM menu and jump directly into the simulation.
Highway scenario.so
To install the application and scenarios on your operating system:
sudo make install
To run the standalone application installed on your system:
Highway
To clean the project:
make clean
This will remove the buid/ folder. To deep clean (third parts, docs ...) type make veryclean
.
The index of detail design documents: doc/README.md.
The code source refers in comments to mathematic formulas from the documents
cited inside bibliography sections on each folders. Formulas are pictures. For
Emacs users, when diving inside the code source, you can type M-x turn-on-iimage-mode
to show pictures inside C++ comments. This will help you to understand the code bind
to mathematic formulas of these documents.
To generate Doxygen documentation.
make doc
The generated documentation can be find in doc/html
.
To make unit tests and generate code coverage.
make check -j8
Or
cd tests
make coverage -j8
If you do not want generating reports.
cd tests
make -j8
./build/Highway-Tests
To create a tar.gz (for a backup) of the project with management of name conflict concerning the tarball name. Compiled files, generated doc, git files and backup files are not stored in the tarball.
make tarball