|
VOXL OpenVINS Server 1.0
Visual Inertial Odometry Server for VOXL Platform
|
Singleton class for publishing VIO data. More...
#include <VoxlHK.h>
Public Member Functions | |
| Publisher (const Publisher &)=delete | |
| Publisher & | operator= (const Publisher &)=delete |
| void | start () |
| Start the publisher. | |
| void | publish (std::shared_ptr< ov_msckf::State > state, std::map< double, std::vector< std::shared_ptr< ov_core::Feature > > > used_features_map={}) |
| Publish VIO data. | |
| void | stop () |
| Stop the publisher. | |
| bool | should_auto_reset (std::shared_ptr< ov_msckf::State > state, int quality, int n_features, double V_uncertainty, double yawrate, double current_velocity, double vel_x, double vel_y) |
| Check if auto-reset should be triggered. | |
| double | calcQuality (const std::map< double, std::vector< std::shared_ptr< ov_core::Feature > > > &used_features_map, std::unordered_map< size_t, std::shared_ptr< ov_type::Landmark > > &slam_features, std::shared_ptr< ov_msckf::State > state) |
| Calculate Quality of the VIO state. | |
| void | set_first_packet (bool first_packet_) |
| Set the first packet flag. | |
| void | publishBlank () |
Static Public Member Functions | |
| static Publisher & | getInstance () |
| Get singleton instance. | |
| static void | ov_vio_control_pipe_cb (int ch, char *string, int bytes, void *context) |
| Control pipe callback function. | |
Singleton class for publishing VIO data.
This class manages the publication of VIO data to external systems through pipe interfaces. It implements the singleton pattern to ensure only one instance exists throughout the application lifecycle.
The publisher handles:
| double Publisher::calcQuality | ( | const std::map< double, std::vector< std::shared_ptr< ov_core::Feature > > > & | used_features_map, |
| std::unordered_map< size_t, std::shared_ptr< ov_type::Landmark > > & | slam_features, | ||
| std::shared_ptr< ov_msckf::State > | state | ||
| ) |
Calculate Quality of the VIO state.
This function computes the quality score based on the features used at the current timestamp. The quality calculation considers:
| used_features_map | Map of used features at the current timestamp |
| slam_features | Map of SLAM features from the state |
| state | Current VIO state for covariance access |
This function computes the quality score based on the features used at the current timestamp. The quality calculation considers:
| used_features_map | Map of used features at the current timestamp |
| slam_features | Map of SLAM features from the state |
| state | Current VIO state for covariance access |
Definition at line 1177 of file VoxlPublisher.cpp.
Referenced by publish().

|
inlinestatic |
Get singleton instance.
Definition at line 142 of file VoxlHK.h.
Referenced by _imu_data_handler_cb(), and main().

|
static |
Control pipe callback function.
Control-pipe callback for VIO commands.
Callback function to handle control pipe messages
This function is invoked every time a message is received on the VIO control pipe.
| ch | Channel id supplied by the pipe framework. |
| string | Pointer to the received buffer. |
| bytes | Number of valid bytes in string. |
| context | User context pointer supplied during registration. |
STR_MATCH() macro, which compares the prefix of string against the command literal. Definition at line 92 of file VoxlPublisher.cpp.
References is_resetting, and reset_requested.
| void Publisher::publish | ( | std::shared_ptr< ov_msckf::State > | state, |
| std::map< double, std::vector< std::shared_ptr< ov_core::Feature > > > | used_features_map = {} |
||
| ) |
Publish VIO data.
Publish VIO data to external systems.
Publishes the current VIO state and tracking information to external systems through the configured pipe interfaces.
| state | Current VIO state |
| used_features_map | Map of used features at current timestamp |
This method formats and publishes the current VIO state and tracking information to external systems through the configured pipe interfaces.
The function performs the following operations:
The coordinate frame transformation involves:
| state | Current VIO state containing pose, velocity, and covariance |
Definition at line 142 of file VoxlPublisher.cpp.
References alt_z, auto_reset_max_v_cov_instant, auto_reset_max_v_cov_timeout_s, auto_reset_max_velocity, auto_reset_min_feature_timeout_s, auto_reset_min_features, calcQuality(), voxl::dirtyOmega(), en_debug, EXTENDED_CH, fast_yaw_thresh, fast_yaw_timeout_s, frame_transform, has_acc_jerk, is_armed, is_resetting, non_static, ok_state_grace_timeout_s, quality_bad_to_good_count, quality_good_to_bad_count, quality_high_thresh, quality_initial_to_bad_count, quality_initial_to_good_count, quality_low_thresh_good, quality_low_thresh_initial, voxl::R_OV_FRD(), reset_num_counter, reset_requested, should_auto_reset(), SIMPLE_CH, vio_error_codes, vio_manager, and vio_state.
Referenced by _imu_data_handler_cb().


| void Publisher::publishBlank | ( | ) |
Definition at line 1460 of file VoxlPublisher.cpp.
|
inline |
| bool Publisher::should_auto_reset | ( | std::shared_ptr< ov_msckf::State > | state, |
| int | quality, | ||
| int | n_features, | ||
| double | V_uncertainty, | ||
| double | yawrate, | ||
| double | current_velocity, | ||
| double | vel_x, | ||
| double | vel_y | ||
| ) |
Check if auto-reset should be triggered.
Evaluates current VIO state and error conditions to determine if an automatic reset should be triggered.
| state | Current VIO state |
| quality | Current quality value |
| n_features | Number of tracked features |
| V_uncertainty | Velocity uncertainty |
| yawrate | Calculated yaw rate from angular velocity |
| current_velocity | Current velocity magnitude |
| vel_x | X-component of velocity |
| vel_y | Y-component of velocity |
This function evaluates the current VIO state and various error conditions to determine if an automatic reset should be triggered. It implements the same logic as the legacy code but in a more modular way.
| state | Current VIO state |
| quality | Current quality value |
| n_features | Number of tracked features |
| V_uncertainty | Velocity uncertainty |
Definition at line 1033 of file VoxlPublisher.cpp.
References auto_reset_max_v_cov_instant, auto_reset_max_v_cov_timeout_s, auto_reset_max_velocity, auto_reset_min_feature_timeout_s, auto_reset_min_features, en_auto_reset, en_debug, fast_yaw_thresh, fast_yaw_timeout_s, is_armed, and reset_num_counter.
Referenced by publish().

| void Publisher::start | ( | ) |
Start the publisher.
Initializes the publisher and prepares it for data transmission.
Initializes the publisher and prepares it for data transmission. Sets the first_packet flag to true to handle the initial angular velocity calculation.
Definition at line 52 of file VoxlPublisher.cpp.
References voxl::HealthCheck::getInstance(), voxl::HealthCheck::start(), and vio_state.
Referenced by main().


| void Publisher::stop | ( | ) |
Stop the publisher.
Stops the publisher and cleans up resources.
Stops the publisher and cleans up resources. Currently a placeholder for future cleanup operations.
Definition at line 70 of file VoxlPublisher.cpp.
References voxl::HealthCheck::getInstance(), and voxl::HealthCheck::stop().
