This is a brief guide to getting Apollo 2.0 up and running. It is based on the Apollo README with additional setup for the Perception modules.
- Ubuntu 16.04 (also works on 14.04).
- Nvidia GPU. Install the drivers as described here. You don’t need CUDA installed (it’s included in the Apollo docker). On 16.04 you will need a new-ish version – the below is tested using 390.25. The Apollo recommended 275.39 will not work on 16.04, but will work on 14.04. However, as this requires a newer GCC version that breaks the build system, it is much easier to go straight to the 390.25 driver.
Download code and Docker image
- Get the code:
git clone https://github.com/ApolloAuto/apollo.git
- If you don’t have Docker already:
- Then log out and log back in again.
- Pull the docker image. The
dev_start.shscript downloads the docker image (or updates it if already downloaded) and starts the container.
Install Nvidia graphics drivers in the Docker image
- Check which driver you are using (in host) with
- First off we need to enter the container with root priveledges so we can install the matching graphics drivers.
docker exec -it apollo_dev /bin/bash
***.**is the driver version running on your host system.
Note: Disregard the Apollo instructions to upgrade to GCC 4.9. Not only is it not necessary with newer versions of the Nvidia drivers, but it will make the build fail. Stick with the GCC version of 4.8.4 which comes in the Docker image.
- Now install the drivers:
chmod +x NVIDIA-Linux-x86_64-***.**.run
./NVIDIA-Linux-x86_64-***.**.run -a --skip-module-unload --no-kernel-module --no-opengl-files
Hit ‘enter’ to go with the default choices where prompted. Once done, check that the driver is working with
- To create a new image with your changes, check what the container ID of your image is (on the host):
docker ps -l
- Use the resulting container ID with the following command to create a new image (on the host):
docker commit CONTAINER_ID apolloauto/apollo:NEW_DOCKER_IMAGE_TAG
CONTAINER_IDis the container ID you found before, and
NEW_DOCKER_IMAGE_TAGis the name you choose for your Apollo GPU image.
Build Apollo in your new Docker image
- To get into your new docker image, use the following:
./docker/scripts/dev_start.sh -l -t NEW_DOCKER_IMAGE_TAG
- Now you should be able to build the GPU version of Apollo:
- From within the docker image, start Apollo:
- Check that Dreamview is running at
- Set up in Dreamview by selecting the setup mode, vehicle, and map in the top right. For the sample data rosbag, select “Standard”, “Mkz8” and “Sunnyvale Big Loop”.
- Start the rosbag in the docker container with
rosbag play path/to/rosbag.bag.
- Once you see the vehicle moving in Dreamview, pause the rosbag with the space bar.
- Wait a few seconds for the perception, prediction and traffic light modules to load.
- Resume playing the rosbag with the spacebar.
Once the rosbag playing is complete, to play it again you have to first shutdown with
scripts/bootstrap.sh stop and then repeat the above from step 1 (otherwise the time discrepancy stops the modules from working).