Skip to content

Commit

Permalink
mvg: rerun-io api change
Browse files Browse the repository at this point in the history
  • Loading branch information
astraw committed Feb 8, 2025
1 parent c20dafd commit 96adb02
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions braidz-export-rrd/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use clap::{Parser, ValueEnum};
use eyre::{self as anyhow, WrapErr};
use frame_source::{ImageData, Timestamp};
use mp4_writer::Mp4Writer;
use mvg::rerun_io::{cam_geom_to_rr_pinhole_archetype as to_pinhole, AsRerunTransform3D};
use mvg::rerun_io::AsRerunTransform3D;
use rayon::prelude::*;
use re_types::{
archetypes::{EncodedImage, Pinhole, Points2D, Points3D},
Expand Down Expand Up @@ -205,7 +205,11 @@ impl OfflineBraidzRerunLogger {
let lin_cam = cam.linearize_to_cam_geom();
// This returns error in case of skew, because rerun's pinhole
// model does not support skew.
let re_cam = to_pinhole(&lin_cam, cam.width(), cam.height())?;
let re_cam = mvg::rerun_io::cam_geom_to_rr_pinhole_archetype(
lin_cam.intrinsics(),
cam.width(),
cam.height(),
)?;
self.rec.log_static(lin_path.clone(), &re_cam)?;

let use_intrinsics = Some(cam.intrinsics().clone());
Expand Down
4 changes: 2 additions & 2 deletions geometry/mvg/src/rerun_io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,11 @@ fn pinhole_projection_component<R: RealField>(
}

pub fn cam_geom_to_rr_pinhole_archetype<R: RealField>(
cam: &cam_geom::Camera<R, cam_geom::IntrinsicParametersPerspective<R>>,
intrinsics: &cam_geom::IntrinsicParametersPerspective<R>,
width: usize,
height: usize,
) -> Result<re_types::archetypes::Pinhole, MvgError> {
let i = cam.intrinsics();
let i = intrinsics;
if i.skew().f32().abs() > 1e-10 {
return Err(MvgError::RerunUnsupportedIntrinsics);
}
Expand Down

0 comments on commit 96adb02

Please sign in to comment.