43 #ifndef INCLUDE_OKVIS_VIOINTERFACE_HPP_
44 #define INCLUDE_OKVIS_VIOINTERFACE_HPP_
50 #pragma GCC diagnostic push
51 #pragma GCC diagnostic ignored "-Wnon-virtual-dtor"
52 #include <opencv2/core/core.hpp>
53 #include <opencv2/features2d/features2d.hpp>
54 #pragma GCC diagnostic pop
70 typedef std::function<
72 typedef std::function<
74 const Eigen::Matrix<double, 9, 1> &,
76 typedef std::function<
80 const Eigen::Matrix<double, 9, 1> &,
81 const Eigen::Matrix<double, 3, 1> &,
84 typedef Eigen::Matrix<unsigned char, Eigen::Dynamic, Eigen::Dynamic>
EigenImage;
85 typedef std::function<
140 const cv::Mat & image,
141 const std::vector<cv::KeyPoint> * keypoints = 0,
142 bool* asKeyframe = 0) = 0;
155 const std::vector<cv::KeyPoint> & keypoints,
156 const std::vector<uint64_t> & landmarkIds,
157 const cv::Mat& descriptors = cv::Mat(),
158 bool* asKeyframe = 0) = 0;
165 const Eigen::Vector3d & alpha,
166 const Eigen::Vector3d & omega) = 0;
177 const Eigen::Vector3d & ,
178 const Eigen::Matrix3d & ) {
195 const Eigen::Vector3d & ,
196 const Eigen::Matrix3d & ) {
210 const Eigen::Vector3d & ,
double ) {
318 typedef std::map<size_t, std::shared_ptr<std::fstream>>
FilePtrMap;
std::shared_ptr< std::fstream > csvMagFile_
Magnetometer CSV File.
Definition: VioInterface.hpp:317
LandmarksCallback landmarksCallback_
Landmarks callback function.
Definition: VioInterface.hpp:314
Eigen::Matrix< unsigned char, Eigen::Dynamic, Eigen::Dynamic > EigenImage
Definition: VioInterface.hpp:84
FilePtrMap csvTracksFiles_
Tracks CSV Files.
Definition: VioInterface.hpp:319
FullStateCallbackWithExtrinsics fullStateCallbackWithExtrinsics_
Full state and extrinsics callback function.
Definition: VioInterface.hpp:313
virtual void addPositionMeasurement(const okvis::Time &, const Eigen::Vector3d &, const Eigen::Vector3d &, const Eigen::Matrix3d &)
Add a position measurement.
Definition: VioInterface.hpp:175
virtual bool addKeypoints(const okvis::Time &stamp, size_t cameraIndex, const std::vector< cv::KeyPoint > &keypoints, const std::vector< uint64_t > &landmarkIds, const cv::Mat &descriptors=cv::Mat(), bool *asKeyframe=0)=0
Add an abstracted image observation.
bool writeTracksCsvDescription(size_t cameraId)
Write first line of tracks (data associations) CSV file to describe columns.
Definition: VioInterface.cpp:144
bool addEigenImage(const okvis::Time &stamp, size_t cameraIndex, const EigenImage &image)
This is just handy for the python interface.
Definition: VioInterface.cpp:71
bool writeImuCsvDescription()
Write first line of IMU CSV file to describe columns.
Definition: VioInterface.cpp:109
std::map< size_t, std::shared_ptr< std::fstream > > FilePtrMap
Definition: VioInterface.hpp:318
virtual void setStateCallback(const StateCallback &stateCallback)
Set the stateCallback to be called every time a new state is estimated. When an implementing class ha...
Definition: VioInterface.cpp:80
bool setTracksCsvFile(size_t cameraId, std::fstream &csvFile)
Set a CVS file where the tracks (data associations) will be saved to.
Definition: VioInterface.cpp:210
virtual void setBlocking(bool blocking)
Set the blocking variable that indicates whether the addMeasurement() functions should return immedia...
Definition: VioInterface.cpp:104
virtual void addDifferentialPressureMeasurement(const okvis::Time &, double, double)
Add a differential pressure measurement.
Definition: VioInterface.hpp:234
bool writePosCsvDescription()
Write first line of position CSV file to describe columns.
Definition: VioInterface.cpp:122
FullStateCallback fullStateCallback_
Full state callback function.
Definition: VioInterface.hpp:312
std::function< void(const okvis::Time &, const okvis::kinematics::Transformation &, const Eigen::Matrix< double, 9, 1 > &, const Eigen::Matrix< double, 3, 1 > &)> FullStateCallback
Definition: VioInterface.hpp:75
Header file for the TimeBase, Time and WallTime class.
std::function< void(const okvis::Time &, const okvis::kinematics::Transformation &, const Eigen::Matrix< double, 9, 1 > &, const Eigen::Matrix< double, 3, 1 > &, const std::vector< okvis::kinematics::Transformation, Eigen::aligned_allocator< okvis::kinematics::Transformation > > &)> FullStateCallbackWithExtrinsics
Definition: VioInterface.hpp:83
std::function< void(const okvis::Time &, const okvis::MapPointVector &, const okvis::MapPointVector &)> LandmarksCallback
Definition: VioInterface.hpp:87
std::vector< MapPoint, Eigen::aligned_allocator< MapPoint > > MapPointVector
Definition: FrameTypedefs.hpp:172
virtual ~VioInterface()
Definition: VioInterface.cpp:55
bool setMagCsvFile(std::fstream &csvFile)
Set a CVS file where the magnetometer measurements will be saved to.
Definition: VioInterface.cpp:192
#define OKVIS_THROW(exceptionType, message)
Definition: assert_macros.hpp:98
#define OKVIS_DEFINE_EXCEPTION(exceptionName, exceptionParent)
Macro for defining an exception with a given parent.
Definition: assert_macros.hpp:52
virtual void setLandmarksCallback(const LandmarksCallback &landmarksCallback)
Set the landmarksCallback to be called every time a new state is estimated. When an implementing clas...
Definition: VioInterface.cpp:97
This file contains some useful assert macros.
bool writeMagCsvDescription()
Write first line of magnetometer CSV file to describe columns.
Definition: VioInterface.cpp:133
std::shared_ptr< std::fstream > csvImuFile_
IMU CSV file.
Definition: VioInterface.hpp:315
virtual void setFullStateCallback(const FullStateCallback &fullStateCallback)
Set the fullStateCallback to be called every time a new state is estimated. When an implementing clas...
Definition: VioInterface.cpp:85
bool setPosCsvFile(std::fstream &csvFile)
Set a CVS file where the position measurements will be saved to.
Definition: VioInterface.cpp:174
bool blocking_
Blocking option. Whether the addMeasurement() functions should wait until proccessing is complete...
Definition: VioInterface.hpp:320
StateCallback stateCallback_
State callback function.
Definition: VioInterface.hpp:311
An abstract base class for interfaces between Front- and Backend.
Definition: VioInterface.hpp:66
bool setImuCsvFile(std::fstream &csvFile)
Set a CVS file where the IMU data will be saved to.
Definition: VioInterface.cpp:156
VioInterface()
Definition: VioInterface.cpp:53
std::function< void(const okvis::Time &, const okvis::kinematics::Transformation &)> StateCallback
Definition: VioInterface.hpp:71
virtual void addGpsMeasurement(const okvis::Time &, double, double, double, const Eigen::Vector3d &, const Eigen::Matrix3d &)
Add a position measurement.
Definition: VioInterface.hpp:192
virtual void addBarometerMeasurement(const okvis::Time &, double, double)
Add a static pressure measurement.
Definition: VioInterface.hpp:221
Time representation. May either represent wall clock time or ROS clock time.
Definition: Time.hpp:187
virtual bool addImuMeasurement(const okvis::Time &stamp, const Eigen::Vector3d &alpha, const Eigen::Vector3d &omega)=0
Add an IMU measurement.
virtual void setFullStateCallbackWithExtrinsics(const FullStateCallbackWithExtrinsics &fullStateCallbackWithExtrinsics)
Set the fullStateCallbackWithExtrinsics to be called every time a new state is estimated. When an implementing class has an estimate, they can call: _fullStateCallbackWithEctrinsics( stamp, T_w_vk, speedAndBiases, omega_S, vector_of_T_SCi); where stamp is the timestamp and T_w_vk is the transformation (and uncertainty) that transforms points from the vehicle frame to the world frame. speedAndBiases contain speed in world frame followed by gyro and acc biases. omega_S is the rotation speed vector_of_T_SCi contains the (uncertain) transformations of extrinsics T_SCi.
Definition: VioInterface.cpp:91
std::shared_ptr< std::fstream > csvPosFile_
Position CSV File.
Definition: VioInterface.hpp:316
virtual void addMagnetometerMeasurement(const okvis::Time &, const Eigen::Vector3d &, double)
Add a magnetometer measurement.
Definition: VioInterface.hpp:208
virtual bool addImage(const okvis::Time &stamp, size_t cameraIndex, const cv::Mat &image, const std::vector< cv::KeyPoint > *keypoints=0, bool *asKeyframe=0)=0
Add a new image.
This file contains useful typedefs and structs related to frames.