calibration.hpp
Go to the documentation of this file.
1 
29 #ifndef _SR_CALIBRATION_HPP_
30 #define _SR_CALIBRATION_HPP_
31 
32 #include <iostream>
33 #include <vector>
34 
36 {
41 struct Point
42 {
43  double raw_value;
45 };
46 
57 static bool sort_growing_raw_operator(const Point &p1, const Point &p2)
58 {
59  return p1.raw_value < p2.raw_value;
60 }
61 } // namespace joint_calibration
62 
63 namespace shadow_robot
64 {
70 {
71 public:
72  explicit JointCalibration(std::vector<joint_calibration::Point> calibration_table);
73 
81  double compute(double raw_reading);
82 
86  friend std::ostream &operator<<(std::ostream &out, const JointCalibration &calib)
87  {
88  out << " calibration = {";
89  out << "size: " << calib.calibration_table_size_;
90  for (unsigned int i = 0; i < calib.calibration_table_.size(); ++i)
91  {
92  out << " [raw: " << calib.calibration_table_[i].raw_value;
93  out << ", cal: " << calib.calibration_table_[i].calibrated_value << "]";
94  }
95  out << " }";
96  return out;
97  };
98 
99 private:
104  std::vector<joint_calibration::Point> calibration_table_;
109 };
110 } // namespace shadow_robot
111 
112 /* For the emacs weenies in the crowd.
113 Local Variables:
114  c-basic-offset: 2
115 End:
116 */
117 
118 #endif
std::vector< joint_calibration::Point > calibration_table_
Definition: calibration.hpp:97
friend std::ostream & operator<<(std::ostream &out, const JointCalibration &calib)
Definition: calibration.hpp:86
static bool sort_growing_raw_operator(const Point &p1, const Point &p2)
Definition: calibration.hpp:57


sr_utilities
Author(s): Ugo Cupcic
autogenerated on Tue Oct 13 2020 03:55:49