March 2018
Intermediate to advanced
1396 pages
42h 14m
English
In this section, we can see the explanation of each section of the code:
/// 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)) {
The preceding is the init() function definition of the controller. This will be called when a controller is loaded by the controller manager. Inside the init() function, we are creating an instance of RobotState and NodeHandle , also retrieving a joint name for attaching our controller. This joint name is defined inside the controller configuration file. We can see the controller configuration file in the next section. ...