Skip to Content
ROS Programming: Building Powerful Robots
book

ROS Programming: Building Powerful Robots

by Anil Mahtani, Luis Sanchez, Enrique Fernandez, Aaron Martinez, Lentin Joseph
March 2018
Intermediate to advanced content levelIntermediate to advanced
1396 pages
42h 14m
English
Packt Publishing
Content preview from ROS Programming: Building Powerful Robots

Step 2 – Creating controller header file

We will get the header file my_controller_file.h from the chapter_6_codes/my_controller_pkg/include/my_controller_pkg folder.

Given in the following is the header file definition of my_controller_file.h. We have discussed each line of this code while discussing pr2_controller_interface:

#include <pr2_controller_interface/controller.h>#include <pr2_mechanism_model/joint.h>namespace my_controller_ns{//Inheriting Controller class inside pr2_controller_interfaceclass MyControllerClass: public pr2_controller_interface::Controller{private:  pr2_mechanism_model::JointState* joint_state_;  double init_pos_;public:  virtual bool init(pr2_mechanism_model::RobotState *robot,                   ros::NodeHandle &n); virtual void ...
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

Programming Robots with ROS

Programming Robots with ROS

Morgan Quigley, Brian Gerkey, William D. Smart
Machine Learning Design Patterns

Machine Learning Design Patterns

Valliappa Lakshmanan, Sara Robinson, Michael Munn

Publisher Resources

ISBN: 9781788627436Supplemental Content