Installation
The simulation has been developed and primarily used on Ubuntu 20.04. Other Linux distributions were not tested. Additionally, ROS Installation must be installed.
Prerequisites
kitcar-python-utils: If not installed already, follow the steps described in GitLab before proceeding.
Clone
The first step is of course to clone the repository. These are some ways to get it:
KITcar internal. Clone this repository in the same directory as kitcar-ros.
git clone git@git.kitcar-team.de:kitcar/kitcar-gazebo-simulation.git $KITCAR_REPO_PATH/kitcar-gazebo-simulation
$KITCAR_REPO_PATH
The environment variable $KITCAR_REPO_PATH must contain the directory in which you’ve cloned kitcar-gazebo-simulation.
Make sure that $KITCAR_REPO_PATH is set to the directory where you’ve cloned kitcar-gazebo-simulation into:
cd $KITCAR_REPO_PATH/kitcar-gazebo-simulation
should put you into the root directory of kitcar-gazebo-simulation.
If it doesn’t work, create the variable with:
export KITCAR_REPO_PATH=<DIRECTORY WHERE kitcar-gazebo-simulation IS>
Adding
export KITCAR_REPO_PATH=<DIRECTORY WHERE kitcar-gazebo-simulation IS>
to your .bashrc ensures that the path is always set.
Python
Ensure that your Python-Version is 3.8 or larger:
python3 -V
If not, upgrade your system to Python 3.8. (KITcar internal: Goto KITcar-Gazebo-Simulation Python )
ROS
ROS must also be installed on your machine. If it’s not yet installed, follow the installation guide.
Init-Script
To install required packages run the init script. The packages are installed for the current user. Change into kitcar-gazebo-simulation folder and run the script:
cd $KITCAR_REPO_PATH/kitcar-gazebo-simulation
./init/init.sh
(Ubuntu 18.04: Ignore any error thrown by pip when trying to install pygobject, it seems to be irrelevant.)
If you want to, you can also install packages that are used to run machine learning tasks or compile the documentation. But these packages are not needed to run all basic components of the simulation.
Build
Then build kitcar-gazebo-repository by calling catkin_make in the simulation folder of this repository.
Git Lfs
Images and other binary files used within Gazebo are tracked using Git LFS, to download them locally, you need to pull them:
git lfs pull
For installing our fonts on your system you need to run:
sudo mkdir -p /usr/local/share/fonts/kitcar/
sudo cp -a "$KITCAR_REPO_PATH/kitcar-gazebo-simulation/simulation/models/fonts/." /usr/local/share/fonts/kitcar/
Data Version Control (DVC)
Datasets, machine learning models and similar are stored within a DVC container. DVC is designed to bring version control to the world of machine learning and large datasets. It integrates well with git. If you have set up your credentials as described in our WIKI , you can download all our datasets (very large, approx. 10 Gb) just execute:
dvc pull
This is only necessary if you want to train or test our neural networks.
If you are not part of KITcar, you cannot download our datasets. However, you can either setup your DVC server or simply use DVC locally. See DVC.org for more details. Our pipelines used to train and test models or extract datasets from the simulation will still work.
kitcar-rosbag
This is only required by some scripts to record rosbags in the simulation.
KITcar internal. Clone kitcar-rosbag in the same directory as kitcar-ros.
git clone git@git.kitcar-team.de:kitcar/kitcar-rosbag.git $KITCAR_REPO_PATH/kitcar-rosbag
Then follow the installation steps there.
Test
Let’s test if everything works. Open up a new terminal.
You can now start the simulation with
roslaunch gazebo_simulation master.launch
Gazebo should now open with the car and a road.
Troubleshooting
Gazebo isn’t shown correctly
This might be due to your graphics driver causing problems. Try to set
export LIBGL_ALWAYS_SOFTWARE=1
For further information take a look here.