OKVIS
|
An abstract base class for interfaces between Front- and Backend. More...
#include <VioInterface.hpp>
Public Types | |
typedef std::function< void(const okvis::Time &, const okvis::kinematics::Transformation &)> | StateCallback |
typedef std::function< void(const okvis::Time &, const okvis::kinematics::Transformation &, const Eigen::Matrix< double, 9, 1 > &, const Eigen::Matrix < double, 3, 1 > &)> | FullStateCallback |
typedef 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 |
typedef Eigen::Matrix < unsigned char, Eigen::Dynamic, Eigen::Dynamic > | EigenImage |
typedef std::function< void(const okvis::Time &, const okvis::MapPointVector &, const okvis::MapPointVector &)> | LandmarksCallback |
Public Member Functions | |
VioInterface () | |
virtual | ~VioInterface () |
Setters | |
bool | setImuCsvFile (std::fstream &csvFile) |
Set a CVS file where the IMU data will be saved to. More... | |
bool | setImuCsvFile (const std::string &csvFileName) |
Set a CVS file where the IMU data will be saved to. More... | |
bool | setTracksCsvFile (size_t cameraId, std::fstream &csvFile) |
Set a CVS file where the tracks (data associations) will be saved to. More... | |
bool | setTracksCsvFile (size_t cameraId, const std::string &csvFileName) |
Set a CVS file where the tracks (data associations) will be saved to. More... | |
bool | setPosCsvFile (std::fstream &csvFile) |
Set a CVS file where the position measurements will be saved to. More... | |
bool | setPosCsvFile (const std::string &csvFileName) |
Set a CVS file where the position measurements will be saved to. More... | |
bool | setMagCsvFile (std::fstream &csvFile) |
Set a CVS file where the magnetometer measurements will be saved to. More... | |
bool | setMagCsvFile (const std::string &csvFileName) |
Set a CVS file where the magnetometer measurements will be saved to. More... | |
virtual void | setStateCallback (const StateCallback &stateCallback) |
Set the stateCallback to be called every time a new state is estimated. When an implementing class has an estimate, they can call: stateCallback_( stamp, T_w_vk ); 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. More... | |
virtual void | setFullStateCallback (const FullStateCallback &fullStateCallback) |
Set the fullStateCallback to be called every time a new state is estimated. When an implementing class has an estimate, they can call: _fullStateCallback( stamp, T_w_vk, speedAndBiases, omega_S); 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. finally, omega_S is the rotation speed. More... | |
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. More... | |
virtual void | setLandmarksCallback (const LandmarksCallback &landmarksCallback) |
Set the landmarksCallback to be called every time a new state is estimated. When an implementing class has an estimate, they can call: landmarksCallback_( stamp, landmarksVector ); where stamp is the timestamp landmarksVector contains all 3D-landmarks with id. More... | |
virtual void | setBlocking (bool blocking) |
Set the blocking variable that indicates whether the addMeasurement() functions should return immediately (blocking=false), or only when the processing is complete. More... | |
Add measurements to the algorithm | |
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. More... | |
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. More... | |
virtual bool | addImuMeasurement (const okvis::Time &stamp, const Eigen::Vector3d &alpha, const Eigen::Vector3d &omega)=0 |
Add an IMU measurement. More... | |
virtual void | addPositionMeasurement (const okvis::Time &, const Eigen::Vector3d &, const Eigen::Vector3d &, const Eigen::Matrix3d &) |
Add a position measurement. More... | |
virtual void | addGpsMeasurement (const okvis::Time &, double, double, double, const Eigen::Vector3d &, const Eigen::Matrix3d &) |
Add a position measurement. More... | |
virtual void | addMagnetometerMeasurement (const okvis::Time &, const Eigen::Vector3d &, double) |
Add a magnetometer measurement. More... | |
virtual void | addBarometerMeasurement (const okvis::Time &, double, double) |
Add a static pressure measurement. More... | |
virtual void | addDifferentialPressureMeasurement (const okvis::Time &, double, double) |
Add a differential pressure measurement. More... | |
bool | addEigenImage (const okvis::Time &stamp, size_t cameraIndex, const EigenImage &image) |
This is just handy for the python interface. More... | |
Protected Types | |
typedef std::map< size_t, std::shared_ptr< std::fstream > > | FilePtrMap |
Protected Member Functions | |
bool | writeImuCsvDescription () |
Write first line of IMU CSV file to describe columns. More... | |
bool | writePosCsvDescription () |
Write first line of position CSV file to describe columns. More... | |
bool | writeMagCsvDescription () |
Write first line of magnetometer CSV file to describe columns. More... | |
bool | writeTracksCsvDescription (size_t cameraId) |
Write first line of tracks (data associations) CSV file to describe columns. More... | |
Protected Attributes | |
StateCallback | stateCallback_ |
State callback function. More... | |
FullStateCallback | fullStateCallback_ |
Full state callback function. More... | |
FullStateCallbackWithExtrinsics | fullStateCallbackWithExtrinsics_ |
Full state and extrinsics callback function. More... | |
LandmarksCallback | landmarksCallback_ |
Landmarks callback function. More... | |
std::shared_ptr< std::fstream > | csvImuFile_ |
IMU CSV file. More... | |
std::shared_ptr< std::fstream > | csvPosFile_ |
Position CSV File. More... | |
std::shared_ptr< std::fstream > | csvMagFile_ |
Magnetometer CSV File. More... | |
FilePtrMap | csvTracksFiles_ |
Tracks CSV Files. More... | |
bool | blocking_ |
Blocking option. Whether the addMeasurement() functions should wait until proccessing is complete. More... | |
An abstract base class for interfaces between Front- and Backend.
typedef Eigen::Matrix<unsigned char, Eigen::Dynamic, Eigen::Dynamic> okvis::VioInterface::EigenImage |
|
protected |
typedef std::function< void(const okvis::Time &, const okvis::kinematics::Transformation &, const Eigen::Matrix<double, 9, 1> &, const Eigen::Matrix<double, 3, 1> &)> okvis::VioInterface::FullStateCallback |
typedef 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> >&)> okvis::VioInterface::FullStateCallbackWithExtrinsics |
typedef std::function< void(const okvis::Time &, const okvis::MapPointVector &, const okvis::MapPointVector &)> okvis::VioInterface::LandmarksCallback |
typedef std::function< void(const okvis::Time &, const okvis::kinematics::Transformation &)> okvis::VioInterface::StateCallback |
okvis::VioInterface::VioInterface | ( | ) |
|
virtual |
|
inlinevirtual |
|
inlinevirtual |
Add a differential pressure measurement.
Reimplemented in okvis::ThreadedKFVio.
bool okvis::VioInterface::addEigenImage | ( | const okvis::Time & | stamp, |
size_t | cameraIndex, | ||
const EigenImage & | image | ||
) |
This is just handy for the python interface.
stamp | The image timestamp |
cameraIndex | The index of the camera that the image originates from. |
image | The image. |
|
inlinevirtual |
|
pure virtual |
Add a new image.
stamp | The image timestamp. |
cameraIndex | The index of the camera that the image originates from. |
image | The image. |
keypoints | Optionally aready pass keypoints. This will skip the detection part. |
asKeyframe | Use the new image as keyframe. Not implemented. |
Implemented in okvis::ThreadedKFVio.
|
pure virtual |
Add an IMU measurement.
stamp | The measurement timestamp. |
alpha | The acceleration measured at this time. |
omega | The angular velocity measured at this time. |
Implemented in okvis::ThreadedKFVio.
|
pure virtual |
Add an abstracted image observation.
stamp | The timestamp for the start of integration time for the image. |
cameraIndex | The index of the camera. |
keypoints | A vector where each entry represents a [u,v] keypoint measurement. Also set the size field. |
landmarkIds | A vector of landmark ids for each keypoint measurement. |
descriptors | A matrix containing the descriptors for each keypoint. |
asKeyframe | Optionally force keyframe or not. |
Implemented in okvis::ThreadedKFVio.
|
inlinevirtual |
Add a magnetometer measurement.
Reimplemented in okvis::ThreadedKFVio.
|
inlinevirtual |
|
virtual |
Set the blocking variable that indicates whether the addMeasurement() functions should return immediately (blocking=false), or only when the processing is complete.
Reimplemented in okvis::ThreadedKFVio.
|
virtual |
Set the fullStateCallback to be called every time a new state is estimated. When an implementing class has an estimate, they can call: _fullStateCallback( stamp, T_w_vk, speedAndBiases, omega_S); 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. finally, omega_S is the rotation speed.
|
virtual |
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.
bool okvis::VioInterface::setImuCsvFile | ( | std::fstream & | csvFile | ) |
Set a CVS file where the IMU data will be saved to.
csvFile | The file. |
bool okvis::VioInterface::setImuCsvFile | ( | const std::string & | csvFileName | ) |
Set a CVS file where the IMU data will be saved to.
csvFileName | The filename of a new file. |
|
virtual |
Set the landmarksCallback to be called every time a new state is estimated. When an implementing class has an estimate, they can call: landmarksCallback_( stamp, landmarksVector ); where stamp is the timestamp landmarksVector contains all 3D-landmarks with id.
bool okvis::VioInterface::setMagCsvFile | ( | std::fstream & | csvFile | ) |
Set a CVS file where the magnetometer measurements will be saved to.
csvFile | The file. |
bool okvis::VioInterface::setMagCsvFile | ( | const std::string & | csvFileName | ) |
Set a CVS file where the magnetometer measurements will be saved to.
csvFileName | The filename of a new file. |
bool okvis::VioInterface::setPosCsvFile | ( | std::fstream & | csvFile | ) |
Set a CVS file where the position measurements will be saved to.
csvFile | The file. |
bool okvis::VioInterface::setPosCsvFile | ( | const std::string & | csvFileName | ) |
Set a CVS file where the position measurements will be saved to.
csvFileName | The filename of a new file. |
|
virtual |
Set the stateCallback to be called every time a new state is estimated. When an implementing class has an estimate, they can call: stateCallback_( stamp, T_w_vk ); 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.
bool okvis::VioInterface::setTracksCsvFile | ( | size_t | cameraId, |
std::fstream & | csvFile | ||
) |
Set a CVS file where the tracks (data associations) will be saved to.
cameraId | The camera ID. |
csvFile | The file. |
bool okvis::VioInterface::setTracksCsvFile | ( | size_t | cameraId, |
const std::string & | csvFileName | ||
) |
Set a CVS file where the tracks (data associations) will be saved to.
cameraId | The camera ID. |
csvFileName | The filename of a new file. |
|
protected |
Write first line of IMU CSV file to describe columns.
|
protected |
Write first line of magnetometer CSV file to describe columns.
|
protected |
Write first line of position CSV file to describe columns.
|
protected |
Write first line of tracks (data associations) CSV file to describe columns.
|
protected |
Blocking option. Whether the addMeasurement() functions should wait until proccessing is complete.
|
protected |
IMU CSV file.
|
protected |
Magnetometer CSV File.
|
protected |
Position CSV File.
|
protected |
Tracks CSV Files.
|
protected |
Full state callback function.
|
protected |
Full state and extrinsics callback function.
|
protected |
Landmarks callback function.
|
protected |
State callback function.