OKVIS
|
An abstract interface for backends. More...
#include <VioBackendInterface.hpp>
Public Types | |
enum | InitializationStatus { InitializationStatus::NotStarted = 0, InitializationStatus::Ongoing = 1, InitializationStatus::Complete = 2 } |
Enum to define the status of initialization. More... | |
Public Member Functions | |
EIGEN_MAKE_ALIGNED_OPERATOR_NEW | VioBackendInterface () |
Default constructor. More... | |
virtual | ~VioBackendInterface () |
virtual bool | addStates (okvis::MultiFramePtr multiFrame, const okvis::ImuMeasurementDeque &imuMeasurements, bool asKeyframe)=0 |
Add a pose to the state. More... | |
virtual bool | addLandmark (uint64_t landmarkId, const Eigen::Vector4d &landmark)=0 |
Add a landmark. More... | |
virtual bool | removeObservation (uint64_t landmarkId, uint64_t poseId, size_t camIdx, size_t keypointIdx)=0 |
Remove an observation from a landmark, if available. More... | |
virtual void | optimize (size_t numIter, size_t numThreads=1, bool verbose=false)=0 |
Start optimization. More... | |
virtual bool | setOptimizationTimeLimit (double timeLimit, int minIterations)=0 |
Set a time limit for the optimization process. More... | |
virtual bool | isLandmarkAdded (uint64_t landmarkId) const =0 |
Checks whether the landmark is added to the estimator. More... | |
virtual bool | isLandmarkInitialized (uint64_t landmarkId) const =0 |
Checks whether the landmark is initialized. More... | |
virtual bool | isKeyframe (uint64_t frameId) const =0 |
Checks if a particular frame is a keyframe. More... | |
Sensor configuration related | |
virtual int | addCamera (const ExtrinsicsEstimationParameters &extrinsicsEstimationParameters)=0 |
Add a camera to the configuration. Sensors can only be added and never removed. More... | |
virtual int | addImu (const ImuParameters &imuParameters)=0 |
Add an IMU to the configuration. More... | |
virtual void | clearCameras ()=0 |
Remove all cameras from the configuration. More... | |
virtual void | clearImus ()=0 |
Remove all IMUs from the configuration. More... | |
Getters | |
virtual bool | getLandmark (uint64_t landmarkId, MapPoint &mapPoint) const =0 |
Get a specific landmark. More... | |
virtual size_t | getLandmarks (PointMap &landmarks) const =0 |
Get a copy of all the landmarks as a PointMap. More... | |
virtual okvis::MultiFramePtr | multiFrame (uint64_t frameId) const =0 |
Get a multiframe. More... | |
virtual bool | get_T_WS (uint64_t poseId, okvis::kinematics::Transformation &T_WS) const =0 |
Get pose for a given pose ID. More... | |
virtual bool | getSpeedAndBias (uint64_t poseId, uint64_t imuIdx, okvis::SpeedAndBias &speedAndBias) const =0 |
Get speeds and IMU biases for a given pose ID. More... | |
virtual bool | getCameraSensorStates (uint64_t poseId, size_t cameraIdx, okvis::kinematics::Transformation &T_SCi) const =0 |
Get camera states for a given pose ID. More... | |
virtual size_t | numFrames () const =0 |
Get the number of states/frames in the estimator. More... | |
virtual size_t | numLandmarks () const =0 |
Get the number of landmarks in the backend. More... | |
virtual uint64_t | currentFrameId () const =0 |
Get the ID of the newest frame added to the state. More... | |
virtual InitializationStatus | initializationStatus () const |
Obtain the initialization status. More... | |
virtual okvis::Time | timestamp (uint64_t frameId) const =0 |
Get the timestamp for a particular frame. More... | |
virtual bool | getPoseUncertainty (Eigen::Matrix< double, 6, 6 > &) const |
Get the current frame pose uncertainty. param[out] P_T_WS Current pose uncertainty w.r.t. [r_WS,delta_alpha_WS]. More... | |
virtual bool | getStateUncertainty (Eigen::Matrix< double, 15, 15 > &) const |
Get the current frame state uncertainty. param[out] P_T_WS Current pose uncertainty w.r.t. [r_WS,delta_alpha_WS,v_W,b_g,b_a]. More... | |
Setters | |
virtual bool | set_T_WS (uint64_t poseId, const okvis::kinematics::Transformation &T_WS)=0 |
Set pose for a given pose ID. More... | |
virtual bool | setSpeedAndBias (uint64_t poseId, size_t imuIdx, const okvis::SpeedAndBias &speedAndBias)=0 |
Set the speeds and IMU biases for a given pose ID. More... | |
virtual bool | setCameraSensorStates (uint64_t poseId, size_t cameraIdx, const okvis::kinematics::Transformation &T_SCi)=0 |
Set the transformation from sensor to camera frame for a given pose ID. More... | |
virtual bool | setLandmark (uint64_t landmarkId, const Eigen::Vector4d &landmark)=0 |
Set the homogeneous coordinates for a landmark. More... | |
virtual void | setLandmarkInitialized (uint64_t landmarkId, bool initialized)=0 |
Set the landmark initialization state. More... | |
virtual void | setKeyframe (uint64_t frameId, bool isKeyframe)=0 |
Set whether a frame is a keyframe or not. More... | |
virtual void | setMap (std::shared_ptr< okvis::ceres::Map > mapPtr)=0 |
Set ceres map. More... | |
virtual void | setComputeUncertainty (bool) |
Request computation of uncertainties. param[in] computeUncertainty True, if uncertainties should be computed. More... | |
An abstract interface for backends.
|
strong |
|
inline |
Default constructor.
|
inlinevirtual |
|
pure virtual |
Add a camera to the configuration. Sensors can only be added and never removed.
extrinsicsEstimationParameters | The parameters that tell how to estimate extrinsics. |
Implemented in okvis::Estimator.
|
pure virtual |
Add an IMU to the configuration.
imuParameters | The IMU parameters. |
Implemented in okvis::Estimator.
|
pure virtual |
Add a landmark.
landmarkId | ID of the new landmark. |
landmark | Homogeneous coordinates of landmark in W-frame. |
Implemented in okvis::Estimator.
|
pure virtual |
Add a pose to the state.
multiFrame | Matched multiFrame. |
imuMeasurements | IMU measurements from last state to new one. |
asKeyframe | Is this new frame a keyframe? |
Implemented in okvis::Estimator.
|
pure virtual |
Remove all cameras from the configuration.
Implemented in okvis::Estimator.
|
pure virtual |
Remove all IMUs from the configuration.
Implemented in okvis::Estimator.
|
pure virtual |
Get the ID of the newest frame added to the state.
Implemented in okvis::Estimator.
|
pure virtual |
Get pose for a given pose ID.
[in] | poseId | ID of desired pose. |
[out] | T_WS | Homogeneous transformation of this pose. |
Implemented in okvis::Estimator.
|
pure virtual |
Get camera states for a given pose ID.
[in] | poseId | ID of pose to get camera state for. |
[in] | cameraIdx | index of camera to get state for. |
[out] | T_SCi | Homogeneous transformation from sensor (IMU) frame to camera frame. |
Implemented in okvis::Estimator.
|
pure virtual |
Get a specific landmark.
[in] | landmarkId | ID of desired landmark. |
[out] | mapPoint | Landmark information, such as quality, coordinates etc. |
Implemented in okvis::Estimator.
|
pure virtual |
Get a copy of all the landmarks as a PointMap.
[out] | landmarks | The landmarks. |
Implemented in okvis::Estimator.
|
inlinevirtual |
Get the current frame pose uncertainty. param[out] P_T_WS Current pose uncertainty w.r.t. [r_WS,delta_alpha_WS].
|
pure virtual |
Get speeds and IMU biases for a given pose ID.
[in] | poseId | ID of pose to get speeds and biases for. |
[in] | imuIdx | index of IMU to get biases for. |
[out] | speedAndBias | Speed And bias requested. |
Implemented in okvis::Estimator.
|
inlinevirtual |
Get the current frame state uncertainty. param[out] P_T_WS Current pose uncertainty w.r.t. [r_WS,delta_alpha_WS,v_W,b_g,b_a].
|
inlinevirtual |
Obtain the initialization status.
|
pure virtual |
Checks if a particular frame is a keyframe.
[in] | frameId | ID of frame to check. |
Implemented in okvis::Estimator.
|
pure virtual |
Checks whether the landmark is added to the estimator.
landmarkId | The ID. |
Implemented in okvis::Estimator.
|
pure virtual |
Checks whether the landmark is initialized.
landmarkId | The ID. |
Implemented in okvis::Estimator.
|
pure virtual |
Get a multiframe.
frameId | ID of desired multiframe. |
Implemented in okvis::Estimator.
|
pure virtual |
Get the number of states/frames in the estimator.
Implemented in okvis::Estimator.
|
pure virtual |
Get the number of landmarks in the backend.
Implemented in okvis::Estimator.
|
pure virtual |
Start optimization.
[in] | numIter | Maximum number of iterations. |
[in] | numThreads | Number of threads. |
[in] | verbose | Print out optimization progress and result, if true. |
Implemented in okvis::Estimator.
|
pure virtual |
Remove an observation from a landmark, if available.
landmarkId | ID of landmark. |
poseId | ID of pose where the landmark was observed. |
camIdx | ID of camera frame where the landmark was observed. |
keypointIdx | ID of keypoint corresponding to the landmark. |
Implemented in okvis::Estimator.
|
pure virtual |
Set pose for a given pose ID.
[in] | poseId | ID of the pose that should be changed. |
[in] | T_WS | new homogeneous transformation. |
Implemented in okvis::Estimator.
|
pure virtual |
Set the transformation from sensor to camera frame for a given pose ID.
[in] | poseId | ID of the pose to change corresponding camera states for. |
[in] | cameraIdx | Index of camera to set state for. |
[in] | T_SCi | new homogeneous transformation from sensor (IMU) to camera frame. |
Implemented in okvis::Estimator.
|
inlinevirtual |
Request computation of uncertainties. param[in] computeUncertainty True, if uncertainties should be computed.
|
pure virtual |
Set whether a frame is a keyframe or not.
[in] | frameId | The frame ID. |
[in] | isKeyframe | Whether or not keyrame. |
Implemented in okvis::Estimator.
|
pure virtual |
Set the homogeneous coordinates for a landmark.
[in] | landmarkId | The landmark ID. |
[in] | landmark | Homogeneous coordinates of landmark in W-frame. |
Implemented in okvis::Estimator.
|
pure virtual |
Set the landmark initialization state.
[in] | landmarkId | The landmark ID. |
[in] | initialized | Whether or not initialised. |
Implemented in okvis::Estimator.
|
pure virtual |
Set ceres map.
[in] | mapPtr | The pointer to the okvis::ceres::Map. |
Implemented in okvis::Estimator.
|
pure virtual |
Set a time limit for the optimization process.
[in] | timeLimit | Time limit in seconds. If timeLimit < 0 the time limit is removed. |
[in] | minIterations | minimum iterations the optimization process should do disregarding the time limit. |
Implemented in okvis::Estimator.
|
pure virtual |
Set the speeds and IMU biases for a given pose ID.
[in] | poseId | ID of the pose to change corresponding speeds and biases for. |
[in] | imuIdx | index of IMU to get biases for. As only one IMU is supported this is always 0. |
[in] | speedAndBias | new speeds and biases. |
Implemented in okvis::Estimator.
|
pure virtual |
Get the timestamp for a particular frame.
[in] | frameId | ID of frame. |
Implemented in okvis::Estimator.