26 #include <RobotAPI/gui-plugins/FTSensorCalibrationGui/ui_FTSensorCalibrationGuiWidget.h>
54 mutable std::size_t last_idx = 0;
58 template<
class T>
inline
66 search_dummy.at(0) = decision;
68 const auto lower = std::lower_bound(
69 table.begin(), table.end(), decision,
74 if (lower == table.end())
76 return apply(table.back(),
value);
78 if (lower == table.begin())
80 return apply(table.front(),
value);
83 return interpolate(decision, *(lower - 1), *lower,
value);
85 template<
class T>
inline
89 return f.at(1) *
value + f.at(2);
91 template<
class T>
inline
93 compensation_table<T>::interpolate(value_t decision,
const entry_t&
lo,
94 const entry_t&
hi, value_t
value)
const
96 const value_t t = (decision -
lo.at(0)) / (
hi.at(0) -
lo.at(0));
97 const value_t
a =
lo.at(1) * (1 - t) +
hi.at(1) * t;
98 const value_t b =
lo.at(2) * (1 - t) +
hi.at(2) * t;
136 void loadSettings(QSettings* settings)
override;
137 void saveSettings(QSettings* settings)
override;
138 QPointer<QDialog> getConfigDialog(QWidget* parent)
override;
139 void configured()
override;
147 return "Debugging.FTSensorCalibrationGui";
151 void onConnectComponent()
override;
152 void onDisconnectComponent()
override;
156 void timerEvent(QTimerEvent* event)
override;
159 void loadCalibFromFile();
160 void startRecording();
161 void stopRecording();
162 void updateCalibration();
163 void updateCompensation();
164 void loadDefaultArmar6FTL();
165 void loadDefaultArmar6FTR();
168 QPointer<SimpleConfigDialog> _dialog;
169 mutable std::recursive_mutex _all_mutex;
171 Ui::FTSensorCalibrationGuiWidget _widget;
172 bool _recording =
false;
173 bool _comboboxes_are_set_up =
false;
174 std::set<std::string> _all_logging_names;
178 Eigen::Vector6i _channel_order;
179 float _ticks_to_volt_factor;
182 std::array<RobotUnitDataStreaming::DataEntry, 6> _adc;
183 std::array<RobotUnitDataStreaming::DataEntry, 6> _adc_temp;
184 std::vector<RobotUnitDataStreaming::DataEntry> _joints;
185 std::ofstream _logfile;