Skip to content

Commit

Permalink
add prereq
Browse files Browse the repository at this point in the history
  • Loading branch information
woensug-choi committed Sep 10, 2024
1 parent 5c3f74b commit 5fbdadf
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 20 deletions.
30 changes: 19 additions & 11 deletions .docker/jazzy.amd64.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ RUN apt-get update && \
lsb-release pkg-config protobuf-compiler \
python3-dbg python3-pip python3-venv python3-pexpect \
python-is-python3 python3-future python3-wxgtk4.0 \
libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev \
qtbase5-dev ruby dirmngr gnupg2 nano xauth \
software-properties-common htop libtool \
x11-apps mesa-utils bison flex automake && \
rm -rf /var/lib/apt/lists/
x11-apps mesa-utils bison flex automake \
libgz-sim8-dev rapidjson-dev libopencv-dev \
libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev \
gstreamer1.0-plugins-bad gstreamer1.0-libav gstreamer1.0-gl \
&& rm -rf /var/lib/apt/lists/

# Locale for UTF-8
RUN truncate -s0 /tmp/preseed.cfg && \
Expand Down Expand Up @@ -50,7 +52,7 @@ extras/ardusub-ubuntu-install.sh install.sh
RUN bash install.sh

# Set up Dave workspace
ENV DAVE_WS=/opt/ws_dave
ENV DAVE_WS=/opt/dave_ws
WORKDIR $DAVE_WS/src

ADD https://raw.githubusercontent.com/IOES-Lab/dave/$BRANCH/\
Expand All @@ -69,25 +71,31 @@ RUN . "/opt/ros/${ROS_DISTRO}/setup.sh" && \

# source entrypoint setup
RUN touch /ros_entrypoint.sh && sed --in-place --expression \
'$i source "/opt/ws_dave/install/setup.bash"' /ros_entrypoint.sh
'$i source "/opt/dave_ws/install/setup.bash"' /ros_entrypoint.sh

# Source ROS and Gazebo
RUN sed --in-place --expression \
'$i source "/opt/ros/jazzy/setup.bash"' /ros_entrypoint.sh && \
sed --in-place --expression \
'$i source "/opt/gazebo/install/setup.bash"' /ros_entrypoint.sh && \
sed --in-place --expression \
'$i export PYTHONPATH=$PYTHONPATH:/opt/gazebo/install/lib/python' /ros_entrypoint.sh && \
'$i export PYTHONPATH=\$PYTHONPATH:/opt/gazebo/install/lib/python' /ros_entrypoint.sh && \
sed --in-place --expression \
'$i export PATH=/opt/ardupilot_dave/ardupilot/build/still/bin:$PATH' /ros_entrypoint.sh && \
'$i export PATH=/opt/ardupilot_dave/ardupilot/build/still/bin:\$PATH' /ros_entrypoint.sh && \
sed --in-place --expression \
'$i export PATH=/opt/ardupilot_dave/ardupilot/Tools/autotest:$PATH' /ros_entrypoint.sh && \
'$i export PATH=/opt/ardupilot_dave/ardupilot/Tools/autotest:\$PATH' /ros_entrypoint.sh && \
sed --in-place --expression \
'$i export GZ_SIM_SYSTEM_PLUGIN_PATH=/opt/ardupilot_dave/ardupilot_gazebo/build:$GZ_SIM_SYSTEM_PLUGIN_PATH' /ros_entrypoint.sh && \
'$i export GZ_SIM_SYSTEM_PLUGIN_PATH=/opt/ardupilot_dave/ardupilot_gazebo/build:\$GZ_SIM_SYSTEM_PLUGIN_PATH' /ros_entrypoint.sh && \
sed --in-place --expression \
'$i export GZ_SIM_RESOURCE_PATH=/opt/ardupilot_dave/ardupilot_gazebo/models:/opt/ardupilot_dave/ardupilot_gazebo/worlds:$GZ_SIM_RESOURCE_PATH' /ros_entrypoint.sh
'$i export GZ_SIM_RESOURCE_PATH=/opt/ardupilot_dave/ardupilot_gazebo/models:/opt/ardupilot_dave/ardupilot_gazebo/worlds:\$GZ_SIM_RESOURCE_PATH' /ros_entrypoint.sh

