srh_joint_variable_pid_position_controller.hpp
Go to the documentation of this file.
1 
30 #ifndef _SRH_JOINT_VARIABLE_PID_POSITION_CONTROLLER_HPP_
31 #define _SRH_JOINT_VARIABLE_PID_POSITION_CONTROLLER_HPP_
32 
35 
36 
37 namespace controller
38 {
40  public SrController
41 {
42 public:
44 
45  bool init(ros_ethercat_model::RobotStateInterface *robot, ros::NodeHandle &n);
46 
47  virtual void starting(const ros::Time &time);
48 
52  virtual void update(const ros::Time &time, const ros::Duration &period);
53 
54  virtual void getGains(double &p, double &i, double &d, double &i_max, double &i_min);
55 
56  virtual bool resetGains(std_srvs::Empty::Request &req, std_srvs::Empty::Response &resp);
57 
58  bool setGains(sr_robot_msgs::SetPidGains::Request &req, sr_robot_msgs::SetPidGains::Response &resp);
59 
60  virtual void updatePid(double, double);
61 
62 private:
64  boost::scoped_ptr<PlainPid> pid_controller_position_;
65 
68 
70  double p_init_;
71  double i_init_;
72  double d_init_;
73  double i_clamp_;
74  double error_old_;
76  double frequency_;
82 
85 
87  void read_parameters();
88 
90  void setCommandCB(const std_msgs::Float64ConstPtr &msg);
91 
92  void resetJointState();
93 };
94 } // namespace controller
95 
96 /* For the emacs weenies in the crowd.
97 Local Variables:
98  c-basic-offset: 2
99 End:
100 */
101 
102 
103 #endif
d
void setCommandCB(const std_msgs::Float64ConstPtr &msg)
set the position target from a topic
double position_deadband_
the position deadband value used in the hysteresis_deadband
void read_parameters()
read all the controller settings from the parameter server
virtual bool resetGains(std_srvs::Empty::Request &req, std_srvs::Empty::Response &resp)
A generic controller for the Shadow Robot EtherCAT hand&#39;s joints.
robot
bool setGains(sr_robot_msgs::SetPidGains::Request &req, sr_robot_msgs::SetPidGains::Response &resp)
boost::scoped_ptr< PlainPid > pid_controller_position_
Internal PID controller for the position loop.
virtual void getGains(double &p, double &i, double &d, double &i_max, double &i_min)
bool init(ros_ethercat_model::RobotStateInterface *robot, ros::NodeHandle &n)
virtual void update(const ros::Time &time, const ros::Duration &period)
Issues commands to the joint. Should be called at regular intervals.
sr_deadband::HysteresisDeadband< double > hysteresis_deadband
We&#39;re using an hysteresis deadband.


sr_mechanism_controllers
Author(s): Ugo Cupcic
autogenerated on Tue Oct 13 2020 03:55:58