此页面由 AI 自动翻译。查看英文原版

本页目录

  • 如何放置它
  • 输入和输出
  • 用法
  • 功能示例
  • 参考

Basalt VIO 节点

Supported on:RVC2
BasaltVIO 主机节点用于主机端的立体惯性视觉里程计。它接收同步的左右摄像头帧以及 IMU 数据,并输出估计的运动,形式为 TransformData 以及一个直通的 ImgFrame 流。

如何放置它

Python

Python
1with dai.Pipeline() as pipeline:
2    vio = pipeline.create(dai.node.BasaltVIO)

C++

C++
1dai::Pipeline pipeline;
2auto vio = pipeline.create<dai::node::BasaltVIO>();

输入和输出

用法

Python

Python
1with dai.Pipeline() as pipeline:
2    left = pipeline.create(dai.node.Camera).build(dai.CameraBoardSocket.CAM_B, sensorFps=60)
3    right = pipeline.create(dai.node.Camera).build(dai.CameraBoardSocket.CAM_C, sensorFps=60)
4    imu = pipeline.create(dai.node.IMU)
5    vio = pipeline.create(dai.node.BasaltVIO)
6
7    imu.enableIMUSensor(
8        [dai.IMUSensor.ACCELEROMETER_RAW, dai.IMUSensor.GYROSCOPE_RAW],
9        200,
10    )
11    imu.setBatchReportThreshold(1)
12    imu.setMaxBatchReports(10)
13
14    left.requestOutput((640, 400)).link(vio.left)
15    right.requestOutput((640, 400)).link(vio.right)
16    imu.out.link(vio.imu)
17
18    transformQueue = vio.transform.createOutputQueue()
19    passthroughQueue = vio.passthrough.createOutputQueue()

C++

C++
1dai::Pipeline pipeline;
2auto left = pipeline.create<dai::node::Camera>()->build(dai::CameraBoardSocket::CAM_B, std::nullopt, 60);
3auto right = pipeline.create<dai::node::Camera>()->build(dai::CameraBoardSocket::CAM_C, std::nullopt, 60);
4auto imu = pipeline.create<dai::node::IMU>();
5auto vio = pipeline.create<dai::node::BasaltVIO>();
6
7imu->enableIMUSensor({dai::IMUSensor::ACCELEROMETER_RAW, dai::IMUSensor::GYROSCOPE_RAW}, 200);
8imu->setBatchReportThreshold(1);
9imu->setMaxBatchReports(10);
10
11left->requestOutput(std::make_pair(640, 400))->link(vio->left);
12right->requestOutput(std::make_pair(640, 400))->link(vio->right);
13imu->out.link(vio->imu);
14
15auto transformQueue = vio->transform.createOutputQueue();
16auto passthroughQueue = vio->passthrough.createOutputQueue();

功能示例

参考

class

dai::node::BasaltVIO

#include BasaltVIO.hpp
variable
variable
InputMap & inputs
variable
std::string leftInputName
variable
std::string rightInputName
variable
Input & left
Input left image on which VIO is performed.
variable
Input & right
Input right image on which VIO is performed.
variable
Input imu
Input IMU data.
variable
Output transform
Output transform data.
variable
Output passthrough
Output passthrough of left image.
function
BasaltVIO()
function
~BasaltVIO()
function
void buildInternal()
inline function
void setImuUpdateRate(int rate)
inline function
void setConfigPath(const std::string & path)
function
void setConfig(const VioConfig & config)
inline function
void setUseSpecTranslation(bool use)
function
void setLocalTransform(const std::shared_ptr< TransformData > & transform)
function
void setImuExtrinsics(const std::shared_ptr< TransformData > & imuExtr)
function
void setAccelBias(const std::vector< double > & accelBias)
function
void setAccelNoiseStd(const std::vector< double > & accelNoiseStd)
function
void setGyroBias(const std::vector< double > & gyroBias)
function
void setGyroNoiseStd(const std::vector< double > & gyroNoiseStd)
function
void setDefaultVIOConfig()
function
void runSyncOnHost(bool runOnHost)
struct

dai::node::BasaltVIO::VioConfig

variable
std::string optical_flow_type
variable
int optical_flow_detection_grid_size
variable
int optical_flow_detection_num_points_cell
variable
int optical_flow_detection_min_threshold
variable
int optical_flow_detection_max_threshold
variable
bool optical_flow_detection_nonoverlap
variable
float optical_flow_max_recovered_dist2
variable
int optical_flow_pattern
variable
int optical_flow_max_iterations
variable
int optical_flow_levels
variable
float optical_flow_epipolar_error
variable
int optical_flow_skip_frames
variable
MatchingGuessType optical_flow_matching_guess_type
variable
float optical_flow_matching_default_depth
variable
float optical_flow_image_safe_radius
variable
bool optical_flow_recall_enable
variable
bool optical_flow_recall_all_cams
variable
bool optical_flow_recall_num_points_cell
variable
bool optical_flow_recall_over_tracking
variable
bool optical_flow_recall_update_patch_viewpoint
variable
float optical_flow_recall_max_patch_dist
variable
std::vector< float > optical_flow_recall_max_patch_norms
variable
LinearizationType vio_linearization_type
variable
bool vio_sqrt_marg
variable
int vio_max_states
variable
int vio_max_kfs
variable
int vio_min_frames_after_kf
variable
float vio_new_kf_keypoints_thresh
variable
bool vio_debug
variable
bool vio_extended_logging
variable
int vio_max_iterations
variable
double vio_obs_std_dev
variable
double vio_obs_huber_thresh
variable
double vio_min_triangulation_dist
variable
bool vio_enforce_realtime
variable
bool vio_use_lm
variable
double vio_lm_lambda_initial
variable
double vio_lm_lambda_min
variable
double vio_lm_lambda_max
variable
bool vio_scale_jacobian
variable
double vio_init_pose_weight
variable
double vio_init_ba_weight
variable
double vio_init_bg_weight
variable
bool vio_marg_lost_landmarks
variable
bool vio_fix_long_term_keyframes
variable
double vio_kf_marg_feature_ratio
variable
KeyframeMargCriteria vio_kf_marg_criteria
variable
double mapper_obs_std_dev
variable
double mapper_obs_huber_thresh
variable
int mapper_detection_num_points
variable
double mapper_num_frames_to_match
variable
double mapper_frames_to_match_threshold
variable
double mapper_min_matches
variable
double mapper_ransac_threshold
variable
double mapper_min_track_length
variable
double mapper_max_hamming_distance
variable
double mapper_second_best_test_ratio
variable
int mapper_bow_num_bits
variable
double mapper_min_triangulation_dist
variable
bool mapper_no_factor_weights
variable
bool mapper_use_factors
variable
bool mapper_use_lm
variable
double mapper_lm_lambda_min
variable
double mapper_lm_lambda_max
enum

LinearizationType

enumerator
ABS_QR
enumerator
ABS_SC
enumerator
REL_SC
enum

MatchingGuessType

enumerator
SAME_PIXEL
enumerator
REPROJ_FIX_DEPTH
enumerator
REPROJ_AVG_DEPTH
enum

KeyframeMargCriteria

enumerator
KF_MARG_DEFAULT
enumerator
KF_MARG_FORWARD_VECTOR

需要帮助?

请前往 Discussion Forum 获取技术支持或提出您可能有的任何其他问题。