# Set User as user
USER $USER
RUN echo "source /opt/ros/jazzy/setup.bash" >> ~/.bashrc && \
echo "source /opt/gazebo/install/setup.bash" >> ~/.bashrc
echo "source /opt/gazebo/install/setup.bash" >> ~/.bashrc && \
echo "export PYTHONPATH=\$PYTHONPATH:/opt/gazebo/install/lib/python" >> ~/.bashrc && \
echo "export PATH=/opt/ardupilot_dave/ardupilot/build/still/bin:\$PATH" >> ~/.bashrc && \
echo "export PATH=/opt/ardupilot_dave/ardupilot/Tools/autotest:\$PATH" >> ~/.bashrc && \
echo "export GZ_SIM_SYSTEM_PLUGIN_PATH=/opt/ardupilot_dave/ardupilot_gazebo/build:\$GZ_SIM_SYSTEM_PLUGIN_PATH" >> ~/.bashrc && \
echo "export GZ_SIM_RESOURCE_PATH=/opt/ardupilot_dave/ardupilot_gazebo/models:/opt/ardupilot_dave/ardupilot_gazebo/worlds:\$GZ_SIM_RESOURCE_PATH" >> ~/.bashrc

20 changes: 11 additions & 9 deletions .docker/jazzy.arm64v8.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ RUN apt-get update && \
apt-get install -y --no-install-recommends \
python-is-python3 python3-future python3-wxgtk4.0 python3-pexpect \
libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev \
libgz-sim8-dev rapidjson-dev libopencv-dev \
gstreamer1.0-plugins-bad gstreamer1.0-libav gstreamer1.0-gl \
&& rm -rf /var/lib/apt/lists/

# ROS-Gazebo arg
Expand All @@ -110,8 +112,8 @@ ENV ROS_UNDERLAY=/home/$USER/dave_ws/install
WORKDIR $ROS_UNDERLAY/../src

ADD https://raw.githubusercontent.com/IOES-Lab/dave/$BRANCH/\
extras/repos/dave.$ROS_DISTRO.repos /home/$USER/ws_dave/dave.repos
RUN vcs import --shallow --input "/home/$USER/ws_dave/dave.repos"
extras/repos/dave.$ROS_DISTRO.repos /home/$USER/dave_ws/dave.repos
RUN vcs import --shallow --input "/home/$USER/dave_ws/dave.repos"

RUN rosdep init && \
rosdep update --rosdistro $ROS_DISTRO
Expand Down Expand Up @@ -145,13 +147,13 @@ RUN touch /ros_entrypoint.sh && sed --in-place --expression \
USER docker
RUN echo "source /opt/ros/jazzy/setup.bash" >> ~/.bashrc && \
echo "source /opt/gazebo/install/setup.bash" >> ~/.bashrc && \
echo "export PYTHONPATH=$PYTHONPATH:/opt/gazebo/install/lib/python" >> ~/.bashrc && \
echo "export PATH=/opt/ardupilot_dave/ardupilot/build/still/bin:$PATH" >> ~/.bashrc && \
echo "export PATH=/opt/ardupilot_dave/ardupilot/Tools/autotest:$PATH" >> ~/.bashrc && \
echo "export GZ_SIM_SYSTEM_PLUGIN_PATH=/opt/ardupilot_dave/ardupilot_gazebo/build:$GZ_SIM_SYSTEM_PLUGIN_PATH" >> ~/.bashrc && \
echo "export GZ_SIM_RESOURCE_PATH=/opt/ardupilot_dave/ardupilot_gazebo/models:/opt/ardupilot_dave/ardupilot_gazebo/worlds:$GZ_SIM_RESOURCE_PATH" >> ~/.bashrc && \
echo "if [ -d ~/HOST ]; then chown docker:docker ~/HOST; fi" \
>> ~/.bashrc
echo "export PYTHONPATH=\$PYTHONPATH:/opt/gazebo/install/lib/python" >> ~/.bashrc && \
echo "export PATH=/opt/ardupilot_dave/ardupilot/build/still/bin:\$PATH" >> ~/.bashrc && \
echo "export PATH=/opt/ardupilot_dave/ardupilot/Tools/autotest:\$PATH" >> ~/.bashrc && \
echo "export GZ_SIM_SYSTEM_PLUGIN_PATH=/opt/ardupilot_dave/ardupilot_gazebo/build:\$GZ_SIM_SYSTEM_PLUGIN_PATH" >> ~/.bashrc && \
echo "export GZ_SIM_RESOURCE_PATH=/opt/ardupilot_dave/ardupilot_gazebo/models:/opt/ardupilot_dave/ardupilot_gazebo/worlds:\$GZ_SIM_RESOURCE_PATH" >> ~/.bashrc && \&& \
echo "\n\n" >> ~/.bashrc && echo "if [ -d ~/HOST ]; then chown docker:docker ~/HOST; fi" >> ~/.bashrc && \
echo "\n\n" >> ~/.bashrc

# Other environment variables
RUN echo "export XDG_RUNTIME_DIR=~/.xdg_log" >> ~/.bashrc && \
Expand Down

0 comments on commit 5fbdadf

Please sign in to comment.