33 #ifndef MockVioBackendInterface_HPP_
34 #define MockVioBackendInterface_HPP_
36 #include "gmock/gmock.h"
37 #include "gtest/gtest.h"
59 bool(uint64_t landmarkId,
const Eigen::Vector4d & landmark));
61 ::ceres::ResidualBlockId(uint64_t landmarkId, uint64_t poseId,
size_t camIdx,
size_t keypointIdx));
63 bool(uint64_t landmarkId, uint64_t poseId,
size_t camIdx,
size_t keypointIdx));
67 void(
size_t,
size_t,
bool));
69 bool(
double timeLimit,
int minIterations));
71 bool(uint64_t landmarkId));
73 bool(uint64_t landmarkId));
75 bool(uint64_t landmarkId,
MapPoint& mapPoint));
95 uint64_t(
size_t age));
99 bool(uint64_t frameId));
101 bool(uint64_t frameId));
111 bool(uint64_t landmarkId,
const Eigen::Vector4d & landmark));
113 void(uint64_t landmarkId,
bool initialized));
117 void(std::shared_ptr<okvis::ceres::Map> mapPtr));
MOCK_METHOD3(addStates, bool(okvis::MultiFramePtr multiFrame, const okvis::ImuMeasurementDeque &imuMeasurements, bool asKeyframe))
Struct to define the behavior of the camera extrinsics.
Definition: Parameters.hpp:60
virtual void setLandmarkInitialized(uint64_t landmarkId, bool initialized)=0
Set the landmark initialization state.
A type to store information about a point in the world map.
Definition: FrameTypedefs.hpp:139
MOCK_CONST_METHOD0(numFrames, size_t())
MOCK_METHOD0(clearCameras, void())
virtual bool setOptimizationTimeLimit(double timeLimit, int minIterations)=0
Set a time limit for the optimization process.
std::deque< ImuMeasurement, Eigen::aligned_allocator< ImuMeasurement > > ImuMeasurementDeque
Definition: Measurements.hpp:163
virtual bool isKeyframe(uint64_t frameId) const =0
Checks if a particular frame is a keyframe.
virtual int addCamera(const ExtrinsicsEstimationParameters &extrinsicsEstimationParameters)=0
Add a camera to the configuration. Sensors can only be added and never removed.
virtual bool getLandmark(uint64_t landmarkId, MapPoint &mapPoint) const =0
Get a specific landmark.
MOCK_METHOD1(addCamera, int(const ExtrinsicsEstimationParameters &extrinsicsEstimationParameters))
MOCK_METHOD2(addLandmark, bool(uint64_t landmarkId, const Eigen::Vector4d &landmark))
Eigen::Matrix< double, 9, 1 > SpeedAndBias
Definition: FrameTypedefs.hpp:234
MOCK_METHOD4(addObservation,::ceres::ResidualBlockId(uint64_t landmarkId, uint64_t poseId, size_t camIdx, size_t keypointIdx))
Definition: MockVioBackendInterface.hpp:44
std::shared_ptr< MultiFrame > MultiFramePtr
For convenience.
Definition: MultiFrame.hpp:272
virtual bool isLandmarkInitialized(uint64_t landmarkId) const =0
Checks whether the landmark is initialized.
std::vector< MapPoint, Eigen::aligned_allocator< MapPoint > > MapPointVector
Definition: FrameTypedefs.hpp:172
virtual bool getCameraSensorStates(uint64_t poseId, size_t cameraIdx, okvis::kinematics::Transformation &T_SCi) const =0
Get camera states for a given pose ID.
virtual bool get_T_WS(uint64_t poseId, okvis::kinematics::Transformation &T_WS) const =0
Get pose for a given pose ID.
virtual size_t getLandmarks(PointMap &landmarks) const =0
Get a copy of all the landmarks as a PointMap.
virtual void clearCameras()=0
Remove all cameras from the configuration.
MOCK_CONST_METHOD3(getSpeedAndBias, bool(uint64_t poseId, uint64_t imuIdx, okvis::SpeedAndBias &speedAndBias))
virtual okvis::MultiFramePtr multiFrame(uint64_t frameId) const =0
Get a multiframe.
virtual bool setLandmark(uint64_t landmarkId, const Eigen::Vector4d &landmark)=0
Set the homogeneous coordinates for a landmark.
virtual bool set_T_WS(uint64_t poseId, const okvis::kinematics::Transformation &T_WS)=0
Set pose for a given pose ID.
virtual InitializationStatus initializationStatus() const
Obtain the initialization status.
Definition: VioBackendInterface.hpp:238
virtual bool isLandmarkAdded(uint64_t landmarkId) const =0
Checks whether the landmark is added to the estimator.
InitializationStatus
Enum to define the status of initialization.
Definition: VioBackendInterface.hpp:77
virtual void clearImus()=0
Remove all IMUs from the configuration.
IMU parameters.
Definition: Parameters.hpp:105
std::map< uint64_t, MapPoint, std::less< uint64_t >, Eigen::aligned_allocator< MapPoint > > PointMap
Definition: FrameTypedefs.hpp:174
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.
virtual size_t numFrames() const =0
Get the number of states/frames in the estimator.
virtual void setKeyframe(uint64_t frameId, bool isKeyframe)=0
Set whether a frame is a keyframe or not.
virtual bool addLandmark(uint64_t landmarkId, const Eigen::Vector4d &landmark)=0
Add a landmark.
Time representation. May either represent wall clock time or ROS clock time.
Definition: Time.hpp:187
MOCK_CONST_METHOD1(isLandmarkAdded, bool(uint64_t landmarkId))
virtual void setMap(std::shared_ptr< okvis::ceres::Map > mapPtr)=0
Set ceres map.
virtual size_t numLandmarks() const =0
Get the number of landmarks in the backend.
Header file for the VioBackendInterface class.
virtual bool getSpeedAndBias(uint64_t poseId, uint64_t imuIdx, okvis::SpeedAndBias &speedAndBias) const =0
Get speeds and IMU biases for a given pose ID.
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.
virtual uint64_t currentFrameId() const =0
Get the ID of the newest frame added to the state.
virtual bool removeObservation(uint64_t landmarkId, uint64_t poseId, size_t camIdx, size_t keypointIdx)=0
Remove an observation from a landmark, if available.
virtual int addImu(const ImuParameters &imuParameters)=0
Add an IMU to the configuration.
virtual okvis::Time timestamp(uint64_t frameId) const =0
Get the timestamp for a particular frame.
virtual void optimize(size_t numIter, size_t numThreads=1, bool verbose=false)=0
Start optimization.
An abstract interface for backends.
Definition: VioBackendInterface.hpp:67
MOCK_CONST_METHOD2(getLandmark, bool(uint64_t landmarkId, MapPoint &mapPoint))
virtual bool addStates(okvis::MultiFramePtr multiFrame, const okvis::ImuMeasurementDeque &imuMeasurements, bool asKeyframe)=0
Add a pose to the state.