sr_friction_compensation.hpp
Go to the documentation of this file.
1 /*
2 * Copyright 2011 Shadow Robot Company Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the Free
6 * Software Foundation version 2 of the License.
7 *
8 * This program is distributed in the hope that it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
12 *
13 * You should have received a copy of the GNU General Public License along
14 * with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16 
27 #ifndef _SR_FRICTION_COMPENSATION_HPP_
28 #define _SR_FRICTION_COMPENSATION_HPP_
29 
30 #include <ros/node_handle.h>
31 
32 #include <boost/scoped_ptr.hpp>
33 
34 #include <utility>
35 #include <string>
36 #include <vector>
37 
38 #include <control_toolbox/pid.h>
39 #include <boost/thread/condition.hpp>
41 #include <std_msgs/Float64.h>
42 
43 
44 #include <sr_robot_msgs/SetMixedPositionVelocityPidGains.h>
45 
47 
49 {
51 {
52 public:
53  explicit SrFrictionCompensator(const std::string &joint_name);
54 
56 
79  double friction_compensation(double position, double velocity, int force_demand, int deadband);
80 
81 private:
84 
93  std::pair<std::vector<joint_calibration::Point>, std::vector<joint_calibration::Point> > read_friction_map();
94 
103  std::vector<joint_calibration::Point> read_one_way_map(XmlRpc::XmlRpcValue &raw_map);
104 
111  std::vector<joint_calibration::Point> generate_flat_map();
112 
114  boost::scoped_ptr<shadow_robot::JointCalibration> friction_interpoler_forward;
116  boost::scoped_ptr<shadow_robot::JointCalibration> friction_interpoler_backward;
117 
118  // the joint name
119  std::string joint_name_;
120 
121  // the threshold under which we use the static friction map
122  static const double velocity_for_static_friction;
123 };
124 } // namespace sr_friction_compensation
125 
126 /* For the emacs weenies in the crowd.
127 Local Variables:
128  c-basic-offset: 2
129 End:
130 */
131 
132 
133 #endif
std::vector< joint_calibration::Point > generate_flat_map()
std::pair< std::vector< joint_calibration::Point >, std::vector< joint_calibration::Point > > read_friction_map()
double friction_compensation(double position, double velocity, int force_demand, int deadband)
boost::scoped_ptr< shadow_robot::JointCalibration > friction_interpoler_backward
An interpolator for the backward friction map: used to compute the offset from the map...
ros::NodeHandle node_
node handle for reading the map from the parameters server.
std::vector< joint_calibration::Point > read_one_way_map(XmlRpc::XmlRpcValue &raw_map)
boost::scoped_ptr< shadow_robot::JointCalibration > friction_interpoler_forward
An interpolator for the forward friction map: used to compute the offset from the map...


sr_mechanism_controllers
Author(s): Ugo Cupcic
autogenerated on Mon Feb 28 2022 23:52:30