-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add docker-compose-debug.yaml for run_test debug mode
Signed-off-by: Daisuke Sato <[email protected]>
- Loading branch information
Showing
4 changed files
with
209 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Copyright (c) 2024 Carnegie Mellon University | ||
# | ||
# Permission is hereby granted, free of charge, to any person obtaining a copy | ||
# of this software and associated documentation files (the "Software"), to deal | ||
# in the Software without restriction, including without limitation the rights | ||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
# copies of the Software, and to permit persons to whom the Software is | ||
# furnished to do so, subject to the following conditions: | ||
# | ||
# The above copyright notice and this permission notice shall be included in all | ||
# copies or substantial portions of the Software. | ||
# | ||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
# SOFTWARE. | ||
|
||
version: "2.3" | ||
|
||
|
||
services: | ||
debug: | ||
extends: | ||
file: docker-compose-common.yaml | ||
service: navigation | ||
build: | ||
context: ./docker/ros2 | ||
dockerfile: Dockerfile.debug | ||
environment: | ||
- CABOT_GAZEBO=1 | ||
- CABOT_USE_SIM_TIME=1 | ||
- CABOT_TOUCH_ENABLED=${CABOT_TOUCH_ENABLED:-false} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,167 @@ | ||
# Copyright (c) 2020, 2023 Carnegie Mellon University | ||
# | ||
# Permission is hereby granted, free of charge, to any person obtaining a copy | ||
# of this software and associated documentation files (the "Software"), to deal | ||
# in the Software without restriction, including without limitation the rights | ||
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
# copies of the Software, and to permit persons to whom the Software is | ||
# furnished to do so, subject to the following conditions: | ||
# | ||
# The above copyright notice and this permission notice shall be included in all | ||
# copies or substantial portions of the Software. | ||
# | ||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
# SOFTWARE. | ||
|
||
ARG PREFIX=cabot | ||
ARG FROM_IMAGE=${PREFIX}__jammy-humble-custom-mesa | ||
|
||
# build underlay | ||
FROM ${FROM_IMAGE} as cache | ||
|
||
ENV UNDERLAY_WS=/opt/underlay_ws | ||
|
||
RUN mkdir -p $UNDERLAY_WS/src | ||
COPY ./tf2_web_republisher $UNDERLAY_WS/src/tf2_web_republisher | ||
|
||
WORKDIR $UNDERLAY_WS | ||
|
||
# copy package.xml files with parent directories for cache | ||
RUN find . -name "src" -type d \ | ||
-mindepth 1 -maxdepth 2 -printf '%P\n' \ | ||
| xargs -I % mkdir -p /tmp/opt/% && \ | ||
find . -name "package.xml" \ | ||
| xargs cp --parents -t /tmp/opt && \ | ||
find . -name "COLCON_IGNORE" \ | ||
| xargs cp --parents -t /tmp/opt || true | ||
|
||
RUN apt update && rosdep update && rosdep install -q -y \ | ||
--from-paths src \ | ||
--ignore-src | ||
|
||
RUN . /opt/custom_ws/install/setup.sh && \ | ||
colcon build --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo | ||
|
||
|
||
FROM ${FROM_IMAGE} as build | ||
ENV ROS_DISTRO=humble | ||
ARG TZ=UTC | ||
ENV TZ=$TZ | ||
RUN sudo ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ | sudo tee /etc/timezone | ||
ENV UNDERLAY_WS=/opt/underlay_ws | ||
|
||
WORKDIR $UNDERLAY_WS | ||
|
||
COPY --from=cache $UNDERLAY_WS/install $UNDERLAY_WS/install | ||
# copy package.xml files from cache | ||
COPY --from=cache /tmp/opt/src $UNDERLAY_WS/src | ||
|
||
RUN apt update && rosdep update && rosdep install -q -y \ | ||
--from-paths src \ | ||
--ignore-src | ||
|
||
ARG ROS_DISTRO | ||
|
||
# TODO replace with rosdep install | ||
RUN apt update && \ | ||
apt install -y --no-install-recommends \ | ||
bc \ | ||
libqt5svg5-dev \ | ||
libzmq3-dev \ | ||
libdw-dev \ | ||
libyaml-cpp-dev \ | ||
libomp-dev \ | ||
libpcl-dev \ | ||
python3-pykdl \ | ||
python3-sklearn \ | ||
python3-venv \ | ||
qtbase5-dev \ | ||
ros-$ROS_DISTRO-diagnostic-aggregator \ | ||
ros-$ROS_DISTRO-gazebo-msgs \ | ||
ros-$ROS_DISTRO-joint-state-publisher \ | ||
ros-$ROS_DISTRO-joint-state-publisher-gui \ | ||
ros-$ROS_DISTRO-navigation2 \ | ||
ros-$ROS_DISTRO-rosidl-runtime-cpp \ | ||
# pcl-ros is not ported yet | ||
# # ros-$ROS_DISTRO-pcl-msgs \ | ||
# # ros-$ROS_DISTRO-pcl-ros \ | ||
ros-$ROS_DISTRO-pointcloud-to-laserscan \ | ||
ros-$ROS_DISTRO-realsense2-description \ | ||
ros-$ROS_DISTRO-robot-localization \ | ||
ros-$ROS_DISTRO-geographic-msgs \ | ||
libgeographic-dev \ | ||
# workaround end | ||
ros-$ROS_DISTRO-rosbridge-server \ | ||
ros-$ROS_DISTRO-ros-testing \ | ||
ros-$ROS_DISTRO-rqt-robot-monitor \ | ||
ros-$ROS_DISTRO-teleop-twist-keyboard \ | ||
ros-$ROS_DISTRO-tf-transformations \ | ||
ros-$ROS_DISTRO-xacro \ | ||
ros-$ROS_DISTRO-rmw-cyclonedds-cpp \ | ||
ros-$ROS_DISTRO-rosbag2-storage-mcap \ | ||
xterm \ | ||
&& \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
RUN pip3 install --no-cache-dir \ | ||
# install ipython==8.0.1 to prevent errors while using odrivetool | ||
ipython==8.0.1 \ | ||
odrive==0.6.5 \ | ||
pyproj \ | ||
pyserial \ | ||
requests \ | ||
transforms3d | ||
|
||
# for pedestrian test | ||
RUN pip3 install --no-cache-dir \ | ||
'pysocialforce[test,plot]' | ||
|
||
# for debug | ||
RUN apt update && \ | ||
apt install -y --no-install-recommends \ | ||
gdb \ | ||
vim \ | ||
&& \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# set up venv for keeping compatibility | ||
RUN mkdir -p /opt/venv | ||
# cabot2 venv (odrive==0.5.2.post0) | ||
RUN python3 -m venv --system-site-packages /opt/venv/cabot2 && \ | ||
. /opt/venv/cabot2/bin/activate && \ | ||
pip3 install --no-cache-dir odrive==0.5.2.post0 && \ | ||
deactivate | ||
# cabot3 venv (odrive==0.6.5) | ||
RUN python3 -m venv --system-site-packages /opt/venv/cabot3 | ||
|
||
ENV USERNAME developer | ||
# Replace 1000 with your user/group id | ||
ARG UID=1000 | ||
RUN useradd -m $USERNAME && \ | ||
echo "$USERNAME:$USERNAME" | chpasswd && \ | ||
usermod --shell /bin/bash $USERNAME && \ | ||
usermod -aG sudo $USERNAME && \ | ||
mkdir -p /etc/sudoers.d/ && \ | ||
echo "$USERNAME ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/$USERNAME && \ | ||
chmod 0440 /etc/sudoers.d/$USERNAME && \ | ||
usermod --uid $UID $USERNAME && \ | ||
groupmod --gid $UID $USERNAME | ||
|
||
# install entrypoint | ||
COPY launch.sh / | ||
|
||
# change location of ros base | ||
RUN sed -i 's:custom_ws:underlay_ws:' /ros_entrypoint.sh | ||
|
||
USER $USERNAME | ||
|
||
ENV HOME /home/$USERNAME | ||
|
||
WORKDIR $HOME/ros2_ws | ||
|
||
CMD [ "/launch.sh" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters