Function log_pinhole_depth

Source
pub fn log_pinhole_depth(
    rec: &RecordingStream,
    cam: &Camera,
    cam_position: Vector3<f32>,
    cam_orientation: UnitQuaternion<f32>,
    cam_transform: [f32; 9],
) -> Result<(), SimulationError>
Expand description

creates pinhole camera

§Arguments

  • rec - The rerun::RecordingStream instance
  • cam - The camera object
  • cam_position - The position vector of the camera (aligns with the quad)
  • cam_orientation - The orientation quaternion of quad
  • cam_transform - The transform matrix between quad and camera alignment

§Errors

  • If the data cannot be logged to the recording stream

§Example

use peng_quad::{log_pinhole_depth, Camera};
use nalgebra::{Vector3, UnitQuaternion};
let rec = rerun::RecordingStreamBuilder::new("peng").spawn().unwrap();
let depth_image = vec![ 0.0f32 ; 640 * 480];
let cam_position = Vector3::new(0.0,0.0,0.0);
let cam_orientation = UnitQuaternion::identity();
let cam_transform = [0.0, 0.0, 1.0, -1.0, 0.0, 0.0, 0.0, -1.0, 0.0];
let camera = Camera::new((800, 600), 60.0, 0.1, 100.0);
log_pinhole_depth(&rec, &camera, cam_position, cam_orientation, cam_transform).unwrap();