This guide is an adaptation of https://www.allaban.me/posts/2020/08/ros2-setup-ide-docker/ to make it work with the ade
development environment.
-
Install Docker (including
nvidia-container-toolkit
), CLion (request a student license for activation). For a VSCode 'Look and Feel' in CLion, these two plugin are suggested:- One Dark Theme (Settings > Appearance & Behavior > Appearance > Theme)
- VSCode keymap (Settings > Keymap > Select VSCode)
For a list of well-maintined themes: https://www.dunebook.com/best-clion-themes/
-
Install
ade
running./getade.sh
or following these steps. -
Run the folowing commands to configure the
ade
home directory, which is mounted by default as home directory in theade
containers.$ mkdir -p ~/adehome $ cd ~/adehome $ touch .adehome $ git clone --recurse-submodules git@github.com:AndreaFinazzi/nif.git
A good reference is: https://autowarefoundation.gitlab.io/autoware.auto/AutowareAuto/installation-ade.html
-
Run:
$ export ADE_NAME=nif
or add
if [[ "${PWD}" == *"adehome/nif"* ]]; then echo "setting ADE_NAME=nif" export ADE_NAME=nif source install/setup.zsh elif [[ "${PWD}" == *"adehome/AutowareAuto"* ]]; then echo "setting ADE_NAME=AutowareAuto" export ADE_NAME=AutowareAuto source install/setup.zsh fi
to your
.bashrc
file. -
Start the
ade
environment:$ cd nif $ ./nifstart
-
Setup the ssh access (CLion's toolchain needs this). The login password is the same as host's username (
echo $USER
):$ ./adessh.sh
Verify the installation running:
$ ssh $USER@localhost -p2222
-
Open up your CLion settings/preferences and add a new remote toolchain. Call it whatever, but I’m calling it Docker. Use the credentials we used in the Dockerfile to setup SSH. Make sure to set it as the default.
-
Create a file called
.secret.gitlab
and paste the GitLab Access Token in it (single line, no spaces). -
Almost done. Run the last command (
ssh $USER@localhost -p2222
) orade enter
to open a shell into the container, and run:cd nif ./nifbuild
and copy the output you get from the command. You need it in the next step.
-
Copy and paste the output into CLion’s CMake environment setting.
-
Finally, close and reopen CLion and run
Tools > Resync with remote host
(Ctrl + Shift + A
for action searching). At the end of the process, check that autocompletion is working properly.