Skip to content

Commit 5c33bf5

Browse files
committed
Make vscode devcontainers work seamlessly for debugging
New paths: now mounts entire AirStack folder inside for vscode docker containers development. Paths are /home/robot/AirStack and /home/gcs/AirStack
1 parent 619e151 commit 5c33bf5

File tree

15 files changed

+73
-39
lines changed

15 files changed

+73
-39
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"name": "GCS Container",
3+
"dockerComposeFile": [
4+
"../../docker-compose.yaml",
5+
],
6+
"runServices": [
7+
"gcs"
8+
],
9+
"service": "gcs",
10+
"workspaceFolder": "/home/gcs/AirStack",
11+
"remoteEnv": {
12+
"AUTOLAUNCH": "false"
13+
},
14+
"customizations": {
15+
"vscode": {
16+
"extensions": [
17+
"Ranch-Hand-Robotics.rde-pack",
18+
"ms-vscode.cpptools",
19+
"ms-python.black-formatter"
20+
]
21+
}
22+
}
23+
}

.devcontainer/gcs_container/devcontainer.json

Lines changed: 0 additions & 6 deletions
This file was deleted.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"name": "Robot Container",
3+
"runServices": [
4+
"robot"
5+
],
6+
"dockerComposeFile": [
7+
"../../docker-compose.yaml"
8+
],
9+
"service": "robot",
10+
"workspaceFolder": "/home/robot/AirStack",
11+
"remoteEnv": {
12+
"AUTOLAUNCH": "false",
13+
},
14+
"customizations": {
15+
"vscode": {
16+
"extensions": [
17+
"Ranch-Hand-Robotics.rde-pack",
18+
"ms-vscode.cpptools",
19+
"ms-python.black-formatter"
20+
]
21+
}
22+
}
23+
}

.devcontainer/robot_container/devcontainer.json

Lines changed: 0 additions & 6 deletions
This file was deleted.

gcs/docker/.bashrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ fi
105105
# --- ROS2 workspace setup ---
106106

107107
# Define the ROS2 workspace directory
108-
ROS2_WS_DIR="$HOME/ros_ws"
108+
ROS2_WS_DIR="$HOME/AirStack/gcs/ros_ws"
109109
# needed for communication with Isaac Sim ROS2 # https://docs.omniverse.nvidia.com/isaacsim/latest/installation/install_ros.html#enabling-the-ros-bridge-extension
110110
export FASTRTPS_DEFAULT_PROFILES_FILE="$ROS2_WS_DIR/fastdds.xml"
111111
# for local development, prevent conflict with other desktops

gcs/docker/Dockerfile.gcs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ EXPOSE 22
3636
RUN git clone https://github.com/tmux-plugins/tpm /home/gcs/.tmux/plugins/tpm
3737

3838

39-
WORKDIR /home/gcs/ros_ws
39+
WORKDIR /home/gcs/AirStack/gcs/ros_ws
4040
# Make it so that files created within the container reflect the user's UID/GID so they don't have to change file permissions from root. See https://github.com/boxboat/fixuid
4141
# need to give access to docker to access container name
4242
# creates user "gcs" with UID 1000, home directory /home/gcs, and shell /bin/sh

gcs/docker/gcs-base-docker-compose.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,6 @@ services:
4545
- ../../common/ros_packages:/home/gcs/ros_ws/src/common:rw
4646
- ../../common/inputrc:/etc/inputrc:rw
4747
# autonomy stack stuff
48-
- ../ros_ws:/home/gcs/ros_ws:rw
49-
- ../../common/ros_packages/fastdds.xml:/home/gcs/ros_ws/fastdds.xml:rw
48+
- ../..:/home/gcs/AirStack
49+
- ../../common/ros_packages:/home/gcs/AirStack/gcs/ros_ws/src/common:rw # common ROS packages
50+
- ../../common/ros_packages/fastdds.xml:/home/gcs/AirStack/gcs/ros_ws/fastdds.xml:rw # fastdds.xml

gcs/ros_ws/src/gcs_bringup/config/gcs.perspective

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,11 @@
110110
"plugin": {
111111
"keys": {
112112
"command_config_filename": {
113-
"repr": "'/root/ros_ws/install/rqt_gcs/share/rqt_gcs/config/gui_config.yaml'",
113+
"repr": "'/home/gcs/AirStack/gcs/ros_ws/install/rqt_gcs/share/rqt_gcs/config/gui_config.yaml'",
114114
"type": "repr"
115115
},
116116
"trajectory_config_filename": {
117-
"repr": "'/root/ros_ws/install/rqt_gcs/share/rqt_gcs/config/fixed_trajectories.yaml'",
117+
"repr": "'/home/gcs/AirStack/gcs/ros_ws/install/rqt_gcs/share/rqt_gcs/config/fixed_trajectories.yaml'",
118118
"type": "repr"
119119
}
120120
},

robot/docker/.bashrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# --- ROS2 workspace setup ---
77

88
# Define the ROS2 workspace directory
9-
ROS2_WS_DIR="$HOME/ros_ws"
9+
ROS2_WS_DIR="$HOME/AirStack/robot/ros_ws"
1010
# needed for communication with Isaac Sim ROS2 # https://docs.omniverse.nvidia.com/isaacsim/latest/installation/install_ros.html#enabling-the-ros-bridge-extension
1111
export FASTRTPS_DEFAULT_PROFILES_FILE="$ROS2_WS_DIR/fastdds.xml"
1212
# for local development, prevent conflict with other desktops

robot/docker/Dockerfile.robot

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ RUN pip install -e .
202202
# TMux config
203203
RUN git clone https://github.com/tmux-plugins/tpm /home/robot/.tmux/plugins/tpm
204204

205-
WORKDIR /home/robot/ros_ws
205+
WORKDIR /home/robot/AirStack/robot/ros_ws
206206

207207
# Make it so that files created within the container reflect the user's UID/GID so they don't have to change file permissions from root. See https://github.com/boxboat/fixuid
208208
# need to give access to docker to access container name
@@ -220,9 +220,8 @@ RUN USER=robot && \
220220
mkdir -p /etc/fixuid && \
221221
printf "user: $USER\ngroup: $GROUP\n" > /etc/fixuid/config.yml
222222

223-
# Cleanup. Prevent people accidentally doing git commits from within Docker
224-
RUN apt purge git -y \
225-
&& apt autoremove -y \
223+
# Cleanup
224+
RUN apt autoremove -y \
226225
&& apt clean -y \
227226
&& rm -rf /var/lib/apt/lists/*
228227

0 commit comments

Comments
 (0)