Skip to content

Commit

Permalink
following up
Browse files Browse the repository at this point in the history
  • Loading branch information
GauravKumar9920 committed Dec 28, 2024
1 parent ff12e55 commit f0b1217
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 11 deletions.
68 changes: 62 additions & 6 deletions .docker/jazzy.amd64.dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ARG ROS_DISTRO="jazzy"
FROM osrf/ros:$ROS_DISTRO-desktop-full
ARG BRANCH="dockertest"
ARG BRANCH="ros2"

# Install Utilities
# hadolint ignore=DL3008
Expand Down Expand Up @@ -53,6 +53,15 @@ ADD https://raw.githubusercontent.com/IOES-Lab/dave/$BRANCH/\
extras/ros-jazzy-binary-gz-harmonic-source-install.sh install.sh
RUN bash install.sh

# Install Ardupilot - Ardusub
ADD https://raw.githubusercontent.com/IOES-Lab/dave/$BRANCH/\
extras/ardusub-ubuntu-install.sh install.sh
RUN bash install.sh
# Install mavros
ADD https://raw.githubusercontent.com/IOES-Lab/dave/$BRANCH/\
extras/mavros-ubuntu-install.sh install.sh
RUN bash install.sh

# Set up Dave workspace
ENV DAVE_WS=/opt/dave_ws
WORKDIR $DAVE_WS/src
Expand All @@ -73,9 +82,56 @@ RUN . "/opt/ros/${ROS_DISTRO}/setup.sh" && \

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

RUN cp /home/docker/.bashrc ~/.bashrc

