GMapping

Setting

<!-- SLAM -->
  <node pkg="gmapping" type="slam_gmapping" name="gmapping">
      <param name="base_frame"            value="base_link"/>
      <param name="odom_frame"            value="odom" />
      <param name="map_update_interval"   value="3.0"/>
      <param name="maxUrange"             value="15.0"/>
  </node>

Map

image: room.pgm
resolution: 0.050000
origin: [-100.000000, -100.000000, 0.000000]
negate: 0
occupied_thresh: 0.65
free_thresh: 0.196

Docker

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

COPY . src/cris_navigation

# clone robot github repositories
RUN git clone https://github.com/husarion/rosbot_ros.git --branch=noetic src/rosbot_ros && \
    git clone https://github.com/husarion/rosbot_ekf.git --branch=master src/rosbot_ekf && \
    git clone https://github.com/aws-robotics/aws-robomaker-small-house-world.git --branch=ros1 src/aws-robomaker-small-house-world && \
    rosdep update && \
    rosdep install --from-paths src --ignore-src -r -y


# build ROS workspace
RUN source /opt/ros/$ROS_DISTRO/setup.bash && \
	catkin_make -DCATKIN_ENABLE_TESTING=0 -DCMAKE_BUILD_TYPE=Release


RUN apt update && apt install -y \
		python3-pip \
		ros-$ROS_DISTRO-rosserial-python \ 
		ros-$ROS_DISTRO-rosserial-server \
		ros-$ROS_DISTRO-rosserial-client \
		ros-$ROS_DISTRO-rosserial-msgs \
		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 && \
	pip3 install python-periphery && \
	pip3 install sh && \
	pip3 install pyserial && \
	python3 -m pip install --upgrade pyserial


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"]
XAUTH=/tmp/.docker.xauth
if [ ! -f $XAUTH ]
then
    xauth_list=$(xauth nlist :0 | sed -e 's/^..../ffff/')
    if [ ! -z "$xauth_list" ]
    then
        echo $xauth_list | xauth -f $XAUTH nmerge -
    else
        touch $XAUTH
    fi
    chmod a+r $XAUTH
fi

docker run -it \
    --env="DISPLAY=$DISPLAY" \
    --env="QT_X11_NO_MITSHM=1" \
    --volume="/tmp/.X11-unix:/tmp/.X11-unix:rw" \
    --env="XAUTHORITY=$XAUTH" \
    --volume="$XAUTH:$XAUTH" \
    --runtime=nvidia \
    cris_navigation \
    bash

Github

Stretch

Last updated