Book Image

Learning ROS for Robotics Programming

By : Aaron Martinez, Enrique Fernández
Book Image

Learning ROS for Robotics Programming

By: Aaron Martinez, Enrique Fernández

Overview of this book

<p>Both the amateur and the professional roboticist who has ever tried their hand at robotics programming will have faced with the cumbersome task of starting from scratch, usually reinventing the wheel. ROS comes with a great number of already working functionalities, and this book takes you from the first steps to the most elaborate designs possible within this software framework.</p> <p>"Learning ROS for Robotics Programming" is full of practical examples that will help you to understand the framework from the very beginning. Build your own robot applications in a simulated environment and share your knowledge with the large community supporting ROS.</p> <p>"Learning ROS for Robotics Programming" starts with the basic concepts and usage of ROS in a very straightforward and practical manner. It is a painless introduction to the fascinating world of robotics, covering sensor integration, modeling, simulation, computer vision, and navigation algorithms, among other topics.</p> <p>After the first two chapters, concepts like topics, messages, and nodes will become daily bread. Make your robot see with HD cameras, or navigate avoiding obstacles with range sensors. Furthermore, thanks to the contributions of the vast ROS community, your robot will be able to navigate autonomously, and even recognize and interact with you, in a matter of minutes.</p> <p>"Learning ROS for Robotics Programming" will give you all the background you need to know in order to start in the fascinating world of robotics and program your own robot. Simply, you put the limit!</p>
Table of Contents (16 chapters)
Learning ROS for Robotics Programming
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Creating a map with ROS


Getting a map can sometimes be a complicated task if you do not have the correct tools. ROS has a tool that will help you build a map using the odometry and a laser sensor. This tool is the map_server (http://www.ros.org/wiki/slam_gmapping). In this example, you will learn how to use the robot that we created in Gazebo, as we did in the previous chapters, to create a map, to save it, and load it again.

We are going to use a .launch file to make it easy. Create a new file in chapter7_tutorials/launch with the name gazebo_mapping_robot.launch and put in the following code:

<?xml version="1.0"?>
<launch>
  <param name="/use_sim_time" value="true" />

  <!-- start up wg world -->
  <include file="$(find gazebo_worlds)/launch/wg_collada_world.launch"/>

  <arg name="model" />
  <param name="robot_description" command="$(find xacro)/xacro.py $(arg model)" />

  <node name="spawn_robot" pkg="gazebo" type="spawn_model" args="-urdf...