ZED双目摄像头惯导数据获取及其理解

sl::Pose camera_pose;
sl::TRACKING_STATE tracking_state = zed.getPosition(camera_pose, sl::REFERENCE_FRAME_WORLD);
if (tracking_state == TRACKING_STATE_OK) {
				//float translation_left_to_center = zed.getCameraInformation().calibration_parameters.T.x * 0.5f;//60mm
				// getPosition() outputs the position of the Camera Frame, which is located on the left eye of the camera.
				// To get the position of the center of the camera, we transform the pose data into a new frame located at the center of the camera.
				// The generic formula used here is: Pose(new reference frame) = M.inverse() * Pose (camera frame) * M, where M is the transform between two frames.
				//transformPose(camera_pose.pose_data, translation_left_to_center); // Get the pose at the center of the camera (baseline/2 on X axis)
				quaternion = camera_pose.getOrientation();
				rotation_marrix = camera_pose.getRotationMatrix();
				//std::cout << "rotation_matrix:" << tranform_sl_matrix(rotation_marrix) << std::endl;
				rotation = camera_pose.getEulerAngles(); // due to ours systems adopt left eye of the camera as the center.so we do not need to transform further
				translation = camera_pose.getTranslation();
}

以上代码是zed摄像头获取IMU的数据,直接有接口可以获取数据,有欧拉角,四元素,旋转矩阵,平移量。

上面数据的方向一切都是以惯导移动之后的方向作为向量的方向!这一点很重要!

例如:要实现移动之后的摄像头坐标转换到移动之前的坐标系,设现在zed的坐标系为xyz,移动之前的为XYZ,那么计算的公式为:

Rotation_matrix*[x+translation.x, y+translation.y, z+translation.z]T=[X, Y, Z]T;

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值