dev_release_vscode¶
This is an example using ROS 2 Dashing, VS Code, and Docker.
Quick start¶
- Open this folder in VS Code and choose Dev Containers: Reopen in Container.
-
Download the example package
-
Build the code in the attached terminal.
Detailed instructions¶
Get the example code¶
Run get_code.sh to download the example code.
This will download the ROS packages listed in the .rosinstall file.
Note: you can also run
to get the sources listed in the .rosinstall package.
Update the dockerfile for your user/group¶
If you're user id/group is different than the default 1000/1000 for linux, you will need to edit the container with your user id/group.
Note: To find your user id/group:
bash id -u # user ID id -g # group ID
Open the folder in a remote container¶
Open the command palette and select Dev Containers: Reopen in Container. If the folder is not already open in a container, use Dev Containers: Open Folder in Container instead.
VSCode will build the docker file and mount the folder into the container.
From here, you can build the source by running the build task.
The default build task runs in the current working directory:
The workspace also provides debug and test tasks for colcon build --cmake-args '-DCMAKE_BUILD_TYPE=Debug' and colcon test && colcon test-result.
Deployment¶
The deployment steps for this workflow are similar to the dev_release release workflow. Development is performed in a different container from the release container; the built install directory is copied into the release image at /opt/docker.
After a successful build, run the release script from this directory on the host:
This builds the release container using the local install directory.
You may want to change the tag name to fit your project.