Chapter 8. The Navigation Stack – Robot Setups

In the previous chapters, we have seen how to create our robot, mount some sensors and actuators, and move it through the virtual world using a joystick or the keyboard. Now, in this chapter, you will learn what is probably one of the most powerful features in ROS, something that will let you move your robot autonomously.

Thanks to the community and the shared code, ROS has many algorithms that can be used for navigation.

First of all, in this chapter, you will learn all the necessary ways to configure the navigation stack with your robot. In the next chapter, you will learn how to configure and launch the navigation stack on the simulated robot, giving goals and configuring some parameters to get the best results. In particular, we will cover the following topics in this chapter:

  • Introduction to the navigation stacks and their powerful capabilities—clearly one of the greatest pieces of software that comes with ROS.
  • The tf—showing the transformation of one physical element to the other from the frame; for example, the data received using a sensor or the command for the desired position of an actuator. tf is a library for keeping track of the coordinate frames.
  • Creating a laser driver or simulating it.
  • Computing and publishing the odometry and how this is provided by Gazebo.
  • Base controllers and creating one for your robot.
  • Executing SLAM (Simultaneous Localization And Mapping) with ROS—building a map from the environment with your robot as it moves through it. Localizing your robot in the map using the AMCL algorithm of the navigation stack. AMCL is a probabilistic localization system for a robot moving in 2D. It implements the adaptive Monte Carlo localization approach, which uses a particle filter to track the pose of a robot against a known map.

The navigation stack in ROS

In order to understand the navigation stack, you should think of it as a set of algorithms that use the sensors of the robot and the odometry so that you can control the robot using a standard message. It can move your robot without any problems, such as crashing, getting stuck in a location, or getting lost to another position.

You would assume that this stack can be easily used with any robot. This is almost true, but it is necessary to tune some configuration files and write some nodes to use the stack.

The robot must satisfy some requirements before it uses the navigation stack:

  • The navigation stack can only handle a differential drive and holonomic-wheeled robots. The shape of the robot must either be a square or a rectangle. However, it can also do certain things with biped robots, such as robot localization, as long as the robot does not move sideways.
  • It requires that the robot publishes information about the relationships between the positions of all the joints and sensors.
  • The robot must send messages with linear and angular velocities.
  • A planar laser must be on the robot to create the map and localization. Alternatively, you can generate something equivalent to several lasers or a sonar, or you can project the values to the ground if they are mounted at another place on the robot.

The following diagram shows you how the navigation stacks are organized. You can see three groups of boxes with colors (gray and white) and dotted lines. The plain white boxes indicate the stacks that are provided by ROS, and they have all the nodes to make your robot really autonomous:

The navigation stack in ROS

In the following sections, we will see how to create the parts marked in gray in the diagram. These parts depend on the platform used; this means that it is necessary to write code to adapt the platform to be used in ROS and to be used by the navigation stack.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset