First Steps¶
Interface Docker Environment¶
As mentioned in the install instructions, the crs-docker command line tool allows you to interface the Docker container. Running
will initialize the environment. After the initialization, you can connect to the container by running
This will open a bash shell in the Docker container, which will serve as your main development shell (see example below). Note: After the initialization, you can run crs-docker run as many times as you wish.
Example for bash shell in container:
Note that you are logged in as the user root and are working in the directory /code. You know you are in a container due to the strange computer name fea6900adbe8. Inside the container, you can work as if you are on a normal Linux computer. Your crs folder will be mapped to the /code folder in the container, this means you can modify all the files in the crs folder on your host (i.e. using your favorite IDE or text editor) and run the code in the container (see next section for this).
To close the bash shell again, simply run exit. And to terminate the whole Docker environment, run
IMPORTANT: Always terminate the environment (down) when you are finished developing! This ensures the temporarily opened X11 port, which is used to communicate with the container is properly closed, since this could potentially compromise the security of your host, if the port would be left open.
CRS command line tool¶
During the installation the CRS command line tool is installed. It acts as the main interface for the project and allows you to build, clean and tidy up the code. The usage is given below.
user@machine:~$ crs -h
usage: crs <command> [-h]
there are the following commands:
build: Checks if the current directory is the crs root directory. If true,
catkin build is invoked to build the catkin workspace. See
catkin build for further details.
clean: Checks if the current directory is the crs root directory. If true,
the workspace is cleaned similar to catkin clean. See the catkin
documentation for further details.
generate:Generates the c-code for all mpc solvers and rebuilds all packages
tidy: Checks if the current directory is the crs root directory. If true,
the workspace is cleaned and subsequently build again, additionally
using clang-tidy to perform statistical code analysis during the build.
After the build, the complete clang-tidy log is printed to the console.
test: Checks if the current directory is the crs root directory. If true,
catkin run_tests -j=1 is invoked to build the tests.
init: Checks if the current directory is the crs root directory. If true,
initializes the catkin workspaces using catkin init commands
If this is the first time you started the docker container, make sure to initialize the catkin workspace using
To build manually and exclude some packages use the following commands:
To add to, remove from or delete the current skiplist use:
catkin config -a --skiplist <package_3> # adds <package_3> to skiplist
catkin config -r --skiplist <package_2> # removes <package_2> from skiplist
catkin config --no-skiplist # removes all packages from skiplist
To source the binaries:
Test a simulation¶
Once you're inside of the docker environment, build the crs packages:
Launch a simulation using
This will launch a basic feedforward feedback controller that tracks the centerline of the track. You should be able to see the vehicle driving around the track on rviz. If the rviz window does not show up, check Development/Visualization.
Open a new terminal and attach it to the running docker image using the following command,
(Note: this will only work if you have one running crs container since the attach function is just looking for the only running container. Please contact the lead developers of the project if you have the feeling you need to run multiple crs container in parallel and would like to attach to them via their respective IDs.)
Run a ROS application called rqt_graph by running
(Note: you'll need to run the source command once every time you open a new terminal) This application will show you the different nodes and topics that are currently being used to run the simulation. There are many other ROS commands or applications you can run to get more familiar with the infrastructure and messaging (ex: rostopic list shows all the current topics, rostopic echo ***topic name*** displays the actual messages for a given topic).