├── ros_entrypoint.sh ├── README.md └── Dockerfile /ros_entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | # setup ros environment 5 | if [ -z "${SETUP}" ]; then 6 | source "/catkin_ws/devel/setup.bash" 7 | else 8 | source $SETUP 9 | fi 10 | 11 | exec "$@" 12 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Docker for d415/d435 using ROS 2 | 3 | Connect d415 or d435 to your pc and enter following command in your terminal. 4 | 5 | ``` 6 | docker run --rm --net=host --privileged --volume=/dev:/dev -it iory/realsense-ros-docker:kinetic /bin/bash -i -c 'roslaunch realsense2_camera rs_rgbd.launch enable_pointcloud:=true align_depth:=false depth_registered_processing:=true align_depth:=true' 7 | ``` 8 | 9 | If you would like to change ```ROS_MASTER_URI```, 10 | 11 | ``` 12 | docker run --rm --net=host --privileged --volume=/dev:/dev -it iory/realsense-ros-docker:kinetic /bin/bash -i -c 'rossetmaster TARGET_IP; roslaunch realsense2_camera rs_rgbd.launch enable_pointcloud:=true align_depth:=false depth_registered_processing:=true align_depth:=true' 13 | ``` 14 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ros:kinetic 2 | 3 | LABEL maintainer="iory ab.ioryz@gmail.com" 4 | 5 | ENV ROS_DISTRO kinetic 6 | 7 | RUN apt -q -qq update && \ 8 | DEBIAN_FRONTEND=noninteractive apt install -y \ 9 | software-properties-common \ 10 | wget \ 11 | apt-transport-https 12 | 13 | RUN apt-key adv --keyserver keys.gnupg.net --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE || apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-key F6E65AC044F831AC80A06380C8B3A55A6F3EFCDE 14 | RUN add-apt-repository -y "deb https://librealsense.intel.com/Debian/apt-repo xenial main" 15 | RUN apt-get update -qq 16 | RUN apt-get install librealsense2-dkms --allow-unauthenticated -y 17 | RUN apt-get install librealsense2-dev --allow-unauthenticated -y 18 | 19 | RUN apt -q -qq update && \ 20 | DEBIAN_FRONTEND=noninteractive apt install -y --allow-unauthenticated \ 21 | python-rosinstall \ 22 | python-catkin-tools \ 23 | ros-${ROS_DISTRO}-jsk-tools \ 24 | ros-${ROS_DISTRO}-rgbd-launch \ 25 | ros-${ROS_DISTRO}-image-transport-plugins \ 26 | ros-${ROS_DISTRO}-image-transport 27 | 28 | RUN rosdep update 29 | 30 | RUN mkdir -p /catkin_ws/src && cd /catkin_ws/src && \ 31 | git clone --depth 1 https://github.com/IntelRealSense/realsense-ros.git && \ 32 | git clone --depth 1 https://github.com/pal-robotics/ddynamic_reconfigure 33 | RUN cd catkin_ws; 34 | RUN mv /bin/sh /bin/sh_tmp && ln -s /bin/bash /bin/sh 35 | RUN source /opt/ros/${ROS_DISTRO}/setup.bash; cd catkin_ws; catkin build -DCATKIN_ENABLE_TESTING=False -DCMAKE_BUILD_TYPE=Release 36 | RUN rm /bin/sh && mv /bin/sh_tmp /bin/sh 37 | RUN touch /root/.bashrc && \ 38 | echo "source /catkin_ws/devel/setup.bash\n" >> /root/.bashrc && \ 39 | echo "rossetip\n" >> /root/.bashrc && \ 40 | echo "rossetmaster localhost" 41 | 42 | RUN rm -rf /var/lib/apt/lists/* 43 | 44 | COPY ./ros_entrypoint.sh / 45 | ENTRYPOINT ["/ros_entrypoint.sh"] 46 | 47 | CMD ["bash"] 48 | --------------------------------------------------------------------------------