vscode, git, docker and docker-compose installedRemote Development and Docker Visual Studio Code extensionsVisual Studio Code ROS extension (automaticly installed) is also used. Documentation here.
On the new development process, you don't need to clone all the packages from GitHub. You only need to clone at least the sonia-deploy repo and the ones you want to work on.
To target the right platform, you need to setup contexts. See Docker documentation for more details. When setup is done, you can select the right context in vscode in the Docker tab.
The repo contains various scripts and docker-compose files to let you start a local debugging or remote debugging (pool test). It uses the latest Docker images built from GitHub, so you don't have to build the full workspace locally (tips: it may be longer the first time you launch, Docker needs to download packages).
If don't want a specific package to run on launch, you only need to comment the lines in the file. You can also change their environment variables like tty bind or parameters. You can also change the image tag for a specific repo.
The repo contains 6 scripts:
launch_auv7.shlaunch_auv8.shlaunch_local.shpull_auv7.shpull_auv8.shpull_local.shdocker-compose file (see context selection above). The three others let you pull the latest images from GitHub. Make sure you call those scripts before pool test.When you want to work on a package, you first need to clone it on your computer locally and open the project in Visual Studio Code. You then need to select a context for debugging (local, auv7 or auv8). Once did, you can develop with two strategies:
Once your project is open and your Docker context is selected, you need to start the remote container session. Click on the "><" symbol at the bottom-left of the Visual Studio Code window and select "Remote-Containers: Reopen in Container".
You can modify the code before launching the container session. Your modified code will be in the container. Once started, if you modify the code, you need to commit and push BEFORE closing your container session (if not, your modifications will be deleted). A good practice is to commit and push before starting remote session and before closing it. Your git information is sent to the container, so you don't have to enter it again.
The Docker deamon will build the image. It can take a few minutes before it's ready. Once done, you need to start ROS core in the VSCode command panel (CTRL+SHIFT+P) and then select "ROS: Start core".
You can now edit the code in VSCode. You can add breakpoints in the code, you will be able to use the debug tools.
There is a bug with the debug for now. Sometimes, the launch command starts before the compilation is done (the package starts with the previous code). A workaround is to launch manually the compilation command of the command panel, wait its completion and then start the debugging session.
You can open multiple windows and start multiple packages if wanted. Make sure you only start ROS core once.
It's almost the same thing as the previous section. The only differences are:
docker-compose file)launch_{PLATFORM}.sh from sonia-deploy) BEFORE launching the package debugging in VSCode