Development Setup¶
For the development of SEEREP, a Visual Studio Code Dev Container is used. This enables the use of a Docker container as a development environment, handling dependencies in a unified manner and abstracting different operating systems. For the system requirements, please refer to the Visual Studio Code Docs.
Setup¶
Clone the repository with:
For the development, it is assumed that the directory designated for SEEREP's
data storage is a sibling folder named seerep-data
, located next to the
repository. Make sure it exists!
Warning
Since a Docker bind mount is used to mount the data storage directory inside the container, providing an incorrect or non-existent path for the host directory will result in an unclear error message when starting the container.
Subsequently, install the Remote Containers and Docker Visual Studio Code extensions:
code --install-extension ms-vscode-remote.remote-containers ; \
code --install-extension ms-azuretools.vscode-docker
Launch Visual Studio Code within the repository:
The presence of a .devcontainer
folder should automatically trigger the
detection of a Dev-Container environment. To reopen the repository folder in the
container, a prompt will appear on the lower right corner:
Or in case this window doesn't open, use either F1 or Ctrl+Shift+P and input
Remote-Containers: Reopen Folder in Container
. Confirm by pressing Enter.
Starting the Dev-Container the first time may take a while as it involves downloading the required SEEREP Docker image (around 4 GB). Additionally Visual Studio Code extensions, Intellisense, and pre-commit checks are setup in the container.
Container Credentials¶
The default credentials have both the username and password set to docker
.
Pre Commit Checks¶
The repository uses pre-commit hooks to verify compliance with established coding guidelines and, if necessary, to format the code in a consistent way. The checks are automatically run before each commit and as part of the GitHub CI. To manually run the checks use:
The main hooks are:
- Clang-Format 15 for C/C++
- Ruff for Python
- Markdownlint for Markdown
Along with other checks for Dockerfiles and YAML, see the complete list in the configuration.
Debugging with VS-Code¶
Inside the Dev-Container, catkin
builds the server executable in debug mode by
default. To start debugging with VS-Code support, the provided launch
configurations can be used. For that switch into the Run and Debug
window
(Ctrl+Shift+D ) and select seerep_server
from the dropdown. To finally
launch the server, click the button.
The gdb
debug console should be displayed at the bottom.
Switching to the terminal tab provides access to the logging output.
An example from a fresh server start is shown below:
For further information regarding debugging in VS-Code check the offical docs.