91 std::deque<StampedFrame> leftQueue;
92 std::deque<StampedFrame> rightQueue;
94 double toleranceSeconds{0.020};
95 std::size_t maxQueueSize{5};
97 mutable std::mutex _mutex;
100 void trimRightQueue();
106 void pushLeft(
const ImageOf<PixelRgb>& leftFrame,
const Stamp& timestamp);
107 void pushRight(
const ImageOf<PixelRgb>& rightFrame,
const Stamp& timestamp);
118 enum class CalibrationState
127 std::atomic<CalibrationState> calibrationState{CalibrationState::Idle};
128 std::atomic<bool> collectionResetRequested{
false};
132 double _syncToleranceSeconds{0.020};
133 std::size_t _syncQueueSize{5};
135 double minCaptureIntervalSeconds{2.0};
136 double lastProcessedCandidateTime{-1.0};
137 double minimumBoardSpanRatio{0.15};
139 Size _expectedImageSize{};
146 yarp::sig::Vector qL;
147 yarp::sig::Vector qR;
149 mutable std::mutex mtx;
154 yarp::dev::PolyDriver polyHead;
155 yarp::dev::IEncoders *posHead;
157 yarp::dev::PolyDriver polyTorso;
158 yarp::dev::IEncoders *posTorso;
160 string inputLeftPortName;
161 string inputRightPortName;
167 std::vector<stereo_calib::StereoObservation> _observations;
168 std::size_t _rejectedDetections{0};
182 std::string _calibrationError;
184 bool _saveImages{
false};
185 bool _drawDiagnosticCorners{
true};
186 std::string _observationsFile;
189 BufferedPort<ImageOf<PixelRgb> > imagePortInLeft;
190 BufferedPort<ImageOf<PixelRgb> > imagePortInRight;
191 BufferedPort<ImageOf<PixelRgb> > outPortRight;
192 BufferedPort<ImageOf<PixelRgb> > outPortLeft;
200 void stereoCalibRun();
201 bool shouldQueueFrameForCollection(
const Stamp& timestamp)
const;
constexpr double tolerance