30 #include <boost/algorithm/string.hpp> 32 #include <std_srvs/Empty.h> 40 SrhFakeJointCalibrationController::SrhFakeJointCalibrationController()
42 last_publish_time_(0),
43 calibration_state_(IS_INITIALIZED),
53 std::string robot_state_name;
54 node_.
param<std::string>(
"robot_state_name", robot_state_name,
"unique_robot_hw");
58 robot_ = robot->getHandle(robot_state_name).getState();
62 ROS_ERROR_STREAM(
"Could not find robot state: " << robot_state_name <<
" Not loading the controller. " <<
86 ROS_ERROR(
"Could not find joint %s (namespace: %s)",
99 ROS_ERROR(
"Could not find actuator %s (namespace: %s)",
105 string transmission_name;
132 joint_->calibrated_ =
true;
162 string service_name =
ns_ +
"reset_motor_" + boost::to_upper_copy(lowlevel_actuator_name);
168 if (reset_service.
call(srv))
174 ROS_WARN(
"Reset failed: %s", service_name.c_str());
ServiceClient serviceClient(const std::string &service_name, bool persistent=false, const M_string &header_values=M_string())
virtual const char * what() const
bool call(MReq &req, MRes &res)
std::string actuator_name_
ros_ethercat_model::RobotState * robot_
virtual void update(const ros::Time &time, const ros::Duration &period)
ros_ethercat_model::Actuator * actuator_
ros_ethercat_model::JointState * joint_
bool waitForExistence(ros::Duration timeout=ros::Duration(-1))
boost::scoped_ptr< realtime_tools::RealtimePublisher< std_msgs::Empty > > pub_calibrated_
bool param(const std::string ¶m_name, T ¶m_val, const T &default_val) const
const std::string & getNamespace() const
virtual bool init(ros_ethercat_model::RobotStateInterface *robot, ros::NodeHandle &n)
bool getParam(const std::string &key, std::string &s) const
ros::Time last_publish_time_
std::string joint_prefix_
#define ROS_ERROR_STREAM(args)
#define PLUGINLIB_EXPORT_CLASS(class_type, base_class_type)
A Fake joint calibration controller. Only loads the force pid settings from the parameter server...