27 #ifndef _SRH_CONTROLLER_HPP_ 28 #define _SRH_CONTROLLER_HPP_ 33 #include <ros_ethercat_model/robot_state_interface.hpp> 35 #include <boost/scoped_ptr.hpp> 36 #include <boost/thread/condition.hpp> 38 #include <std_msgs/Float64.h> 39 #include <std_srvs/Empty.h> 40 #include <control_msgs/JointControllerState.h> 45 #include <sr_robot_msgs/SetPidGains.h> 73 virtual bool resetGains(std_srvs::Empty::Request &req, std_srvs::Empty::Response &resp)
78 virtual void getGains(
double &p,
double &i,
double &d,
double &i_max,
double &i_min)
112 double clamp_command(
double cmd,
double min_cmd,
double max_cmd);
void get_min_max(urdf::Model model, std::string joint_name)
ros_ethercat_model::JointState * joint_state_
ros::Subscriber sub_max_force_factor_
double eff_min_
Min and max range of the effort, used to clamp the command.
virtual void getGains(double &p, double &i, double &d, double &i_max, double &i_min)
boost::scoped_ptr< realtime_tools::RealtimePublisher< control_msgs::JointControllerState > > controller_state_publisher_
virtual bool resetGains(std_srvs::Empty::Request &req, std_srvs::Empty::Response &resp)
virtual bool init(ros_ethercat_model::RobotStateInterface *robot, ros::NodeHandle &n)=0
ros_ethercat_model::JointState * joint_state_2
boost::scoped_ptr< sr_friction_compensation::SrFrictionCompensator > friction_compensator
void maxForceFactorCB(const std_msgs::Float64ConstPtr &msg)
double clamp_command(double cmd, double min_cmd, double max_cmd)
ros::Subscriber sub_command_
ros_ethercat_model::RobotState * robot_
Compensate the tendon friction by adding a given value depending on the sign of the force demand...
int friction_deadband
the deadband for the friction compensation algorithm
virtual void starting(const ros::Time &time)
double min_
Min and max range of the joint, used to clamp the command.
std::string getJointName()
double vel_min_
Min and max range of the velocity, used to clamp the command.
double max_force_demand
clamps the force demand to this value
void get_joints_states_1_2()
ros::ServiceServer serve_set_gains_
virtual void setCommandCB(const std_msgs::Float64ConstPtr &msg)
set the command from a topic
virtual void update(const ros::Time &time, const ros::Duration &period)=0
Issues commands to the joint. Should be called at regular intervals.
sr_deadband::HysteresisDeadband< double > hysteresis_deadband
We're using an hysteresis deadband.
void after_init()
call this function at the end of the init function in the inheriting classes.
ros::ServiceServer serve_reset_gains_