February 2018
Beginner
580 pages
13h 20m
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 preceding 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.h" namespace my_controller_ns { //Controller initialization bool MyControllerClass::init(hardware_interface::PositionJointInterface* hw, ros::NodeHandle &n) { //Retrieve the joint object to control std::string joint_name; if( !nh.getParam( "joint_name", joint_name ) ) { ROS_ERROR("No joint_name specified"); return false; } joint_ = hw->getHandle("shoulder_pan_joint"); return true; } //Controller startup void ...Read now
Unlock full access