- Download and install Visual Studio Code on your local machine
- In VS Code, install the Remote Development extension pack
- Select the "Remote Explorer" tab in the left taskbar
- Make sure the Remote Explorer is targeting "SSH Targets" and click plus to add the server you are trying to access. For example, "wato-tr.uwaterloo.ca".
- Right click on the added target and connect. Select your workspace, and you can edit code in
src
. - To make an integrated VScode terminal that runs on the host, use
ctrl->p
> Create New Integrated Terminal
.
If you want to attach VScode to a specific container instead of to the host, you need to follow some extra steps.
- Follow the "Over SSH" instructions
- Once your VScode is connected to the server, install the Docker extension pack on the remote VScode
- Enter the VS Code Docker extension tab and find your container in the "Individual Containers" section.
- Right click on your container and select "Attach VS Code to Container"
- Done! At this point you should be able to edit code and run Colcon/ROS2 commands in the container through the VS Code terminal
If you want to attach VScode to a monorepo docker container, we suggest that you use -dev
mode. watod -dev
is a series of overrides that make developing inside monorepo containers easy and intuitive. Changes you make inside the container will propagate out to your host machine's code and vice versa. To set them up:
- Configure the modules you want to activate by setting
ACTIVE_MODULES
to the module you'd like inwatod-config.sh
- Start the module's containers with
watod -dev up
. This will start every container in an actionless state. - Connect VScode to any of the containers using the previous steps in this document.