Skip to content

AndriyPt/ros-navigation-examples

Repository files navigation

ros-navigation-examples

Some examples of ROS based navigation

Docker

For convenience it is recommended to use Docker containers. Please follow these steps to run Docker container on your machine.

  1. Install Desktop OS Ubuntu Trusty or Xenial on your machine or in virtual machine
  2. Install Docker-CE using these instructions
  3. In order to executed Docker without sudo please execute
sudo usermod -aG docker $USER
  1. Logout and login to your machine again :)
  2. For development the following docker container was used.
  3. To pull it please run
docker pull shadowrobot/build-tools:xenial-kinetic-ide
  1. Use the following command to start Docker container for simulation only
docker run -it --name navigation_demo -e DISPLAY -e LOCAL_USER_ID=$(id -u) -v /tmp/.X11-unix:/tmp/.X11-unix:rw shadowrobot/build-tools:xenial-kinetic-ide

In case if you have real robot you should start the following Docker container

docker run -it --name navigation_demo -e DISPLAY -e LOCAL_USER_ID=$(id -u) --device=/dev/ttyACM0  -v /tmp/.X11-unix:/tmp/.X11-unix:rw shadowrobot/build-tools:xenial-kinetic-ide
  1. Black window of Terminator UI console will appear after some time.
  2. You can use it's features to split terminal window into smaller terminals and run few commands in parallel (Ctrl+Shift+E).
  3. If you want to run real robot add user to dialout group and restart Docker container
sudo usermod -a -G dialout user

In order to relaunch docker container after you closed Terminator window or rebooted machine please run

docker start navigation_demo

After some time Terminator window will reappear.

Setup

Download Gazebo models for first time

bash <( curl -Ls https://raw.githubusercontent.com/shadow-robot/sr-build-tools/master/docker/utils/load_gazebo_models.sh)

Install ROS and compile source code (it will ask you for sudo password at some point, just press Enter)

bash <(curl -Ls https://raw.githubusercontent.com/shadow-robot/sr-build-tools/master/ansible/deploy.sh) -o AndriyPt -r ros-navigation-examples -b kinetic-devel -v kinetic

Source workspace which is located here ~/workspace/ros-navigation-examples/base/

source ~/workspace/ros-navigation-examples/base/devel/setup.bash

Navigating on known map

Start simulation

roslaunch moon_launch simulation.launch

or real robot

roslaunch moon_launch real_robot.launch

Launch navigation stack (in order to launch second command split Terminator window by two using Ctrl-Shift-E. More information on Terminator shortcuts can be found here)

roslaunch moon_launch navigation.launch

In RViz which appear after some time select "2D Nav Goal" and robot will travel to it. Like it is shown in this video.

Building the map

Start simulation

roslaunch moon_launch simulation.launch

or real robot

roslaunch moon_launch real_robot.launch

Launch gmapping node

roslaunch moon_launch gmapping.launch

Drive arround environment to build map using the following keys. Please note that console window with gmapping launch file should be active in order to teleoperate robot using keys

Save map to file

rosrun map_server map_saver -f <map_file_name>

About

Some examples of ROS based navigation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published