- Install the Docker extension in VSCode.
- Open a terminal and clone the current repository
cd ~
git clone [email protected]:roboticswithjulia/ros2_rust_workshop.git
- Go to the repository and run the following lines:
cd ~/ros2_rust_workshop
xhost + local:root
code .
- Open a terminal in the vscode:
Terminal -> New terminal
- Generate the images and run the container.
cd ~/ros2_rust_workshop/docker
./build_image.sh
./run_user.sh
Note: It will download a lot of things, it may take a while in a slow connection. It took about 3min in my moderate machine with 100mb internet connection.
-
Open the docker container using the docker vscode extension. Double click in the following icon:
-
Right button to the container ros2_rust_dev:latest -> Attach Visual Studio Code. A new vscode IDE will be opened, it is important to close the old one.
-
If the following image appears, select Open Workspace and search for
/home/cuser/ros2_rust_workshop/
- It is important to work in the vscode IDE where the container is running, it is indicated in the bottom left part of the IDE in green:
- You can open a terminal
'+'
(Select Bash if it is not previously selected).
The terminal will be inside of docker, and you'll see you are user cuser@your-machine
.
Everything you do will be saved in the folder of the project (your_path/ros2_rust_workshop
) (but owned by the container user). You won't lose progress. If things break, remove from ros_ws
: build
, install
, log
. If it goes really bad, remove what is inside of src
and start over.
Build the workspace, about 3min30s in my moderate machine.
cd ~/ros2_rust_workshop/ros_ws
sudo apt-get update
rosdep update
rosdep install --from-paths src --ignore-src -r -y
source /opt/ros/humble/setup.sh
colcon build
source install/setup.bash
ros2 launch champ_config gazebo.launch.py