Title Page Copyright and Credits Mastering ROS for Robotics Programming Second Edition www.PacktPub.com Why subscribe? PacktPub.com Contributors About the authors About the reviewer Packt is searching for authors like you Preface Who this book is for What this book covers To get the most out of this book Download the example code files Download the color images Conventions used Get in touch Reviews Introduction to ROS Why should we learn ROS? Why we prefer ROS for robots Why some do not prefer ROS for robots Understanding the ROS filesystem level ROS packages ROS metapackages ROS messages The ROS services Understanding the ROS computation graph level ROS nodes ROS messages ROS topics ROS services ROS bags The ROS Master Using the ROS parameter ROS community level What are the prerequisites for starting with ROS? Running the ROS Master and the ROS parameter server Checking the roscore command output Questions Summary Getting Started with ROS Programming Creating a ROS package Working with ROS topics Creating ROS nodes Building the nodes Adding custom msg and srv files Working with ROS services Working with ROS actionlib Creating the ROS action server Creating the ROS action client Building the ROS action server and client Creating launch files Applications of topics, services, and actionlib Maintaining the ROS package Releasing your ROS package Preparing the ROS package for the release Releasing our package Creating a Wiki page for your ROS package Questions Summary Working with 3D Robot Modeling in ROS ROS packages for robot modeling Understanding robot modeling using URDF Creating the ROS package for the robot description Creating our first URDF model Explaining the URDF file Visualizing the 3D robot model in RViz Interacting with pan-and-tilt joints Adding physical and collision properties to a URDF model Understanding robot modeling using xacro Using properties Using the math expression Using macros Converting xacro to URDF Creating the robot description for a seven DOF robot manipulator Arm specification Type of joints Explaining the xacro model of the seven DOF arm Using constants Using macros Including other xacro files Using meshes in the link Working with the robot gripper Viewing the seven DOF arm in RViz Understanding joint state publisher Understanding robot state publisher Creating a robot model for the differential drive mobile robot Questions Summary Simulating Robots Using ROS and Gazebo Simulating the robotic arm using Gazebo and ROS Creating the robotic arm simulation model for Gazebo Adding colors and textures to the Gazebo robot model Adding transmission tags to actuate the model Adding the gazebo_ros_control plugin Adding a 3D vision sensor to Gazebo Simulating the robotic arm with Xtion Pro Visualizing the 3D sensor data Moving robot joints using ROS controllers in Gazebo Understanding the ros_control packages Different types of ROS controllers and hardware interfaces How the ROS controller interacts with Gazebo Interfacing joint state controllers and joint position controllers to the arm Launching the ROS controllers with Gazebo Moving the robot joints Simulating a differential wheeled robot in Gazebo Adding the laser scanner to Gazebo Moving the mobile robot in Gazebo Adding joint state publishers in the launch file Adding the ROS teleop node Questions Summary Simulating Robots Using ROS and V-REP Setting up V-REP with ROS Understanding the vrep_plugin Interacting with V-REP using ROS services Interacting with V-REP using ROS topics Simulating the robotic arm using V-REP and ROS Adding the ROS interface to V-REP joint controllers Simulating a differential wheeled robot in V-REP Adding a laser sensor to V-REP Adding a 3D vision sensor to V-REP Questions Summary Using the ROS MoveIt! and Navigation Stack Installing MoveIt! MoveIt! architecture The move_group node Motion planning using MoveIt! Motion planning request adapters MoveIt! planning scene MoveIt! kinematics handling MoveIt! collision checking Generating MoveIt! configuration package using the Setup Assistant tool Step 1 – Launching the Setup Assistant tool Step 2 – Generating the Self-Collision matrix Step 3 – Adding virtual joints Step 4 – Adding planning groups Step 5 – Adding the robot poses Step 6 – Setting up the robot end effector Step 7 – Adding passive joints Step 8 – Author information Step 9 – Generating configuration files Motion planning of robot in RViz using MoveIt! configuration package Using the RViz Motion Planning plugin Interfacing the MoveIt! configuration package to Gazebo Step 1 – Writing the controller configuration file for MoveIt! Step 2 – Creating the controller launch files Step 3 – Creating the controller configuration file for Gazebo Step 4 – Creating the launch file for Gazebo trajectory controllers Step 5 – Debugging the Gazebo- MoveIt! interface Understanding the ROS Navigation stack ROS Navigation hardware requirements Working with Navigation packages Understanding the move_base node Working of Navigation stack Localizing on the map Sending a goal and path planning Collision recovery behavior Sending the command velocity Installing the ROS Navigation stack Building a map using SLAM Creating a launch file for gmapping Running SLAM on the differential drive robot Implementing autonomous navigation using amcl and a static map Creating an amcl launch file Questions Summary Working with pluginlib, Nodelets, and Gazebo Plugins Understanding pluginlib Creating plugins for the calculator application using pluginlib Working with the pluginlib_calculator package Step 1 - Creating the calculator_base header file Step 2 - Creating the calculator_plugins header file Step 3 - Exporting plugins using the calculator_plugins.cpp Step 4 - Implementing  the plugin loader using the calculator_loader.cpp Step 5 - Creating the plugin description file: calculator_plugins.xml Step 6 - Registering the plugin with the ROS package system Step 7 - Editing the CMakeLists.txt file Step 8 - Querying the list of plugins in a package Step 9 - Running the plugin loader Understanding ROS nodelets Creating a nodelet Step 1 - Creating a package for a nodelet Step 2 - Creating the hello_world.cpp nodelet Step 3 - Explanation of hello_world.cpp Step 4 - Creating the plugin description file Step 5 - Adding the export tag in package.xml Step 6 - Editing CMakeLists.txt Step 7 - Building and running nodelets Step 8 - Creating launch files for nodelets Understanding the Gazebo plugins Creating a basic world plugin Questions Summary Writing ROS Controllers and Visualization Plugins Understanding ros_control packages The controller_interface package Initializating the controller Starting the ROS controller Updating the ROS controller Stopping the controller The controller_manager Writing a basic joint controller in ROS Step 1 - Creating the controller package Step 2 – Creating the controller header file Step 3 – Creating the controller source file Step 4 – Explaining the controller source file Step 5 – Creating the plugin description file Step 6 – Updating package.xml Step 7 – Updating CMakeLists.txt Step 8 – Building the controller Step 9 – Writing the controller configuration file Step 10 – Writing the launch file for the controller Step 11 – Running the controller along with the seven dof arm in Gazebo Understanding the ROS visualization tool (RViz) and its plugins Displays panel RViz toolbar Views Time panel Dockable panels Writing an RViz plugin for teleoperation Methodology of building the RViz plugin Step 1 – Creating the RViz plugin package Step 2 – Creating the RViz plugin header file Step 3 – Creating the RViz plugin definition Step 4 – Creating the plugin description file Step 5 – Adding the export tags in package.xml Step 6 – Editing CMakeLists.txt Step 7 – Building and loading plugins Questions Summary Interfacing I/O Boards, Sensors, and Actuators to ROS Understanding the Arduino-ROS interface What is the Arduino-ROS interface? Understanding the rosserial package in ROS Installing rosserial packages on Ubuntu 16.04 Understanding ROS node APIs in Arduino ROS - Arduino Publisher and Subscriber example Arduino-ROS, example - blink LED and push button Arduino-ROS, example - Accelerometer ADXL 335 Arduino-ROS, example - ultrasonic distance sensor Equations to find distance using the ultrasonic range sensor Arduino-ROS example - Odometry Publisher Interfacing non-Arduino boards to ROS Setting ROS on Odroid-XU4 and Raspberry Pi 2 How to install an OS image to Odroid-XU4 and Raspberry Pi 2 Installation in Windows Installation in Linux Connecting to Odroid-XU4 and Raspberry Pi 2 from a PC Configuring an Ethernet hotspot for Odroid-XU4 and Raspberry Pi 2 Installing Wiring Pi on Odroid-XU4 Installing Wiring Pi on Raspberry Pi 2 Blinking LED using ROS on Raspberry Pi 2 Push button + blink LED using ROS on Raspberry Pi 2 Running examples in Raspberry Pi 2 Interfacing DYNAMIXEL actuators to ROS Questions Summary Programming Vision Sensors Using ROS, Open CV, and PCL Understanding ROS – OpenCV interfacing packages Understanding ROS - PCL interfacing packages Installing ROS perception Interfacing USB webcams in ROS Working with ROS camera calibration Converting images between ROS and OpenCV using cv_bridge Image processing using ROS and OpenCV Step 1 – Creating a ROS package for the experiment Step 2 – Creating source files Step 3 – Explanation of the code Publishing and subscribing images using image_transport Converting OpenCV to ROS images using cv_bridge Finding edges on the image Visualizing raw and edge-detected-images Step 4 – Editing the CMakeLists.txt file Step 5 – Building and running an example Interfacing Kinect and Asus Xtion Pro in ROS Interfacing Intel Real Sense camera with ROS Working with a point cloud to a laser scan package Interfacing Hokuyo Laser in ROS Working with point cloud data How to publish a point cloud How to subscribe and process the point cloud Writing data to a Point Cloud Data (PCD) file Reading and publishing a point cloud from a PCD file Working with AR Marker detection for object pose estimation Using AprilTag with ROS Questions Summary Building and Interfacing Differential Drive Mobile Robot Hardware in ROS Introducing to Chefbot – a DIY mobile robot and its hardware configuration Flashing Chefbot firmware using Energia IDE Serial data sending protocol from LaunchPad to PC Serial data sending protocol from PC to Launchpad Discussing Chefbot interface packages on ROS Computing odometry from encoder ticks Computing motor velocities from ROS twist message Running the robot standalone launch file using C++ nodes Configuring the Navigation stack for Chefbot Configuring the gmapping node Configuring the Navigation stack packages Common configuration local_costmap and global_costmap Configuring global costmap parameters Configuring local costmap parameters Configuring base local planner parameters Configuring DWA local planner parameters Configuring move_base node parameters Understanding AMCL Understanding RViz for working with the Navigation stack 2D Pose Estimate button Visualizing the particle cloud The 2D Nav Goal button Displaying the static map Displaying the robot footprint Displaying the global and local cost map Displaying the global plan, the local plan, and the planner plan The current goal Obstacle avoidance using the Navigation stack Working with Chefbot simulation Building a room in Gazebo Adding model files to the Gazebo model folder Sending a goal to the Navigation stack from a ROS node Questions Summary Exploring the Advanced Capabilities of ROS-MoveIt! Motion planning using the move_group C++ interface Motion planning a random path using MoveIt! C++ APIs Motion planning a custom path using MoveIt! C++ APIs Collision checking with a robot arm using MoveIt! Adding a collision object to MoveIt! Removing a collision object from the planning scene Attaching a collision object to a robot link Checking self-collisions using MoveIt! APIs Working with perception using MoveIt! and Gazebo Manipulating objects with MoveIt! Working with a robot pick-and-place task using MoveIt! Calculating grasp poses with GPD Pick and place action in Gazebo and real robot Understanding DYNAMIXEL ROS Servo controllers for robot hardware interfacing The DYNAMIXEL servos DYNAMIXEL-ROS interface Interfacing 7 DOF DYNAMIXEL-based robotic arm to ROS MoveIt! Creating a controller package for a COOL arm robot MoveIt! configuration of the COOL Arm Questions Summary Using ROS in MATLAB and Simulink Getting started with MATLAB and MATLAB-ROS Getting started with the Robotic System Toolbox and ROS-MATLAB interface Starting with ROS topics and MATLAB callback functions Implementing an obstacle avoidance system for a Turtlebot robot Getting started with ROS and Simulink Creating a wave signal integrator in Simulink Working with ROS messages in Simulink Publishing a ROS message in Simulink Subscribing to a ROS topic in Simulink Developing a simple control system in Simulink Configuring the Simulink model Questions Summary ROS for Industrial Robots Understanding ROS-Industrial packages Goals of ROS-Industrial ROS-Industrial – a brief history Benefits of ROS-Industrial Installing ROS-Industrial packages Block diagram of ROS-Industrial packages Creating a URDF for an industrial robot Creating the MoveIt! configuration for an industrial robot Updating the MoveIt! configuration files Testing the MoveIt! configuration Installing ROS-Industrial packages of  Universal robotic arms Installing the ROS interface of Universal Robots Understanding the Moveit! configuration of a Universal Robot arm Getting started with real Universal Robots hardware and ROS-I Working with MoveIt! configuration of ABB robots Understanding the ROS-Industrial robot support packages Visualizing the ABB robot model in RViz ROS-Industrial robot client package Designing industrial robot client nodes ROS-Industrial robot driver package Understanding the MoveIt! IKFast plugin Creating the MoveIt! IKFast plugin for the ABB IRB 6640 robot Prerequisites for developing the MoveIt! IKFast plugin OpenRave and IK Fast modules MoveIt! IKFast Installing the MoveIt! IKFast package Installing OpenRave on Ubuntu 16.04 Creating the COLLADA file of a robot to work with OpenRave Generating the IKFast CPP file for the IRB 6640 robot Creating the MoveIt! IKFast plugin Questions Summary Troubleshooting and Best Practices in ROS Setting up RoboWare Studio in Ubuntu Installing/uninstalling RoboWare Studio Getting started with RoboWare Studio Create ROS packages in RoboWare Studio Building ROS workspace in RoboWare Studio Executing ROS nodes in RoboWare Studio Starting ROS tools from the RoboWare interface Handling active ROS topics, nodes, and services Creating ROS nodes and classes with RoboWare tools ROS package manager in RoboWare Studio Best practices in ROS ROS C++ coding style guide Standard naming conventions used in ROS Code license agreement ROS code formatting Console output Best practices in the ROS package Important troubleshooting tips in ROS Using roswtf Questions Summary Other Books You May Enjoy Leave a review - let other readers know what you think