Step 2 – Creating the controller header file

We will get the header file my_controller.h from the my_controller/src/ folder. Given in the following is the header file definition of my_controller.h. As already stated, in this header we are going to implement the functions contained in the controller_interface::Controller class:

#include <controller_interface/controller.h> #include <hardware_interface/joint_command_interface.h> #include <pluginlib/class_list_macros.h> namespace my_controller_ns { class MyControllerClass: public controller_interface::Controller<hardware_interface::PositionJointInterface> { public: bool init(hardware_interface::PositionJointInterface* hw, ros::NodeHandle &n); void update(const ros::Time& time, const ros::Duration& ...

Get Mastering ROS for Robotics Programming - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.