88 std::deque<StampedFrame> leftQueue;
89 std::deque<StampedFrame> rightQueue;
91 double toleranceSeconds{0.020};
92 std::size_t maxQueueSize{5};
94 mutable std::mutex _mutex;
97 void trimRightQueue();
103 void pushLeft(
const ImageOf<PixelRgb>& leftFrame,
const Stamp& timestamp);
104 void pushRight(
const ImageOf<PixelRgb>& rightFrame,
const Stamp& timestamp);
115 enum class CalibrationState
124 std::atomic<CalibrationState> calibrationState{CalibrationState::Idle};
125 std::atomic<bool> collectionResetRequested{
false};
129 double _syncToleranceSeconds{0.020};
130 std::size_t _syncQueueSize{5};
132 double minCaptureIntervalSeconds{2.0};
133 double lastProcessedCandidateTime{-1.0};
134 double minimumBoardSpanRatio{0.15};
136 Size _expectedImageSize{};
143 yarp::sig::Vector qL;
144 yarp::sig::Vector qR;
146 mutable std::mutex mtx;
151 yarp::dev::PolyDriver polyHead;
152 yarp::dev::IEncoders *posHead;
154 yarp::dev::PolyDriver polyTorso;
155 yarp::dev::IEncoders *posTorso;
157 string inputLeftPortName;
158 string inputRightPortName;
164 std::vector<stereo_calib::StereoObservation> _observations;
165 std::size_t _rejectedDetections{0};
179 std::string _calibrationError;
181 bool _saveImages{
false};
182 bool _drawDiagnosticCorners{
true};
183 std::string _observationsFile;
186 BufferedPort<ImageOf<PixelRgb> > imagePortInLeft;
187 BufferedPort<ImageOf<PixelRgb> > imagePortInRight;
188 BufferedPort<ImageOf<PixelRgb> > outPortRight;
189 BufferedPort<ImageOf<PixelRgb> > outPortLeft;
197 void stereoCalibRun();
198 bool shouldQueueFrameForCollection(
const Stamp& timestamp)
const;
constexpr double tolerance