# Set User as user
USER $USER
RUN echo "source /opt/ros/jazzy/setup.bash" >> ~/.bashrc && \
echo "source /opt/gazebo/install/setup.bash" >> ~/.bashrc
# 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 source "/opt/mavros/install/setup.bash"' /ros_entrypoint.sh && \
sed --in-place --expression \
'$i export GEOGRAPHICLIB_GEOID_PATH=/usr/local/share/GeographicLib/geoids' /ros_entrypoint.sh && \
sed --in-place --expression \
'$i export PYTHONPATH=\$PYTHONPATH:/opt/gazebo/install/lib/python' /ros_entrypoint.sh && \
sed --in-place --expression \
'$i export PATH=/opt/ardupilot_dave/ardupilot/build/sitl/bin:\$PATH' /ros_entrypoint.sh && \
sed --in-place --expression \
'$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 && \
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 && \
sed --in-place --expression \
'$i printf '\''\\033[1;37m \n=====\n'\'' ' /ros_entrypoint.sh && \
sed --in-place --expression \
'$i printf '\'' ____ ___ _______ _ _ _ \n'\'' ' /ros_entrypoint.sh && \
sed --in-place --expression \
'$i printf '\'' | _ \\ / \\ \\ / | ____| / \\ __ _ _ _ __ _| |_(_) ___ \n'\'' ' /ros_entrypoint.sh && \
sed --in-place --expression \
'$i printf '\'' | | | |/ _ \\ \\ / /| _| / _ \\ / _` | | | |/ _` | __| |/ __|\n'\'' ' /ros_entrypoint.sh && \
sed --in-place --expression \
'$i printf '\'' | |_| / ___ \\ V / | |___ / ___ \\ (_| | |_| | (_| | |_| | (__ \n'\'' ' /ros_entrypoint.sh && \
sed --in-place --expression \
'$i printf '\'' |____/_/ \\_\\_/ |_____| /_/ \\_\\__, |\\__,_|\\__,_|\\__|_|\\___|\n'\'' ' /ros_entrypoint.sh && \
sed --in-place --expression \
'$i printf '\'' __ ___ _ _ _____ _ \n'\'' ' /ros_entrypoint.sh && \
sed --in-place --expression \
'$i printf '\'' \\ \\ / (_)_ __| |_ _ _ __ _| | | ____|_ ____ _(_)_ __ \n'\'' ' /ros_entrypoint.sh && \
sed --in-place --expression \
'$i printf '\'' \\ \\ / /| | `__| __| | | |/ _` | | | _| | `_ \\ \\ / | | `__| \n'\'' ' /ros_entrypoint.sh && \
sed --in-place --expression \
'$i printf '\'' \\ V / | | | | |_| |_| | (_| | | | |___| | | \\ V /| | |_ \n'\'' ' /ros_entrypoint.sh && \
sed --in-place --expression \
'$i printf '\'' \\_/ |_|_| \\__|\\__,_|\\__,_|_| |_____|_| |_|\\_/ |_|_(_) \n\\033[0m'\'' ' /ros_entrypoint.sh && \
sed --in-place --expression \
'$i printf '\''\\033[1;32m\n =====\\033[0m\n'\'' ' /ros_entrypoint.sh && \
sed --in-place --expression \
'$i printf '\''\\033[1;32m 👋 Hi! This is Docker virtual environment for DAVE\n\\033[0m'\'' ' /ros_entrypoint.sh && \
sed --in-place --expression \
'$i printf '\''\\033[1;33m\tROS2 Jazzy - Gazebo Harmonic (w ardupilot(ardusub) + mavros)\n\n\\033[0m'\'' ' /ros_entrypoint.sh
18 changes: 13 additions & 5 deletions .docker/jazzy.arm64v8.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ FROM woensugchoi/ubuntu-arm-rdp-base:latest
ARG USER=docker

# ROS-Gazebo arg
ARG BRANCH="dockertest"
ARG BRANCH="ros2"
ARG ROS_DISTRO="jazzy"

# Install ROS-Gazebo framework
Expand Down Expand Up @@ -148,9 +148,17 @@ RUN . "/opt/ros/${ROS_DISTRO}/setup.sh" && colcon build
# Set User as user
USER docker
RUN echo "source /opt/ros/jazzy/setup.bash" >> ~/.bashrc && \
echo "source ~/gazebo/install/setup.bash" >> ~/.bashrc && \
echo "if [ -d ~/HOST ]; then chown docker:docker ~/HOST; fi" \
>> ~/.bashrc
echo "source /opt/gazebo/install/setup.bash" >> ~/.bashrc && \
echo "source /opt/mavros/install/setup.bash" >> ~/.bashrc && \
echo "source $DAVE_UNDERLAY/install/setup.bash" >> ~/.bashrc && \
echo "export GEOGRAPHICLIB_GEOID_PATH=/usr/local/share/GeographicLib/geoids" >> ~/.bashrc && \
echo "export PYTHONPATH=\$PYTHONPATH:/opt/gazebo/install/lib/python" >> ~/.bashrc && \
echo "export PATH=/home/$USER/ardupilot_dave/ardupilot/Tools/autotest:\$PATH" >> ~/.bashrc && \
echo "export PATH=/home/$USER/ardupilot_dave/ardupilot/build/sitl/bin:\$PATH" >> ~/.bashrc && \
echo "export GZ_SIM_SYSTEM_PLUGIN_PATH=/home/$USER/ardupilot_dave/ardupilot_gazebo/build:\$GZ_SIM_SYSTEM_PLUGIN_PATH" >> ~/.bashrc && \
echo "export GZ_SIM_RESOURCE_PATH=/home/$USER/ardupilot_dave/ardupilot_gazebo/models:/home/$USER/ardupilot_dave/ardupilot_gazebo/worlds:\$GZ_SIM_RESOURCE_PATH" >> ~/.bashrc && \
echo "\n\n" >> ~/.bashrc && echo "if [ -d ~/HOST ]; then chown $USER:$USER ~/HOST; fi" >> ~/.bashrc && \
echo "\n\n" >> ~/.bashrc

# Other environment variables
RUN echo "export XDG_RUNTIME_DIR=~/.xdg_log" >> ~/.bashrc && \
Expand Down Expand Up @@ -185,4 +193,4 @@ RUN echo "[Desktop Entry]\nType=Application" \
echo "Exec=gnome-terminal -- bash -c 'cat ~/.hi; cd ~/HOST; exec bash'" \
>> /home/docker/.config/autostart/terminal.desktop && \
echo -e "X-GNOME-Autostart-enabled=true" \
>> /home/docker/.config/autostart/terminal.desktop
>> /home/docker/.config/autostart/terminal.desktop

0 comments on commit f0b1217

Please sign in to comment.