Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add panther #11

Merged
merged 6 commits into from
Mar 20, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 31 additions & 42 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,59 +2,48 @@ ARG ROS_DISTRO=humble
ARG PREFIX=

FROM husarnet/ros:${PREFIX}${ROS_DISTRO}-ros-base AS robot-models-builder

# select bash as default shell
SHELL ["/bin/bash", "-c"]

ARG ROS_DISTRO
ARG PREFIX

WORKDIR /ros2_ws

RUN apt update && apt install -y \
ros-$ROS_DISTRO-cv-bridge
WORKDIR /ros2_ws/src

# install everything needed
# Clone packages with descriptions
# ROSbot 2
RUN mkdir -p src/rosbot_ros && \
pushd src/rosbot_ros && \
git init && \
git remote add -f origin https://github.com/husarion/rosbot_ros.git && \
git sparse-checkout init && \
git sparse-checkout set "rosbot_description" && \
git pull origin humble && \
popd && \
RUN git clone https://github.com/husarion/rosbot_ros.git && \
find rosbot_ros -mindepth 1 -maxdepth 1 ! -name 'rosbot_description' -exec rm -r {} + && \
# ROSbot XL
mkdir -p src/rosbot_xl_ros && \
pushd src/rosbot_xl_ros && \
git init && \
git remote add -f origin https://github.com/husarion/rosbot_xl_ros.git && \
git sparse-checkout init && \
git sparse-checkout set "rosbot_xl_description" && \
git pull origin master && \
popd && \
git clone https://github.com/husarion/rosbot_xl_ros.git && \
find rosbot_xl_ros -mindepth 1 -maxdepth 1 ! -name 'rosbot_xl_description' -exec rm -r {} + && \
# Panther
git clone -b ros2-devel https://github.com/husarion/panther_ros.git && \
find panther_ros -mindepth 1 -maxdepth 1 ! -name 'panther_description' -exec rm -r {} + && \
# ros components
git clone https://github.com/husarion/ros_components_description.git src/ros_components_description -b ros2 && \
# ffmpeg image transport plugin
git clone https://github.com/ros-misc-utilities/ffmpeg_image_transport.git src/ffmpeg_image_transport && \
vcs import src < src/ffmpeg_image_transport/ffmpeg_image_transport.repos && \
git clone https://github.com/husarion/ros_components_description.git && \
# OpenManipulatorX
mkdir -p src/open_manipulator_x && \
pushd src/open_manipulator_x && \
git init && \
git remote add -f origin https://github.com/husarion/open_manipulator_x.git && \
git sparse-checkout init && \
git sparse-checkout set "open_manipulator_x_description" && \
git pull origin main && \
popd && \
rosdep update --rosdistro $ROS_DISTRO && \
git clone https://github.com/husarion/open_manipulator_x.git && \
find open_manipulator_x -mindepth 1 -maxdepth 1 ! -name 'open_manipulator_x_description' -exec rm -r {} + && \
# ROSbot XL + manipulator setup
git clone https://github.com/husarion/rosbot_xl_manipulation_ros && \
find open_manipulator_x -mindepth 1 -maxdepth 1 ! -name 'rosbot_xl_manipulation_description' -exec rm -r {} +

# ffmpeg image transport plugin
RUN apt update && apt install -y \
ros-$ROS_DISTRO-cv-bridge && \
git clone https://github.com/ros-misc-utilities/ffmpeg_image_transport.git && \
vcs import . < ./ffmpeg_image_transport/ffmpeg_image_transport.repos

WORKDIR /ros2_ws

# Build packages
RUN rosdep update --rosdistro $ROS_DISTRO && \
rosdep install --from-paths src --ignore-src -y && \
MYDISTRO=${PREFIX:-ros}; MYDISTRO=${MYDISTRO//-/} && \
source /opt/$MYDISTRO/$ROS_DISTRO/setup.bash && \
colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release

FROM husarnet/ros:${PREFIX}${ROS_DISTRO}-ros-core

SHELL ["/bin/bash", "-c"]

RUN apt-get update && apt-get upgrade -y && apt-get install -y \
Expand All @@ -68,7 +57,9 @@ RUN apt-get update && apt-get upgrade -y && apt-get install -y \
# for ffmpeg image transport
ros-$ROS_DISTRO-cv-bridge \
# allows compressed and theora encoded streams to be received over image_transport
ros-$ROS_DISTRO-image-transport-plugins && \
ros-$ROS_DISTRO-image-transport-plugins \
# DepthAI
ros-$ROS_DISTRO-depthai-descriptions && \
apt-get upgrade -y && \
apt-get autoremove -y && \
apt-get clean && \
Expand All @@ -79,10 +70,8 @@ ENV NVIDIA_VISIBLE_DEVICES \
ENV NVIDIA_DRIVER_CAPABILITIES \
${NVIDIA_DRIVER_CAPABILITIES:+$NVIDIA_DRIVER_CAPABILITIES,}graphics

COPY ./settings /settings

COPY --from=robot-models-builder /ros2_ws /ros2_ws
COPY --from=robot-models-builder /ros2_ws/install /ros2_ws/install

RUN echo $(dpkg -s ros-$ROS_DISTRO-rviz2 | grep 'Version' | sed -r 's/Version:\s([0-9]+.[0-9]+.[0-9]+).*/\1/g') >> /version.txt

CMD ["ros2", "run", "rviz2", "rviz2"]
CMD ["ros2", "run", "rviz2", "rviz2"]
Loading