|
Ocean
|
This class is the base class for all offline tracker objects. More...
#include <OfflineTracker.h>
Data Structures | |
| class | EventStackLayer |
| This class implements one layer in a progress event stack allowing to define the start and stop progress value. More... | |
| class | ScopedEventStackLayer |
| This class implements an event stack layer object that pushes the relative progress parameters on the stack during creation and pops the layer if the object is disposed. More... | |
Public Types | |
| enum | TrackingQuality { TQ_LOW , TQ_MODERATE , TQ_HIGH , TQ_ULTRA , TQ_INSANE , TQ_AUTOMATIC , TQ_COARSE , TQ_FINE } |
| Definition of individual tracking qualities. More... | |
| enum | AbstractMotionType { AMT_UNKNOWN , AMT_PURE_ROTATIONAL , AMT_COMPLEX } |
| Definition of individual abstract camera motion types. More... | |
| enum | CameraModel { CM_INVALID , CM_LOW_QUALITY , CM_MEDIUM_QUALITY , CM_HIGH_QUALITY } |
| Definition of individual camera models. More... | |
| using | EventCallback = Callback< void, const TrackerEvent & > |
| Definition of a component event callback function. | |
Public Member Functions | |
| virtual | ~OfflineTracker () |
| Frees the offline tracker object. | |
| virtual bool | start () |
| Starts the offline tracker. | |
| virtual bool | stop (const unsigned int timeout=0u) |
| Stops the offline tracker. | |
| unsigned int | id () const |
| Returns the unique id of this tracker object. | |
| virtual bool | running () const |
| Returns whether the tracker has been started (and is currently tracking). | |
| virtual bool | finished () const |
| Returns whether the offline tracker has finished since the last start or has not been started yet. | |
| virtual bool | succeeded () const =0 |
| Returns whether the offline tracker has finished and succeeded since the last start or has not been started yet. | |
| virtual OfflinePoses | poses () const |
| Returns the currently determined poses of this tracker. | |
| virtual OfflinePose | pose (const unsigned int index) const |
| Returns one pose of this tracker. | |
| void | addEventCallback (const EventCallback &callback) |
| Adds a state event callback function. | |
| void | removeEventCallback (const EventCallback &callback) |
| Removes a state event callback function. | |
Protected Types | |
| using | EventStack = std::vector< EventStackLayer > |
| Definition of a vector holding EventStackLayer objects which actually is used to implement a stack of these objects. | |
| using | EventCallbacks = ConcurrentCallbacks< EventCallback > |
| Definition of a vector holding event callback functions. | |
Protected Types inherited from Ocean::Thread | |
| using | TimedJoinPair = std::pair< pthread_t, bool > |
| Definition of a pair holding a thread id and a boolean state. | |
| enum | ThreadPriority { PRIORITY_IDLE , PRIORTY_BELOW_NORMAL , PRIORTY_NORMAL , PRIORTY_ABOVE_NORMAL , PRIORTY_HIGH , PRIORTY_REALTIME } |
| Definition of different thread priority values. More... | |
Protected Member Functions | |
| OfflineTracker () | |
| Creates a new offline tracker object. | |
| void | updateTrackerProgress (const Scalar localProgress) |
| Updates the tracker process progress value of this tracker. | |
| void | updatePoses (const OfflinePoses &poses) |
| Updates all poses of this tracker and invokes the corresponding state event(s). | |
| void | removeIrregularPoses (const Scalar factor=Scalar(5)) |
| Removes irregular poses at the boundary between valid and invalid poses. | |
| void | extrapolatePoses (const unsigned int number, const unsigned int base) |
| Extrapolates poses at the boundary between valid and invalid poses. | |
Protected Member Functions inherited from Ocean::Thread | |
| Thread (const Thread &thread)=delete | |
| Disabled copy constructor. | |
| void | createThread () |
| Creates the thread itself. | |
| void | destroyThread () |
| Destroys the thread itself. | |
| void | stopThreadExplicitly (const unsigned int timeout=5000u) |
| Tries to stop the thread gracefully. | |
| virtual void | threadRun ()=0 |
| This function has to be overloaded in derived class. | |
| Thread & | operator= (const Thread &thread)=delete |
| The disabled assign operator. | |
| Thread (const std::string &name=std::string()) | |
| Creates a new thread object. | |
| Thread (const unsigned int randomNumberSeedValue, const std::string &name=std::string()) | |
| Creates a new thread object. | |
| virtual | ~Thread () |
| Destructs a thread object. | |
| bool | startThread () |
| Starts the thread. | |
| void | stopThread () |
| Informs the thread to stop. | |
| bool | terminateThread () |
| Terminates the thread. | |
| bool | joinThread (const unsigned int timeout=(unsigned int)(-1)) |
| Waits until this thread has been stopped. | |
| bool | shouldThreadStop () const |
| Returns whether this thread should stop. | |
| bool | isThreadInvokedToStart () const |
| Returns whether this thread has been invoked to start immediately. | |
| bool | isThreadActive () const |
| Returns whether this thread is active. | |
Static Protected Member Functions | |
| static bool | isPlausibleCamera (const PinholeCamera &pinholeCamera, const CameraModel model) |
| Checks whether the camera parameters of a given camera profiles matches to the specified camera model. | |
| static void | extrapolateSinglePose (const OfflinePoses::Index invalidIndex, OfflinePoses &offlinePoses) |
| Interpolates the pose of a single invalid pose which is enclosed by two valid poses. | |
| static void | extrapolateLeftPoses (const OfflinePoses::Index invalidIndex, const unsigned int number, const unsigned int base, OfflinePoses &offlinePoses) |
| Interpolates some poses to the left of a gap with invalid poses. | |
| static void | extrapolateRightPoses (const OfflinePoses::Index invalidIndex, const unsigned int number, const unsigned int base, OfflinePoses &offlinePoses) |
| Interpolates some poses to the right of a gap with invalid poses. | |
| static void | extrapolateCenterPoses (const OfflinePoses::Index invalidIndex, const unsigned int number, const unsigned int base, OfflinePoses &offlinePoses) |
| Interpolates some poses to the left or to the right of a gap with invalid poses. | |
| static Lock & | idCounterLock () |
| Returns a reference to the lock for the tracker id counter. | |
Static Protected Member Functions inherited from Ocean::Thread | |
| static void | sleep (unsigned int ms) |
| Sleeps the calling thread for a given time. | |
| static void | giveUp () |
| Gives up the remaining thread time. | |
| static ThreadId | currentThreadId () |
| Returns the thread id of the current (calling) thread. | |
| static ThreadPriority | threadPriority () |
| Returns the priority of the current thread. | |
| static bool | setThreadPriority (const ThreadPriority priority) |
| Sets the priority of the current thread. | |
| template<typename TObject , typename TExpectedValue > | |
| static bool | waitForValue (TObject &object, const TExpectedValue &expectedValue, const double timeout=-1.0) |
| Waits until an object/variable has an expected value. | |
| template<typename TObject , typename TExpectedValue > | |
| static bool | waitForValue (TObject &object, const TExpectedValue &expectedValue, TemporaryScopedLock &temporaryScopedLock, const double timeout=-1.0) |
| Waits until an object/variable has an expected value. | |
| static int | pthread_timedjoin_np (pthread_t thread, void **retval, const struct timespec *abstime) |
| Implements a thread join function with timeout value. | |
Protected Attributes | |
| unsigned int | id_ = 0u |
| The unique id that identifies this tracker. | |
| bool | finished_ = true |
| Finished state of the tracker. | |
| bool | shouldStop_ = false |
| Stop-request state of the tracker, this state should have the same state as the threadShouldStop variable but will be accessible in all trackers. | |
| OfflinePoses | offlinePoses_ |
| Offline poses of this tracker. | |
| EventCallbacks | eventCallbacks_ |
| State event callback functions. | |
| Lock | lock_ |
| Tracker lock object. | |
| EventStack | eventStack_ |
| The stack with progress event layers allowing for a convenient process progress event handling. | |
| Lock | eventStackLock_ |
| The lock for the progress event layer stack. | |
| Scalar | previousProcessProgress_ = Scalar(0) |
| The previous process progress. | |
Static Protected Attributes | |
| static unsigned int | idCounter_ |
| The tracker id counter. | |
Private Member Functions | |
| void | pushProgressEventStackLayer (const EventStackLayer &layer) |
| Pushes a new progress event stack layer on the stack of this tracker. | |
| void | popProgressEventStackLayer (const EventStackLayer &layer) |
| Pops a progress event stack layer from the stack of this tracker. | |
Friends | |
| class | EventStackLayer |
This class is the base class for all offline tracker objects.
| using Ocean::Tracking::Offline::OfflineTracker::EventCallback = Callback<void, const TrackerEvent&> |
Definition of a component event callback function.
The first parameter provides the event.
|
protected |
Definition of a vector holding event callback functions.
|
protected |
Definition of a vector holding EventStackLayer objects which actually is used to implement a stack of these objects.
Definition of individual camera models.
Definition of individual tracking qualities.
|
virtual |
Frees the offline tracker object.
|
protected |
Creates a new offline tracker object.
|
inline |
Adds a state event callback function.
| callback | The callback function to be added |
|
staticprotected |
Interpolates some poses to the left or to the right of a gap with invalid poses.
| invalidIndex | The index of the invalid pose with valid poses |
| number | The number of poses that will be extrapolated in the area |
| base | The maximal number of poses that are used as interpolation base |
| offlinePoses | The offline poses on which the poses are extrapolated |
|
staticprotected |
Interpolates some poses to the left of a gap with invalid poses.
| invalidIndex | The index of the invalid pose with valid poses on the right |
| number | The number of poses that will be extrapolated in the left area |
| base | The maximal number of poses that are used as interpolation base |
| offlinePoses | The offline poses on which the poses are extrapolated |
|
protected |
Extrapolates poses at the boundary between valid and invalid poses.
| number | The number of poses that will be extrapolated at each border |
| base | The maximal number of poses that are used as interpolation base |
|
staticprotected |
Interpolates some poses to the right of a gap with invalid poses.
| invalidIndex | The index of the invalid pose with valid poses on the left |
| number | The number of poses that will be extrapolated in the right area |
| base | The maximal number of poses that are used as interpolation base |
| offlinePoses | The offline poses on which the poses are extrapolated |
|
staticprotected |
Interpolates the pose of a single invalid pose which is enclosed by two valid poses.
| invalidIndex | The index of the (single) invalid pose |
| offlinePoses | The offline poses on which the poses are extrapolated |
|
virtual |
Returns whether the offline tracker has finished since the last start or has not been started yet.
|
inline |
Returns the unique id of this tracker object.
Each tracker has an own unique id allowing to separate individual trackers or their events.
|
staticprotected |
Returns a reference to the lock for the tracker id counter.
|
staticprotected |
Checks whether the camera parameters of a given camera profiles matches to the specified camera model.
| pinholeCamera | The pinhole camera profile that will be checked |
| model | The model to that the camera profiles must match |
|
private |
Pops a progress event stack layer from the stack of this tracker.
Do not call this function, this function will be called by the ScopedEventStackLayer object only.
| layer | New layer to be pushed |
|
virtual |
Returns one pose of this tracker.
| index | The index of the frame for that the pose will be returned |
|
virtual |
Returns the currently determined poses of this tracker.
|
private |
Pushes a new progress event stack layer on the stack of this tracker.
Do not call this function, this function will be called by the ScopedEventStackLayer object only.
| layer | New layer to be pushed |
|
inline |
Removes a state event callback function.
| callback | The callback function to be removed |
|
protected |
Removes irregular poses at the boundary between valid and invalid poses.
A pose is voted as irregular if the rotation angle between two successive frame is larger than the median rotation angle (between successive frame) multiplied by a factor.
| factor | The factor that is multiplied with the media angle |
|
virtual |
Returns whether the tracker has been started (and is currently tracking).
|
virtual |
Starts the offline tracker.
Reimplemented in Ocean::Tracking::Offline::FrameTracker, and Ocean::Tracking::Offline::SLAMTracker.
|
virtual |
Stops the offline tracker.
All poses that have been determined since the start of the tracker will be untouched.
| timeout | if 0, this call is asynchronous and will return immediately. Otherwise wait time in ms or -1 for infinite wait |
Reimplemented in Ocean::Tracking::Offline::SLAMTracker.
|
pure virtual |
Returns whether the offline tracker has finished and succeeded since the last start or has not been started yet.
Implemented in Ocean::Tracking::Offline::FrameTracker.
|
protected |
Updates all poses of this tracker and invokes the corresponding state event(s).
| poses | New poses for this tracker |
|
protected |
Updates the tracker process progress value of this tracker.
This tracker stores a stack with EventStackLayer objects defining a hierarchy of individual relative progress ranges.
The given progress value should be independent of any stack layer and should simply give the progress state of e.g. a component.
| localProgress | The local progress value of e.g. a component, with range [0, 1] |
|
friend |
|
protected |
State event callback functions.
|
protected |
The stack with progress event layers allowing for a convenient process progress event handling.
|
protected |
The lock for the progress event layer stack.
|
protected |
Finished state of the tracker.
|
protected |
The unique id that identifies this tracker.
|
staticprotected |
The tracker id counter.
|
protected |
Offline poses of this tracker.
The previous process progress.
|
protected |
Stop-request state of the tracker, this state should have the same state as the threadShouldStop variable but will be accessible in all trackers.