Book Image

ROS Programming: Building Powerful Robots

By : Anil Mahtani, Aaron Martinez, Enrique Fernandez Perdomo, Luis Sánchez, Lentin Joseph
Book Image

ROS Programming: Building Powerful Robots

By: Anil Mahtani, Aaron Martinez, Enrique Fernandez Perdomo, Luis Sánchez, Lentin Joseph

Overview of this book

This learning path is designed to help you program and build your robots using open source ROS libraries and tools. We start with the installation and basic concepts, then continue with the more complex modules available in ROS, such as sensor and actuator integration (drivers), navigation and mapping (so you can create an autonomous mobile robot), manipulation, computer vision, perception in 3D with PCL, and more. We then discuss advanced concepts in robotics and how to program using ROS. You'll get a deep overview of the ROS framework, which will give you a clear idea of how ROS really works. During the course of the book, you will learn how to build models of complex robots, and simulate and interface the robot using the ROS MoveIt motion planning library and ROS navigation stacks. We'll go through great projects such as building a self-driving car, an autonomous mobile robot, and image recognition using deep learning and ROS. You can find beginner, intermediate, and expert ROS robotics applications inside! It includes content from the following Packt products: ? Effective Robotics Programming with ROS - Third Edition ? Mastering ROS for Robotics Programming ? ROS Robotics Projects
Table of Contents (37 chapters)
Title page
Copyright and Credits
Packt Upsell
Preface
Bibliography
Index

Explaining the xacro model of seven DOF arm


We will define 10 links and 9 joints on this robot and 2 links and 2 joints in the robot gripper.

Let's start by discussing the xacro definition:

<?xml version="1.0"?> 
<robot name="seven_dof_arm" 
 xmlns:xacro="http://www.ros.org/wiki/xacro">

Because we are writing a xacro file, we should mention the xacro namespace to parse the file.

Using constants

We use constants inside this xacro to make robot descriptions shorter and readable. Here, we define the degree to the radian conversion factor, PI value, length, height, and width of each of the links:

  <property name="deg_to_rad" value="0.01745329251994329577"/> 
  <property name="M_PI" value="3.14159"/> 
 
  <property name="elbow_pitch_len" value="0.22" /> 
  <property name="elbow_pitch_width" value="0.04" /> 
  <property name="elbow_pitch_height" value="0.04" /> 

Using macros

We define macros in this code to avoid repeatability and...