Skip to Content
Mastering ROS for Robotics Programming - Second Edition
book

Mastering ROS for Robotics Programming - Second Edition

by Lentin Joseph, Jonathan Cacace
February 2018
Beginner
580 pages
13h 20m
English
Packt Publishing
Content preview from Mastering ROS for Robotics Programming - Second Edition

Sending a goal to the Navigation stack from a ROS node

We have seen how to send a goal position to a robot for moving it from point A to B using the RViz 2D Nav Goal button. Now we will see how to command the robot using the actionlib client and the ROS C++ APIs. The following is a sample package and node for communicating with the Navigation stack move_base node.

The move_base node is SimpleActionServer. We can send and cancel the goals to the robot if the task takes a lot of time to complete.

The following code is SimpleActionClient for the move_base node, which can send the x, y, and theta from the command-line arguments. The following code is in the chefbot_bringup/src folder with the name of send_robot_goal.cpp:

#include <ros/ros.h> ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mastering ROS for Robotics Programming - Third Edition

Mastering ROS for Robotics Programming - Third Edition

Lentin Joseph, Jonathan Cacace
Effective Robotics Programming with ROS - Third Edition

Effective Robotics Programming with ROS - Third Edition

Luis Sanchez, Enrique Fernandez Perdomo, Anil Mahtani

Publisher Resources

ISBN: 9781788478953Supplemental Content