From 549381fcc8c5dd7d875c9ef3eb57b57072e8a73b Mon Sep 17 00:00:00 2001 From: Rooholla-KhorramBakht Date: Tue, 23 Apr 2024 15:08:12 -0400 Subject: [PATCH] nav2 dockerfile is added --- Dockerfile.nav2 | 43 +++++++++++++++++++++++++++++++++++++++++++ Makefile | 3 +++ 2 files changed, 46 insertions(+) create mode 100644 Dockerfile.nav2 diff --git a/Dockerfile.nav2 b/Dockerfile.nav2 new file mode 100644 index 0000000..0036845 --- /dev/null +++ b/Dockerfile.nav2 @@ -0,0 +1,43 @@ +# FROM isaac_ros_dev-aarch64 +FROM ros:humble +ENV DEBIAN_FRONTEND=noninteractive +SHELL ["/bin/bash", "-c"] +# uodate and install dependencies +RUN apt-get update && apt-get install -y \ + ros-humble-rmw-cyclonedds-cpp ros-humble-rosidl-generator-dds-idl \ + ros-humble-realsense2-camera \ + ros-humble-pointcloud-to-laserscan \ + libyaml-cpp-dev \ + # ros-humble-isaac-ros-visual-slam \ + # ros-humble-isaac-ros-occupancy-grid-localizer\ + libboost-all-dev\ + build-essential \ + cmake \ + git \ + && rm -rf /var/lib/apt/lists/* + +# Cheange the ROS2 RMW to CycloneDDS as instructed by Unitree +RUN cd / && git clone https://github.com/unitreerobotics/unitree_ros2 && cd /unitree_ros2/cyclonedds_ws/src && \ +git clone https://github.com/ros2/rmw_cyclonedds -b humble && git clone https://github.com/eclipse-cyclonedds/cyclonedds -b releases/0.10.x &&\ +cd .. && colcon build --packages-select cyclonedds && source /opt/ros/humble/setup.bash && colcon build + +# RUN echo "source /opt/ros/humble/setup.bash" >> /usr/local/bin/scripts/workspace-entrypoint.sh +# RUN echo "source /unitree_ros2/cyclonedds_ws/install/setup.bash" >> /usr/local/bin/scripts/workspace-entrypoint.sh +# RUN echo "export RMW_IMPLEMENTATION=rmw_cyclonedds_cpp" >> /usr/local/bin/scripts/workspace-entrypoint.sh +# RUN echo "export CYCLONEDDS_URI=' '" >> /usr/local/bin/scripts/workspace-entrypoint.sh + +# copy the go2py ros2 nodes +COPY deploy/dock_ws/src /nav2_ws/src +# RUN cd /dock_ws && source /opt/ros/humble/setup.bash && colcon build --symlink-install + +# Compile the C++ hypervisor bridge +COPY deploy/dds_bridge /dds_bridge +WORKDIR /dds_bridge +# RUN ./install.sh && mkdir build && cd build && cmake .. && make + +# Copy the script to start the nodes +COPY deploy/scripts /root/scripts +COPY deploy/launch /root/launch +# set the entrypoint to bash +ENTRYPOINT ["/bin/bash"] +# ENTRYPOINT ["/bin/bash", "/root/scripts/dock_hw_start.sh"] diff --git a/Makefile b/Makefile index 3a7a43f..3fd65b1 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,9 @@ docker_dock: docker_robot: @docker build --no-cache --tag go2py_robot_hw:latest -f Dockerfile.robot . +docker_nav: + @docker build --no-cache --tag go2py_nav:latest -f Dockerfile.nav2 . + docker_dock_install: @cp deploy/scripts/go2py-dock-hw-nodes.service /etc/systemd/system/ @systemctl enable go2py-dock-hw-nodes.service