46 joint_name_(joint_name)
48 pair<vector<joint_calibration::Point>, vector<joint_calibration::Point> > both_maps =
read_friction_map();
59 double compensation = 0.0;
61 if (force_demand > 0.0)
89 if (
abs(force_demand) < deadband)
95 static_cast<double> (deadband), 1.0);
106 vector<joint_calibration::Point> friction_map_forward, friction_map_backward;
107 string param_name =
"/sr_friction_map";
109 bool joint_not_found_forward =
true;
110 bool joint_not_found_backward =
true;
122 for (int32_t index_cal = 0; index_cal < calib.
size(); ++index_cal)
130 string joint_name_tmp =
static_cast<string> (calib[index_cal][0]);
139 if (static_cast<int> (calib[index_cal][1]) == 1)
141 joint_not_found_forward =
false;
147 joint_not_found_backward =
false;
154 if (joint_not_found_forward)
161 if (joint_not_found_backward)
177 pair<vector<joint_calibration::Point>, vector<joint_calibration::Point> > both_maps;
178 both_maps.first = friction_map_forward;
179 both_maps.second = friction_map_backward;
186 vector<joint_calibration::Point> friction_map;
189 for (int32_t index_table = 0; index_table < raw_map.
size(); ++index_table)
201 friction_map.push_back(point_tmp);
209 vector<joint_calibration::Point> friction_map;
214 friction_map.push_back(point_tmp);
216 friction_map.push_back(point_tmp);
std::vector< joint_calibration::Point > generate_flat_map()
static const double velocity_for_static_friction
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)
std::size_t size(custom_string const &s)
SrFrictionCompensator(const std::string &joint_name)
static double to_rad(double degrees)
Type const & getType() const
Compensate the tendon friction by adding a given value depending on the sign of the force demand...
boost::scoped_ptr< shadow_robot::JointCalibration > friction_interpoler_backward
An interpolator for the backward friction map: used to compute the offset from the map...
bool getParam(const std::string &key, std::string &s) const
static double linear_interpolate_(double x, double x0, double y0, double x1, double y1)
ros::NodeHandle node_
node handle for reading the map from the parameters server.
#define ROS_DEBUG_STREAM(args)
bool hasParam(const std::string &key) const
INLINE Rall1d< T, V, S > exp(const Rall1d< T, V, S > &arg)
#define ROS_INFO_STREAM(args)
INLINE Rall1d< T, V, S > abs(const Rall1d< T, V, S > &x)
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...