From 6e17afc9809f7180cf19c2e079b10b3caf6ff71d Mon Sep 17 00:00:00 2001 From: Rooholla-KhorramBakht Date: Wed, 8 May 2024 05:40:59 +0800 Subject: [PATCH] nav2 docker added and bridge docker bug is fixed. --- deploy/docker/Dockerfile.bridge | 2 +- deploy/docker/Dockerfile.nav2 | 30 ++++++++++++++++++++++++++++++ scripts/nav2_docker_start.sh | 1 + 3 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 deploy/docker/Dockerfile.nav2 create mode 100755 scripts/nav2_docker_start.sh diff --git a/deploy/docker/Dockerfile.bridge b/deploy/docker/Dockerfile.bridge index cee6953..56506d1 100644 --- a/deploy/docker/Dockerfile.bridge +++ b/deploy/docker/Dockerfile.bridge @@ -20,7 +20,7 @@ cd .. && colcon build --packages-select cyclonedds && source /opt/ros/humble/set # copy the go2py ros2 nodes COPY ros2_nodes/go2py_bridge /bridge_ws/src/go2py_bridge -COPY ros2_nodes/go2py_common /bridge_ws/src/go2py_common +COPY ros2_nodes/go2py_messages /bridge_ws/src/go2py_messages RUN cd /bridge_ws && source /opt/ros/humble/setup.bash && source /unitree_ros2/cyclonedds_ws/install/setup.bash && colcon build --symlink-install # Copy the script to start the nodes diff --git a/deploy/docker/Dockerfile.nav2 b/deploy/docker/Dockerfile.nav2 new file mode 100644 index 0000000..bef1981 --- /dev/null +++ b/deploy/docker/Dockerfile.nav2 @@ -0,0 +1,30 @@ +# 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 \ + libyaml-cpp-dev \ + libboost-all-dev\ + build-essential \ + cmake \ + git \ + ros-humble-nav2-* ros-humble-navigation2 \ + && 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 + +# copy the go2py ros2 nodes +#COPY ros2_nodes/lidar_node /hesai_ws/src/lidar_node +#RUN cd /hesai_ws && source /opt/ros/humble/setup.bash && colcon build --symlink-install + +# Copy the script to start the nodes +#COPY docker/scripts /root/scripts +#COPY launch_files /root/launch +# set the entrypoint to bash +ENTRYPOINT ["/bin/bash"] +#ENTRYPOINT ["/bin/bash", "/root/scripts/hesai_start.sh"] diff --git a/scripts/nav2_docker_start.sh b/scripts/nav2_docker_start.sh new file mode 100755 index 0000000..2f09e3e --- /dev/null +++ b/scripts/nav2_docker_start.sh @@ -0,0 +1 @@ +docker run --rm -it --privileged --network host -v $(pwd)/deploy/ros2_nodes/sportmode_nav2:/home/nav2_ws/src/sportmode_nav2 -v /dev/*:/dev/* -v /etc/localtime:/etc/localtime:ro --runtime nvidia go2py_nav2:latest \ No newline at end of file