Stretch

Mapping

Dockerfile

ARG ROS_DISTRO=noetic

FROM osrf/ros:$ROS_DISTRO-desktop-full

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

# nvidia-container-runtime
ENV NVIDIA_VISIBLE_DEVICES \
    ${NVIDIA_VISIBLE_DEVICES:-all}
ENV NVIDIA_DRIVER_CAPABILITIES \
    ${NVIDIA_DRIVER_CAPABILITIES:+$NVIDIA_DRIVER_CAPABILITIES,}graphics


RUN sudo apt update && apt install python3-rosdep git-all -y

WORKDIR /ros_ws


	
# clone robot github repositories
RUN mkdir src && \
	git clone -b noetic https://github.com/hello-robot/stretch_ros.git src/stretch_ros


# build ROS workspace
RUN source /opt/ros/$ROS_DISTRO/setup.bash
	
RUN apt update && apt install -y \
		nano \
		python3-pip \
		ros-$ROS_DISTRO-move-base-msgs \
		ros-$ROS_DISTRO-robot-localization \
		ros-$ROS_DISTRO-xacro \
		ros-$ROS_DISTRO-transmission-interface \
		ros-$ROS_DISTRO-controller-manager \
		ros-$ROS_DISTRO-robot-state-publisher \
		ros-noetic-joy \
		ros-noetic-teleop-twist-joy \
		ros-noetic-teleop-twist-keyboard \
		ros-noetic-laser-proc \
		ros-noetic-rgbd-launch \
		ros-noetic-rosserial-arduino \
		ros-noetic-rosserial-python \
		ros-noetic-rosserial-client \
		ros-noetic-rosserial-msgs \ 
		ros-noetic-amcl \
		ros-noetic-map-server \
		ros-noetic-move-base \ 
		ros-noetic-urdf \ 
		ros-noetic-xacro \
		ros-noetic-compressed-image-transport \
		ros-noetic-rqt* \
		ros-noetic-rviz \
		ros-noetic-gmapping \ 
		ros-noetic-navigation \ 
		ros-numpy \
		ros-$ROS_DISTRO-realsense2-camera \
		ros-$ROS_DISTRO-realsense2-description \
		ros-noetic-interactive-markers && \
		
	python3 -m pip install hello-robot-stretch-body && \
	python3 -m pip install hello-robot-stretch-body-tools && \
	python3 -m pip install hello-robot-stretch-factory && \
	python3 -m pip install hello-robot-stretch-tool-share && \
	python3 -m pip install hello-robot-stretch-diagnostics && \
	python3 -m pip install hello-robot-stretch-urdf && \
	python3 -m pip install prompt_toolkit && \
	python3 -m pip uninstall -y setuptools-scm
	
RUN source /opt/ros/$ROS_DISTRO/setup.bash && \ 
	catkin_make -DCATKIN_ENABLE_TESTING=0 -DCMAKE_BUILD_TYPE=Release
	
RUN echo ". /opt/ros/$ROS_DISTRO/setup.bash" >> ~/.bashrc && \
	echo ". /ros_ws/devel/setup.bash" >> ~/.bashrc && \
	# allows us to run: docker exec -it rosbot bash --login -c "rostopic list"
	echo ". /opt/ros/$ROS_DISTRO/setup.bash" >> ~/.profile && \
	echo ". /ros_ws/devel/setup.bash" >> ~/.profile

WORKDIR /

ENTRYPOINT ["/ros_entrypoint.sh"]
CMD ["bash"]

Last updated