Skip to content

Development Setup

The following contains a list of necessary and optional recommended tools to improve your CRS development experience. Make sure you first install CRS on your machine.

Documentation index — full table of contents.

Necessary Tools

pre-commit

While it is possible to run this in the container itself, you should perform the following actions in your host shell.

  1. Change to the root folder
cd crs-2.0
  1. Install pre-commit
pip install pre-commit
  1. Configure pre-commit to run on this repo:
pre-commit install
  1. Running the hooks (note: git commit will also invoke the hooks for you so no need to run them manually each time):
pre-commit run -a

Setting up VSCode

You are of course free to use any text editor of your choosing but most guides here focus on VSCode.

Installation (Ubuntu)

Either using snap:

  1. sudo snap install --classic code or downloading the deb:

  2. Download the VS-Code Binaries here.

  3. Install it by running sudo dpkg -i <downloaded_file.deb>

Installation (macOS)

Either install using homebrew:

  1. brew install visual-studio-code or download the app:

  2. Download the VS-Code Binaries here.

  3. Follow the installer instructions

Setting up the local installation.

Once installed, you can start vs-code by executing code in the Terminal. This will start a VS-Code session on your local computer (NOT the docker session!). We recommend to install the following plugins locally:

  1. C/C++, C/C++ Extension Pack
  2. Python
  3. Clang-Format
  4. Docker
  5. Dev Containers

To install the plugins, select the tab (ctrl+shift+x) in vs-code and search for the names.

Fixing Include Path Issues

Sometimes, certain files are missing in the c++ include path for vs-code. To fix this, however over the error message and select: Quick Fix, Edit Include Path Settings. Then scroll down to Include Path and add the required files in each line.

For a new installation, make sure that the following is in the include path:

${workspaceFolder}/**
/usr/include/**
/acados/**
/opt/ros/noetic/include/**

Optional Tools

Setting up ZSH with Autocomplete on your development Machine

  1. Install zsh
sudo apt-get install zsh
  1. Change zsh to the default shell
chsh -s $(which zsh)
  1. Run zsh to set up initial config

zsh
Enter (2) for the default setup.

  1. Install oh-my-zsh
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
  1. Install the auto-completion plugin
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
  1. Enable the Plugin
nano +73 ~/.zshrc

Change plugins=(git) to plugins=(git zsh-autosuggestions)

  1. Restart the terminal

Install Terminator (ubuntu only)

Terminator allows you to have multiple terminal tabs open in the same window.

sudo apt-get install terminator

macOS: On mac there is an abundance of available terminal emulators. While there is nothing wrong with using the provided terminal, if you want pane splitting you can use tmux or look into iTerm2, kitty, etc.