Core class that manages the entire system. More...
#include <VioManager.h>
Public Member Functions | |
void | feed_measurement_camera (const ov_core::CameraData &message) |
Feed function for camera measurements. More... | |
void | feed_measurement_imu (const ov_core::ImuData &message) |
Feed function for inertial data. More... | |
void | feed_measurement_simulation (double timestamp, const std::vector< int > &camids, const std::vector< std::vector< std::pair< size_t, Eigen::VectorXf >>> &feats) |
Feed function for a synchronized simulated cameras. More... | |
void | get_active_image (double ×tamp, cv::Mat &image) |
Return the image used when projecting the active tracks. More... | |
void | get_active_tracks (double ×tamp, std::unordered_map< size_t, Eigen::Vector3d > &feat_posinG, std::unordered_map< size_t, Eigen::Vector3d > &feat_tracks_uvd) |
Returns active tracked features in the current frame. More... | |
std::vector< Eigen::Vector3d > | get_features_ARUCO () |
Returns 3d ARUCO features in the global frame. More... | |
std::vector< Eigen::Vector3d > | get_features_SLAM () |
Returns 3d SLAM features in the global frame. More... | |
std::vector< Eigen::Vector3d > | get_good_features_MSCKF () |
Returns 3d features used in the last update in global frame. More... | |
cv::Mat | get_historical_viz_image () |
Get a nice visualization image of what tracks we have. More... | |
VioManagerOptions | get_params () |
Accessor for current system parameters. More... | |
std::shared_ptr< Propagator > | get_propagator () |
Accessor to get the current propagator. More... | |
std::shared_ptr< State > | get_state () |
Accessor to get the current state. More... | |
void | initialize_with_gt (Eigen::Matrix< double, 17, 1 > imustate) |
Given a state, this will initialize our IMU state. More... | |
bool | initialized () |
If we are initialized or not. More... | |
double | initialized_time () |
Timestamp that the system was initialized at. More... | |
VioManager (VioManagerOptions ¶ms_) | |
Default constructor, will load all configuration variables. More... | |
Protected Member Functions | |
void | do_feature_propagate_update (const ov_core::CameraData &message) |
This will do the propagation and feature updates to the state. More... | |
void | retriangulate_active_tracks (const ov_core::CameraData &message) |
This function will will re-triangulate all features in the current frame. More... | |
void | track_image_and_update (const ov_core::CameraData &message) |
Given a new set of camera images, this will track them. More... | |
bool | try_to_initialize (const ov_core::CameraData &message) |
This function will try to initialize the state. More... | |
Protected Attributes | |
std::map< size_t, Eigen::Matrix3d > | active_feat_linsys_A |
std::map< size_t, Eigen::Vector3d > | active_feat_linsys_b |
std::map< size_t, int > | active_feat_linsys_count |
cv::Mat | active_image |
std::unordered_map< size_t, Eigen::Vector3d > | active_tracks_posinG |
double | active_tracks_time = -1 |
std::unordered_map< size_t, Eigen::Vector3d > | active_tracks_uvd |
std::vector< double > | camera_queue_init |
std::mutex | camera_queue_init_mtx |
bool | did_zupt_update = false |
double | distance = 0 |
std::vector< Eigen::Vector3d > | good_features_MSCKF |
bool | has_moved_since_zupt = false |
std::shared_ptr< ov_init::InertialInitializer > | initializer |
State initializer. More... | |
bool | is_initialized_vio = false |
Boolean if we are initialized or not. More... | |
std::ofstream | of_statistics |
VioManagerOptions | params |
Manager parameters. More... | |
std::shared_ptr< Propagator > | propagator |
Propagator of our state. More... | |
boost::posix_time::ptime | rT1 |
boost::posix_time::ptime | rT2 |
boost::posix_time::ptime | rT3 |
boost::posix_time::ptime | rT4 |
boost::posix_time::ptime | rT5 |
boost::posix_time::ptime | rT6 |
boost::posix_time::ptime | rT7 |
double | startup_time = -1 |
std::shared_ptr< State > | state |
Our master state object :D. More... | |
std::atomic< bool > | thread_init_running |
std::atomic< bool > | thread_init_success |
double | timelastupdate = -1 |
std::shared_ptr< ov_core::TrackBase > | trackARUCO |
Our aruoc tracker. More... | |
std::shared_ptr< ov_core::TrackBase > | trackFEATS |
Our sparse feature tracker (klt or descriptor) More... | |
std::shared_ptr< UpdaterMSCKF > | updaterMSCKF |
Our MSCKF feature updater. More... | |
std::shared_ptr< UpdaterSLAM > | updaterSLAM |
Our SLAM/ARUCO feature updater. More... | |
std::shared_ptr< UpdaterZeroVelocity > | updaterZUPT |
Our zero velocity tracker. More... | |
Core class that manages the entire system.
This class contains the state and other algorithms needed for the MSCKF to work. We feed in measurements into this class and send them to their respective algorithms. If we have measurements to propagate or update with, this class will call on our state to do that.
Definition at line 62 of file VioManager.h.
VioManager::VioManager | ( | VioManagerOptions & | params_ | ) |
Default constructor, will load all configuration variables.
params_ | Parameters loaded from either ROS or CMDLINE |
Definition at line 50 of file VioManager.cpp.
|
protected |
This will do the propagation and feature updates to the state.
message | Contains our timestamp, images, and camera ids |
Definition at line 323 of file VioManager.cpp.
|
inline |
Feed function for camera measurements.
message | Contains our timestamp, images, and camera ids |
Definition at line 81 of file VioManager.h.
void VioManager::feed_measurement_imu | ( | const ov_core::ImuData & | message | ) |
Feed function for inertial data.
message | Contains our timestamp and inertial information |
Definition at line 166 of file VioManager.cpp.
void VioManager::feed_measurement_simulation | ( | double | timestamp, |
const std::vector< int > & | camids, | ||
const std::vector< std::vector< std::pair< size_t, Eigen::VectorXf >>> & | feats | ||
) |
Feed function for a synchronized simulated cameras.
timestamp | Time that this image was collected |
camids | Camera ids that we have simulated measurements for |
feats | Raw uv simulated measurements |
Definition at line 191 of file VioManager.cpp.
|
inline |
Return the image used when projecting the active tracks.
Definition at line 126 of file VioManager.h.
|
inline |
Returns active tracked features in the current frame.
Definition at line 132 of file VioManager.h.
std::vector< Eigen::Vector3d > VioManager::get_features_ARUCO | ( | ) |
Returns 3d ARUCO features in the global frame.
Definition at line 440 of file VioManagerHelper.cpp.
std::vector< Eigen::Vector3d > VioManager::get_features_SLAM | ( | ) |
Returns 3d SLAM features in the global frame.
Definition at line 417 of file VioManagerHelper.cpp.
|
inline |
Returns 3d features used in the last update in global frame.
Definition at line 123 of file VioManager.h.
cv::Mat VioManager::get_historical_viz_image | ( | ) |
Get a nice visualization image of what tracks we have.
Definition at line 389 of file VioManagerHelper.cpp.
|
inline |
Accessor for current system parameters.
Definition at line 105 of file VioManager.h.
|
inline |
Accessor to get the current propagator.
Definition at line 111 of file VioManager.h.
|
inline |
Accessor to get the current state.
Definition at line 108 of file VioManager.h.
void VioManager::initialize_with_gt | ( | Eigen::Matrix< double, 17, 1 > | imustate | ) |
Given a state, this will initialize our IMU state.
imustate | State in the MSCKF ordering: [time(sec),q_GtoI,p_IinG,v_IinG,b_gyro,b_accel] |
Definition at line 40 of file VioManagerHelper.cpp.
|
inline |
If we are initialized or not.
Definition at line 99 of file VioManager.h.
|
inline |
Timestamp that the system was initialized at.
Definition at line 102 of file VioManager.h.
|
protected |
This function will will re-triangulate all features in the current frame.
For all features that are currently being tracked by the system, this will re-triangulate them. This is useful for downstream applications which need the current pointcloud of points (e.g. loop closure). This will try to triangulate all points, not just ones that have been used in the update.
message | Contains our timestamp, images, and camera ids |
Definition at line 190 of file VioManagerHelper.cpp.
|
protected |
Given a new set of camera images, this will track them.
If we are having stereo tracking, we should call stereo tracking functions. Otherwise we will try to track on each of the images passed.
message | Contains our timestamp, images, and camera ids |
Definition at line 256 of file VioManager.cpp.
|
protected |
This function will try to initialize the state.
This should call on our initializer and try to init the state. In the future we should call the structure-from-motion code from here. This function could also be repurposed to re-initialize the system after failure.
message | Contains our timestamp, images, and camera ids |
Definition at line 78 of file VioManagerHelper.cpp.
|
protected |
Definition at line 241 of file VioManager.h.
|
protected |
Definition at line 242 of file VioManager.h.
|
protected |
Definition at line 243 of file VioManager.h.
|
protected |
Definition at line 240 of file VioManager.h.
|
protected |
Definition at line 238 of file VioManager.h.
|
protected |
Definition at line 237 of file VioManager.h.
|
protected |
Definition at line 239 of file VioManager.h.
|
protected |
This is the queue of measurement times that have come in since we starting doing initialization After we initialize, we will want to prop & update to the latest timestamp quickly
Definition at line 211 of file VioManager.h.
|
protected |
Definition at line 212 of file VioManager.h.
|
protected |
Definition at line 229 of file VioManager.h.
|
protected |
Definition at line 220 of file VioManager.h.
|
protected |
Definition at line 233 of file VioManager.h.
|
protected |
Definition at line 230 of file VioManager.h.
|
protected |
State initializer.
Definition at line 195 of file VioManager.h.
|
protected |
Boolean if we are initialized or not.
Definition at line 198 of file VioManager.h.
|
protected |
Definition at line 215 of file VioManager.h.
|
protected |
Manager parameters.
Definition at line 180 of file VioManager.h.
|
protected |
Propagator of our state.
Definition at line 186 of file VioManager.h.
|
protected |
Definition at line 216 of file VioManager.h.
|
protected |
Definition at line 216 of file VioManager.h.
|
protected |
Definition at line 216 of file VioManager.h.
|
protected |
Definition at line 216 of file VioManager.h.
|
protected |
Definition at line 216 of file VioManager.h.
|
protected |
Definition at line 216 of file VioManager.h.
|
protected |
Definition at line 216 of file VioManager.h.
|
protected |
Definition at line 223 of file VioManager.h.
|
protected |
Our master state object :D.
Definition at line 183 of file VioManager.h.
|
protected |
Definition at line 226 of file VioManager.h.
|
protected |
Definition at line 226 of file VioManager.h.
|
protected |
Definition at line 219 of file VioManager.h.
|
protected |
Our aruoc tracker.
Definition at line 192 of file VioManager.h.
|
protected |
Our sparse feature tracker (klt or descriptor)
Definition at line 189 of file VioManager.h.
|
protected |
Our MSCKF feature updater.
Definition at line 201 of file VioManager.h.
|
protected |
Our SLAM/ARUCO feature updater.
Definition at line 204 of file VioManager.h.
|
protected |
Our zero velocity tracker.
Definition at line 207 of file VioManager.h.