March 2018
Intermediate to advanced
1396 pages
42h 14m
English
Create a folder called src inside the package and create a C++ file called my_controller_file.cpp, which is the class definition of the above header.
Given in the following is the definition of my_controller_file.cpp, which has to be saved inside the src folder:
#include "my_controller_pkg/my_controller_file.h"#include <pluginlib/class_list_macros.h>namespace my_controller_ns {/// Controller initialization in non-real-timebool MyControllerClass::init(pr2_mechanism_model::RobotState *robot, ros::NodeHandle &n){ std::string joint_name; if (!n.getParam("joint_name", joint_name)) { ROS_ERROR("No joint given in namespace: '%s')", n.getNamespace().c_str()); return false; } joint_state_ = robot->getJointState(joint_name); ...