ObjectContactTurnaroundDetectorBase.h
Go to the documentation of this file.
1 #ifndef OBJECTCONTACTTURNAROUNDDETECTORBASE_H
2 #define OBJECTCONTACTTURNAROUNDDETECTORBASE_H
3 
4 #include "../TorqueFilter/IIRFilter.h"
5 #include <boost/shared_ptr.hpp>
6 #include <iostream>
7 #include <cmath>
8 #include "hrpsys/util/Hrpsys.h"
9 #include <hrpUtil/Eigen3d.h>
10 
12 {
13  public:
16  private:
25  double dt;
27  // detect_count_thre*dt, start_ratio_thre*dt, and other_detect_count_thre*dt are threshould for time.
28  // detect_count_thre*dt : Threshould for time [s] after the first object contact turnaround detection (Wait detect_time_thre [s] after first object contact turnaround detection).
29  // start_count_thre*dt : Threshould for time [s] after the first starting detection (Wait start_time_thre [s] after first start detection).
30  // other_detect_count_thre*dt : Threshould for time [s] to move to MODE_OTHER_DETECTED after the first MODE_DETECTED, that is, do not check contact change other than detected element.
32  detector_total_wrench dtw;
33  std::string print_str;
35  // Parameters which size can be changed, especially for GENERALIZED_WRENCH mode
37  std::vector<process_mode> pmode;
38  std::vector<size_t> count;
39  public:
40  ObjectContactTurnaroundDetectorBase (const double _dt) : axis(-1*hrp::Vector3::UnitZ()), moment_center(hrp::Vector3::Zero()),
41  constraint_conversion_matrix1(std::vector<hrp::dvector6>(1, hrp::dvector6::Zero())), constraint_conversion_matrix2(std::vector<hrp::dvector6>(1, hrp::dvector6::Zero())), filtered_resultant_wrench_with_hold(hrp::dvector6::Zero()),
42  dt(_dt), detect_ratio_thre(0.01), start_ratio_thre(0.5), forgetting_ratio_thre(1e3), // Too large threshold for forgetting ratio. Forgetting ratio is disabled by default.
43  max_time(0.0), current_time(0.0),
44  detect_count_thre(5), start_count_thre(5), other_detect_count_thre(round(detect_count_thre*1.5)), dtw(TOTAL_FORCE),
45  is_filter_reset(false), is_hold_values(false), is_other_constraint_detected(false),
46  ref_dwrench(std::vector<double>(1, 0.0)), raw_wrench(std::vector<double>(1, 0.0)), filtered_wrench_with_hold(std::vector<double>(1, 0.0)), filtered_friction_coeff_wrench_with_hold(std::vector<double>(1, 0.0)),
47  phi1(std::vector<double>(1, 0.0)), phi2(std::vector<double>(1, 0.0)), dphi1(std::vector<double>(1, 0.0)),
48  pmode(std::vector<process_mode>(1, MODE_MAX_TIME)), count(std::vector<size_t>(1))
49 
50  {
51  double default_cutoff_freq = 1; // [Hz]
52  wrench_filter = boost::shared_ptr<FirstOrderLowPassFilter<double> >(new FirstOrderLowPassFilter<double>(default_cutoff_freq, _dt, 0));
53  dwrench_filter = boost::shared_ptr<FirstOrderLowPassFilter<double> >(new FirstOrderLowPassFilter<double>(default_cutoff_freq, _dt, 0));
54  friction_coeff_wrench_filter = boost::shared_ptr<FirstOrderLowPassFilter<double> >(new FirstOrderLowPassFilter<double>(default_cutoff_freq, _dt, 0));
55  resultant_wrench_filter = boost::shared_ptr<FirstOrderLowPassFilter<hrp::dvector6> >(new FirstOrderLowPassFilter<hrp::dvector6>(default_cutoff_freq, _dt, hrp::dvector6::Zero()));
56  resultant_dwrench_filter = boost::shared_ptr<FirstOrderLowPassFilter<hrp::dvector6> >(new FirstOrderLowPassFilter<hrp::dvector6>(default_cutoff_freq, _dt, hrp::dvector6::Zero()));
57  };
59  void startDetection (const double _ref_diff_wrench, const double _max_time)
60  {
61  if (ref_dwrench.size() != 1) ref_dwrench.resize(1);
63  // NOTE : _ref_diff_wrench is difference. d_xx is velocity.
64  ref_dwrench[0] = _ref_diff_wrench/_max_time;
65  max_time = _max_time;
67  };
69  {
70  for (size_t i = 0; i < count.size(); i++) {
71  count[i] = 0;
72  pmode[i] = MODE_IDLE;
73  }
74  current_time = 0;
75  is_filter_reset = true;
76  is_other_constraint_detected = false;
77  std::cerr << "[" << print_str << "] Start Object Turnaround Detection (";
78  std::cerr << "ref_dwrench = [";
79  for (size_t i = 0; i < ref_dwrench.size(); i++) std::cerr << ref_dwrench[i] << ", ";
80  std::cerr << "], detect_thre = [";
81  for (size_t i = 0; i < ref_dwrench.size(); i++) std::cerr << ref_dwrench[i] * detect_ratio_thre << ", ";
82  std::cerr << "], start_thre = [";
83  for (size_t i = 0; i < ref_dwrench.size(); i++) std::cerr << ref_dwrench[i] * start_ratio_thre << ", ";
84  std::cerr << "]), max_time = " << max_time << "[s]" << std::endl;
85  };
86  void resizeVariablesForGeneralizedWrench (size_t generalized_wrench_dim)
87  {
88  phi1.resize(generalized_wrench_dim);
89  phi2.resize(generalized_wrench_dim);
90  dphi1.resize(generalized_wrench_dim);
91  filtered_wrench_with_hold.resize(generalized_wrench_dim);
92  filtered_friction_coeff_wrench_with_hold.resize(generalized_wrench_dim);
93  raw_wrench.resize(generalized_wrench_dim);
94  count.resize(generalized_wrench_dim);
95  pmode.resize(generalized_wrench_dim);
96  for (size_t i = 0; i < generalized_wrench_dim; i++) {
97  count[i] = 0;
98  pmode[i] = MODE_MAX_TIME;
99  }
100  };
101  void calcTotalForceMoment (hrp::Vector3& total_force, hrp::Vector3& total_moment1, hrp::Vector3& total_moment2,
102  const std::vector<hrp::Vector3>& forces, const std::vector<hrp::Vector3>& moments, const std::vector<hrp::Vector3>& hposv)
103  {
104  // Total wrench around the origin
105  total_force = total_moment1 = total_moment2 = hrp::Vector3::Zero();
106  for (size_t i = 0; i < forces.size(); i++) {
107  total_force += forces[i];
108  total_moment1 += hposv[i].cross(forces[i]);
109  total_moment2 += moments[i];
110  }
111  };
112  bool checkDetection (const std::vector<hrp::Vector3>& forces,
113  const std::vector<hrp::Vector3>& moments,
114  const std::vector<hrp::Vector3>& hposv)
115  {
116  // Calculate total force and moments
117  // forces, moments, hposv : Force, moment, position for all EE : f_i, n_i, p_i
118  // total_force : F = \sum_i f_i
119  // total_moment1 : M1 = \sum_i p_i \times f_i = \sum_i p_i \times f_i - p_c \times F
120  // total_moment2 : M2 = \sum_i n_i
121  hrp::Vector3 total_force, total_moment1, total_moment2;
122  calcTotalForceMoment(total_force, total_moment1, total_moment2, forces, moments, hposv);
123  // Calculate generalized force/moment values and check detection
124  bool ret = false;
125  switch(dtw) {
126  case TOTAL_FORCE:
127  {
128  ret = checkDetection(axis.dot(total_force), total_force(2));
129  break;
130  }
131  case TOTAL_MOMENT:
132  {
133  // \sum_i (p_i - p_c) \times f_i = M1 - p_c \times F
134  ret = checkDetection(axis.dot(total_moment1 - moment_center.cross(total_force)), 0.0);
135  }
136  break;
137  case TOTAL_MOMENT2:
138  {
139  // \sum_i (p_i - p_c) \times f_i + n_i = M1 + M2 - p_c \times F
140  ret = checkDetection(axis.dot(total_moment1 + total_moment2 - moment_center.cross(total_force)), 0.0);
141  }
142  break;
143  case GENERALIZED_WRENCH:
144  {
145  hrp::dvector6 resultant_OR_wrench;
146  for (size_t i = 0; i < 3; i++) {
147  resultant_OR_wrench(i) = total_force(i);
148  resultant_OR_wrench(i+3) = total_moment1(i) + total_moment2(i);
149  }
150  ret = checkDetection(resultant_OR_wrench);
151  };
152  break;
153  default:
154  break;
155  };
156  return ret;
157  };
158  bool checkDetection (const double raw_wrench_value, const double raw_friction_coeff_wrench_value)
159  {
160  if (is_filter_reset) {
161  std::cerr << "[" << print_str << "] Object Turnaround Detection Reset Values. (raw_wrench_value = " << raw_wrench_value << ", raw_friction_coeff_wrench_value = " << raw_friction_coeff_wrench_value << ")" << std::endl;
162  wrench_filter->reset(raw_wrench_value);
163  dwrench_filter->reset(0);
164  friction_coeff_wrench_filter->reset(raw_friction_coeff_wrench_value);
165  filtered_wrench_with_hold[0] = wrench_filter->getCurrentValue();
166  filtered_friction_coeff_wrench_with_hold[0] = friction_coeff_wrench_filter->getCurrentValue();
167  is_filter_reset = false;
168  }
169  raw_wrench[0] = raw_wrench_value;
170  double prev_filtered_wrench = wrench_filter->getCurrentValue();
171  double filtered_wrench = wrench_filter->passFilter(raw_wrench_value);
172  double filtered_dwrench = dwrench_filter->passFilter((filtered_wrench-prev_filtered_wrench)/dt);
173  friction_coeff_wrench_filter->passFilter(raw_friction_coeff_wrench_value);
174  // Hold values : is_hold_values is true and previously "detected", hold values. Otherwise, update values.
175  if ( !(is_hold_values && isDetected()) ) {
176  filtered_wrench_with_hold[0] = wrench_filter->getCurrentValue();
177  filtered_friction_coeff_wrench_with_hold[0] = friction_coeff_wrench_filter->getCurrentValue();
178  }
179  // For logging
180  phi1[0] = wrench_filter->getCurrentValue();
181  phi2[0] = friction_coeff_wrench_filter->getCurrentValue();
182  dphi1[0] = dwrench_filter->getCurrentValue();
183  return updateProcessModeFromDwrench(std::vector<double>(1, filtered_dwrench));
184  };
185  bool checkDetection (const hrp::dvector6& raw_resultant_wrench_value)
186  {
187  if (is_filter_reset) {
188  std::cerr << "[" << print_str << "] Object Turnaround Detection Reset Values. (raw_resultant_wrench_value = " << raw_resultant_wrench_value.format(Eigen::IOFormat(Eigen::StreamPrecision, 0, ", ", ", ", "", "", "[", "]")) << ")" << std::endl;
189  resultant_wrench_filter->reset(raw_resultant_wrench_value);
190  resultant_dwrench_filter->reset(hrp::dvector6::Zero());
191  }
192  hrp::dvector6 prev_filtered_resultant_wrench = resultant_wrench_filter->getCurrentValue();
193  hrp::dvector6 filtered_resultant_wrench = resultant_wrench_filter->passFilter(raw_resultant_wrench_value);
194  hrp::dvector6 filtered_resultant_dwrench = resultant_dwrench_filter->passFilter((filtered_resultant_wrench - prev_filtered_resultant_wrench)/dt);
195  calcPhiValueFromConstraintConversionMatrix(phi1, constraint_conversion_matrix1, filtered_resultant_wrench);
196  calcPhiValueFromConstraintConversionMatrix(phi2, constraint_conversion_matrix2, filtered_resultant_wrench);
197  calcPhiValueFromConstraintConversionMatrix(dphi1, constraint_conversion_matrix1, filtered_resultant_dwrench);
198  if (is_filter_reset) {
199  filtered_wrench_with_hold = phi1;
200  filtered_friction_coeff_wrench_with_hold = phi2;
201  filtered_resultant_wrench_with_hold = filtered_resultant_wrench;
202  is_filter_reset = false;
203  }
204  // Hold values : is_hold_values is true and previously "detected", hold values. Otherwise, update values.
205  if ( !(is_hold_values && isDetected()) ) {
206  filtered_wrench_with_hold = phi1;
207  filtered_friction_coeff_wrench_with_hold = phi2;
208  filtered_resultant_wrench_with_hold = filtered_resultant_wrench;
209  }
210  // For logger, just used as buffer
211  calcPhiValueFromConstraintConversionMatrix(raw_wrench, constraint_conversion_matrix1, raw_resultant_wrench_value);
212  // Update process mode and return
213  return updateProcessModeFromDwrench(dphi1);
214  };
215  void calcPhiValueFromConstraintConversionMatrix (std::vector<double>& phi, const std::vector<hrp::dvector6>& ccm, const hrp::dvector6& res_wrench)
216  {
217  for (size_t i = 0; i < ccm.size(); i++) phi[i] = ccm[i].dot(res_wrench);
218  };
219  bool updateProcessModeFromDwrench (const std::vector<double>& tmp_dwrench)
220  {
221  // Checking of wrench profile turn around
222  // Sign of ref_dwrench and tmp_dwrench shuold be same
223  // Supprot both ref_dwrench > 0 case and ref_dwrench < 0 case
224  for (size_t i = 0; i < ref_dwrench.size(); i++) {
225  if (!is_other_constraint_detected) {
226  switch (pmode[i]) {
227  case MODE_IDLE:
228  if ( (ref_dwrench[i] > 0.0) ? (tmp_dwrench[i] > ref_dwrench[i]*start_ratio_thre) : (tmp_dwrench[i] < ref_dwrench[i]*start_ratio_thre) ) {
229  count[i]++;
230  if (count[i] > start_count_thre) {
231  pmode[i] = MODE_STARTED;
232  count[i] = 0;
233  std::cerr << "[" << print_str << "] Object Turnaround Detection Started [idx=" << i << "]. (time = " << current_time << "[s], " << start_count_thre*dt << "[s] after the first start detection)" << std::endl;
234  }
235  } else {
236  /* count--; */
237  }
238  break;
239  case MODE_STARTED:
240  if ( (ref_dwrench[i] > 0.0) ? (tmp_dwrench[i] < ref_dwrench[i]*detect_ratio_thre) : (tmp_dwrench[i] > ref_dwrench[i]*detect_ratio_thre) ) {
241  count[i]++;
242  if (count[i] > detect_count_thre) {
243  pmode[i] = MODE_DETECTED;
244  count[i] = 0;
245  std::cerr << "[" << print_str << "] Object Turnaround Detected [idx=" << i << "]. (time = " << current_time << "[s], " << detect_count_thre*dt << "[s] after the first detection)" << std::endl;
246  }
247  } else {
248  if ( ((ref_dwrench[i] > 0.0) ? (tmp_dwrench[i] > ref_dwrench[i]*forgetting_ratio_thre) : (tmp_dwrench[i] < ref_dwrench[i]*forgetting_ratio_thre)) &&
249  (count[i] > 0) ) {
250  count[i]--;
251  }
252  }
253  break;
254  case MODE_DETECTED:
255  {
256  count[i]++;
257  if (count[i] > other_detect_count_thre) {
258  is_other_constraint_detected = true;
259  std::cerr << "[" << print_str << "] Object Turnaround Other Detected Time Limit [idx=" << i << "]. (time = " << current_time << "[s], " << other_detect_count_thre*dt << "[s] after the first detection)" << std::endl;
260  }
261  }
262  break;
263  case MODE_MAX_TIME:
264  break;
265  default:
266  break;
267  }
268  if (max_time <= current_time && (pmode[i] != MODE_DETECTED)) {
269  if (pmode[i] != MODE_MAX_TIME) std::cerr << "[" << print_str << "] Object Turnaround Detection max time reached. [idx=" << i << "]" << std::endl;
270  pmode[i] = MODE_MAX_TIME;
271  }
272  } else {
273  if (pmode[i] != MODE_DETECTED) pmode[i] = MODE_OTHER_DETECTED;
274  }
275  }
276  current_time += dt;
277  return isDetected();
278  };
279  bool isDetected (const size_t idx) const { return (pmode[idx] == MODE_DETECTED); };
280  bool isDetected () const
281  {
282  for (size_t i = 0; i < pmode.size(); i++) {
283  if (isDetected(i)) return true;
284  }
285  return false;
286  };
287  void printParams () const
288  {
289  std::string tmpstr;
290  switch (dtw) {
291  case TOTAL_FORCE:
292  tmpstr = "TOTAL_FORCE";break;
293  case TOTAL_MOMENT:
294  tmpstr = "TOTAL_MOMENT";break;
295  case TOTAL_MOMENT2:
296  tmpstr = "TOTAL_MOMENT2";break;
297  case GENERALIZED_WRENCH:
298  tmpstr = "GENERALIZED_WRENCH";break;
299  default:
300  tmpstr = "";break;
301  }
302  std::cerr << "[" << print_str << "] ObjectContactTurnaroundDetectorBase params (" << tmpstr << ")" << std::endl;
303  std::cerr << "[" << print_str << "] wrench_cutoff_freq = " << wrench_filter->getCutOffFreq() << "[Hz], dwrench_cutoff_freq = " << dwrench_filter->getCutOffFreq() << "[Hz], friction_coeff_wrench_freq = " << friction_coeff_wrench_filter->getCutOffFreq()
304  << "[Hz], resultant_wrench_cutoff_freq = " << resultant_wrench_filter->getCutOffFreq() << "[Hz], resultant_dwrench_cutoff_freq = " << resultant_dwrench_filter->getCutOffFreq() << "[Hz]" << std::endl;
305  std::cerr << "[" << print_str << "] detect_ratio_thre = " << detect_ratio_thre << ", start_ratio_thre = " << start_ratio_thre << ", forgetting_ratio_thre = " << forgetting_ratio_thre
306  << ", start_time_thre = " << start_count_thre*dt << "[s], detect_time_thre = " << detect_count_thre*dt << "[s], other_detect_time_thre = " << other_detect_count_thre*dt << std::endl;
307  std::cerr << "[" << print_str << "] axis = [" << axis(0) << ", " << axis(1) << ", " << axis(2)
308  << "], moment_center = " << moment_center(0) << ", " << moment_center(1) << ", " << moment_center(2) << "][m]" << std::endl;
309  std::cerr << "[" << print_str << "] constraint_conversion_matrix1 = [";
310  for (size_t i = 0; i < constraint_conversion_matrix1.size(); i++) {
311  std::cerr << constraint_conversion_matrix1[i].format(Eigen::IOFormat(Eigen::StreamPrecision, 0, ", ", ", ", "", "", "[", "]"));
312  }
313  std::cerr << "], constraint_conversion_matrix2 = [";
314  for (size_t i = 0; i < constraint_conversion_matrix2.size(); i++) {
315  std::cerr << constraint_conversion_matrix2[i].format(Eigen::IOFormat(Eigen::StreamPrecision, 0, ", ", ", ", "", "", "[", "]"));
316  }
317  std::cerr << "]" << std::endl;
318  std::cerr << "[" << print_str << "] is_hold_values = " << (is_hold_values?"true":"false") << std::endl;
319  std::cerr << "[" << print_str << "] ref_dwrench = [";
320  for (size_t i = 0; i < ref_dwrench.size(); i++) std::cerr << ref_dwrench[i] << ", ";
321  std::cerr << "], max_time = " << max_time << "[s]" << std::endl;
322  };
323  // Setter
324  void setPrintStr (const std::string& str) { print_str = str; };
325  void setWrenchCutoffFreq (const double a)
326  {
327  // All filters for wrench related values have the same cutoff freq.
328  wrench_filter->setCutOffFreq(a);
329  friction_coeff_wrench_filter->setCutOffFreq(a);
330  resultant_wrench_filter->setCutOffFreq(a);
331  };
332  void setDwrenchCutoffFreq (const double a)
333  {
334  // All filters for dwrench related values have the same cutoff freq.
335  dwrench_filter->setCutOffFreq(a);
336  resultant_dwrench_filter->setCutOffFreq(a);
337  };
338  // void setWrenchCutoffFreq (const double a) { wrench_filter->setCutOffFreq(a); };
339  // void setDwrenchCutoffFreq (const double a) { dwrench_filter->setCutOffFreq(a); };
340  // void setFrictionCoeffWrenchCutoffFreq (const double a) { friction_coeff_wrench_filter->setCutOffFreq(a); };
341  void setDetectRatioThre (const double a) { detect_ratio_thre = a; };
342  void setStartRatioThre (const double a) { start_ratio_thre = a; };
343  void setDetectTimeThre (const double a) { detect_count_thre = round(a/dt); };
344  void setStartTimeThre (const double a) { start_count_thre = round(a/dt); };
345  void setOtherDetectTimeThre (const double a) { other_detect_count_thre = round(a/dt); };
346  void setForgettingRatioThre (const double a) { forgetting_ratio_thre = a; };
347  void setAxis (const hrp::Vector3& a) { axis = a; };
348  void setMomentCenter (const hrp::Vector3& a) { moment_center = a; };
349  void setConstraintConversionMatricesRefDwrench (const std::vector<hrp::dvector6>& ccm1, const std::vector<hrp::dvector6>& ccm2, const std::vector<double>& refdw)
350  {
351  constraint_conversion_matrix1 = ccm1;
352  constraint_conversion_matrix2 = ccm2;
353  ref_dwrench = refdw;
354  resizeVariablesForGeneralizedWrench(constraint_conversion_matrix1.size());
355  };
356  void setDetectorTotalWrench (const detector_total_wrench _dtw)
357  {
358  if (_dtw != dtw) {
359  is_filter_reset = true;
360  }
361  dtw = _dtw;
362  };
363  void setIsHoldValues (const bool a) { is_hold_values = a; };
364  void setMaxTime (const double a) { max_time = a; };
365  // Getter
366  double getWrenchCutoffFreq () const { return wrench_filter->getCutOffFreq(); };
367  double getDwrenchCutoffFreq () const { return dwrench_filter->getCutOffFreq(); };
368  //double getFrictionCoeffWrenchCutoffFreq () const { return friction_coeff_wrench_filter->getCutOffFreq(); };
369  double getDetectRatioThre () const { return detect_ratio_thre; };
370  double getStartRatioThre () const { return start_ratio_thre; };
371  double getDetectTimeThre () const { return detect_count_thre*dt; };
372  double getStartTimeThre () const { return start_count_thre*dt; };
373  double getOtherDetectTimeThre () const { return other_detect_count_thre*dt; };
374  double getForgettingRatioThre () const { return forgetting_ratio_thre; };
375  hrp::Vector3 getAxis () const { return axis; };
377  void getConstraintConversionMatricesRefDwrench (std::vector<hrp::dvector6>& ccm1, std::vector<hrp::dvector6>& ccm2, std::vector<double>& refdw) const
378  {
381  refdw = ref_dwrench;
382  };
383  detector_total_wrench getDetectorTotalWrench () const { return dtw; };
384  process_mode getMode (const size_t idx) const { return pmode[idx]; };
385  size_t getDetectGeneralizedWrenchDim () const { return pmode.size(); };
387  {
388  size_t data_size = 5;
389  hrp::dvector ret(pmode.size()*data_size);
390  for (size_t i = 0; i < pmode.size(); i++) {
391  size_t tmpoff = i*data_size;
392  ret(tmpoff) = static_cast<double>(getMode(i));
393  ret(1+tmpoff) = raw_wrench[i];
394  ret(2+tmpoff) = phi1[i];
395  ret(3+tmpoff) = dphi1[i];
396  ret(4+tmpoff) = phi2[i];
397  }
398  return ret;
399  };
400  bool getIsHoldValues () const { return is_hold_values; };
401  double getMaxTime () const { return max_time; };
402  // For values with hold
403  std::vector<double> getFilteredWrenchWithHold () const { return filtered_wrench_with_hold; };
406 };
407 #endif // OBJECTCONTACTTURNAROUNDDETECTORBASE_H
static std::vector< std::vector< double > > forces
Definition: iob.cpp:9
void calcPhiValueFromConstraintConversionMatrix(std::vector< double > &phi, const std::vector< hrp::dvector6 > &ccm, const hrp::dvector6 &res_wrench)
boost::shared_ptr< FirstOrderLowPassFilter< double > > friction_coeff_wrench_filter
bool checkDetection(const std::vector< hrp::Vector3 > &forces, const std::vector< hrp::Vector3 > &moments, const std::vector< hrp::Vector3 > &hposv)
process_mode getMode(const size_t idx) const
std::vector< double > getFilteredFrictionCoeffWrenchWithHold() const
RTC::ReturnCode_t ret(RTC::Local::ReturnCode_t r)
png_uint_32 i
Eigen::VectorXd dvector
bool checkDetection(const hrp::dvector6 &raw_resultant_wrench_value)
bool checkDetection(const double raw_wrench_value, const double raw_friction_coeff_wrench_value)
void startDetection(const double _ref_diff_wrench, const double _max_time)
void getConstraintConversionMatricesRefDwrench(std::vector< hrp::dvector6 > &ccm1, std::vector< hrp::dvector6 > &ccm2, std::vector< double > &refdw) const
Eigen::Vector3d Vector3
OpenHRP::vector3 Vector3
bool updateProcessModeFromDwrench(const std::vector< double > &tmp_dwrench)
boost::shared_ptr< FirstOrderLowPassFilter< hrp::dvector6 > > resultant_wrench_filter
boost::shared_ptr< FirstOrderLowPassFilter< hrp::dvector6 > > resultant_dwrench_filter
double dot(const Vector3 &v1, const Vector3 &v2)
Eigen::Matrix< double, 6, 1 > dvector6
void setConstraintConversionMatricesRefDwrench(const std::vector< hrp::dvector6 > &ccm1, const std::vector< hrp::dvector6 > &ccm2, const std::vector< double > &refdw)
boost::shared_ptr< FirstOrderLowPassFilter< double > > wrench_filter
boost::shared_ptr< FirstOrderLowPassFilter< double > > dwrench_filter
void resizeVariablesForGeneralizedWrench(size_t generalized_wrench_dim)
void calcTotalForceMoment(hrp::Vector3 &total_force, hrp::Vector3 &total_moment1, hrp::Vector3 &total_moment2, const std::vector< hrp::Vector3 > &forces, const std::vector< hrp::Vector3 > &moments, const std::vector< hrp::Vector3 > &hposv)
void setDetectorTotalWrench(const detector_total_wrench _dtw)


hrpsys
Author(s): AIST, Fumio Kanehiro
autogenerated on Thu May 6 2021 02:41:50