This class combines multiple frames with the same or similar timestamp into one multiframe.
More...
#include <FrameSynchronizer.hpp>
|
bool | findFrameByTime (const okvis::Time ×tamp, int &position) const |
| Find a multiframe in the buffer that has a timestamp within the tolerances of the given one. The tolerance is given as a parameter in okvis::VioParameters::sensors_information::frameTimestampTolerance. More...
|
|
bool | findFrameById (uint64_t mfId, int &position) const |
| returns true if a frame with multiframe id mfId is found and sets position to its frame buffer position More...
|
|
This class combines multiple frames with the same or similar timestamp into one multiframe.
- Warning
- This class is not threadsafe. Make sure to lock it with a mutex if used in multiple threads!
Constructor. Calls init().
- Parameters
-
parameters | Parameters and settings. |
okvis::FrameSynchronizer::~FrameSynchronizer |
( |
| ) |
|
|
virtual |
Adds a new frame to the internal buffer and returns the Multiframe containing the frame.
- Parameters
-
- Returns
- Multiframe with the added frame in it.
bool okvis::FrameSynchronizer::detectionCompletedForAllCameras |
( |
uint64_t |
multiFrameId | ) |
|
This will return true if the internal counter on how many times detectionEndedForMultiFrame() has been called for this multiframe equals the number of cameras in the system.
- Warning
- There is no check on whether actually all frames inside the multiframe have their keypoints detected. The synchronizer trusts the user to only ever call detectionEndedForMultiFrame() once for each frame in the multiframe.
- Parameters
-
multiFrameId | The ID of the multiframe. |
- Returns
- True if the detection has ended for all cameras. False if either the multiframe was not found in the buffer or if not all frames in the multiframe have been detected.
bool okvis::FrameSynchronizer::detectionEndedForMultiFrame |
( |
uint64_t |
multiFrameId | ) |
|
Inform the synchronizer that a frame in the multiframe has completed keypoint detection and description.
- Warning
- This function does not check whether the multiframe contains newly detected keypoints and their descriptors. Therefore only call it when you are sure a frame has been processed for which you have not called this function before.
- Parameters
-
multiFrameId | ID of the multiframe that contains the frame with the newly detected keypoints. |
- Returns
- True if the multiframe was found in the synchronizer. If it returns false this means that the multiframe probably is too old and already fell out of the internal buffer.
bool okvis::FrameSynchronizer::findFrameById |
( |
uint64_t |
mfId, |
|
|
int & |
position |
|
) |
| const |
|
private |
returns true if a frame with multiframe id mfId is found and sets position to its frame buffer position
Find a multiframe in the buffer for a given multiframe ID.
- Parameters
-
[in] | mfId | Look for this ID in the buffer. |
[out] | position | Position of the desired multiframe in the buffer. Check the return value to first find out whether the multiframe was found. |
- Returns
- True if a multiframe with the given timestamp was found in the buffer.
bool okvis::FrameSynchronizer::findFrameByTime |
( |
const okvis::Time & |
timestamp, |
|
|
int & |
position |
|
) |
| const |
|
private |
Find a multiframe in the buffer that has a timestamp within the tolerances of the given one. The tolerance is given as a parameter in okvis::VioParameters::sensors_information::frameTimestampTolerance.
- Parameters
-
[in] | timestamp | Look for this timestamp in the buffer. |
[out] | position | Position of the found multiframe in the buffer. Check the return value first to find out whether the multiframe was found. |
- Returns
- True if a multiframe with a timestamp within tolerances has been found.
Initialise the synchronizer with new parameters. Is called in the constructor.
- Parameters
-
parameters | New parameters and settings. |
int okvis::FrameSynchronizer::bufferPosition_ |
|
private |
Position of the newest multiframe in the buffer.
std::vector<std::pair<std::shared_ptr<okvis::MultiFrame>, size_t> > okvis::FrameSynchronizer::frameBuffer_ |
|
private |
Circular buffer containing a multiframe pointer and a counter for how many times detection has completed.
uint64_t okvis::FrameSynchronizer::lastCompletedFrameId_ |
|
private |
okvis::Time okvis::FrameSynchronizer::lastCompletedFrameTimestamp_ |
|
private |
size_t okvis::FrameSynchronizer::numCameras_ |
|
private |
Number of cameras for easy access.
Copy of the parameters and settings.
double okvis::FrameSynchronizer::timeTol_ |
|
private |
Timestamp tolerance to classify multiple frames as being part of the same multiframe.
The documentation for this class was generated from the following files: