diff --git a/examples/cu_pointclouds/ptclouds.ron b/examples/cu_pointclouds/ptclouds.ron index 2b2523a0a..6ccec8605 100644 --- a/examples/cu_pointclouds/ptclouds.ron +++ b/examples/cu_pointclouds/ptclouds.ron @@ -6,7 +6,7 @@ ), ( id: "rerun", - type: "RerunViz", + type: "RerunPlyViz", ), ], cnx: [ diff --git a/examples/cu_pointclouds/src/main.rs b/examples/cu_pointclouds/src/main.rs index 760a150f2..f92a5e639 100644 --- a/examples/cu_pointclouds/src/main.rs +++ b/examples/cu_pointclouds/src/main.rs @@ -84,36 +84,29 @@ const SLAB_SIZE: Option = Some(100 * 1024 * 1024); #[copper_runtime(config = "ptclouds.ron")] struct PtCloudsApplication {} -struct RerunViz { +struct RerunPlyViz { rec: Option, } -impl Freezable for RerunViz {} +impl Freezable for RerunPlyViz {} -impl<'cl> CuSinkTask<'cl> for RerunViz { +impl<'cl> CuSinkTask<'cl> for RerunPlyViz { type Input = input_msg!('cl, LidarCuMsgPayload); fn new(_config: Option<&ComponentConfig>) -> Result where Self: Sized, { - Ok(Self { rec: None }) - } - - fn start(&mut self, _clock: &RobotClock) -> Result<(), CuError> { - self.rec = Some( - rerun::RecordingStreamBuilder::new("Ply Visualizer") - .spawn() - .unwrap(), - ); - Ok(()) + Ok(Self { + rec: Some( + rerun::RecordingStreamBuilder::new("Ply Visualizer") + .spawn() + .unwrap(), + ), + }) } fn process(&mut self, _clock: &RobotClock, input: Self::Input) -> _CuResult<()> { - println!( - "Received a point cloud with {} points", - input.payload().unwrap().len() - ); let points: Vec = input .payload() .unwrap() @@ -129,10 +122,6 @@ impl<'cl> CuSinkTask<'cl> for RerunViz { Ok(()) } - fn stop(&mut self, _clock: &RobotClock) -> Result<(), CuError> { - self.rec = None; - Ok(()) - } } fn main() { let tmp_dir = tempfile::TempDir::new().expect("could not create a tmp dir");