From 1a54ac0ff30e232c248e3710fa2fc7f4018a77fa Mon Sep 17 00:00:00 2001 From: Yang Zhou Date: Wed, 18 Dec 2024 17:35:29 -0500 Subject: [PATCH] remove log_mesh since rerun 0.21.0 support world grid; update deps --- Cargo.toml | 8 ++++---- README.md | 2 +- src/lib.rs | 47 ----------------------------------------------- src/main.rs | 1 - 4 files changed, 5 insertions(+), 53 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 73ca65f4..92a9a69b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ exclude = ["assets/", "CONTRIBUTING.md", "CODE_OF_CONDUCT.md", "SECURITY.md"] name = "peng_quad" version = "0.5.3" edition = "2021" -rust-version = "1.79" +rust-version = "1.80" authors = ["Yang Zhou "] description = "Peng is a minimal quadrotor pipeline including quadrotor dynamics, IMU simulation, various trajectory planners, PID controller and depth map rendering." license = "MIT OR Apache-2.0" @@ -30,9 +30,9 @@ lto = "thin" # Do a second optimization pass over the entire program, inclu nalgebra = "0.33.2" rand = { version = "0.8.5", features = ["rand_chacha"] } rand_distr = "0.4.3" -rerun = "0.20.3" -thiserror = "2.0.4" -serde = { version = "1.0.215", features = ["derive"] } +rerun = "0.21.0" +thiserror = "2.0.7" +serde = { version = "1.0.216", features = ["derive"] } serde_yaml = "0.9.34" env_logger = "0.11.5" log = "0.4.22" diff --git a/README.md b/README.md index 711a687e..df40551d 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Peng is a minimal quadrotor autonomy framework written in Rust that provides real-time dynamics simulation, trajectory planning, and control with modern visualization capabilities. -[![rerun demo](https://raw.githubusercontent.com/makeecat/Peng/main/assets/Peng_demo.gif)](https://rerun.io/viewer/version/0.19.0/?url=https%3A%2F%2Fyangrobotics.com%2Ffiles%2Fpeng_v0.5.3_demo.rrd) +[![rerun demo](https://raw.githubusercontent.com/makeecat/Peng/main/assets/Peng_demo.gif)](https://rerun.io/viewer/version/0.21.0/?url=https%3A%2F%2Fyangrobotics.com%2Ffiles%2Fpeng_v0.5.3a_demo.rrd) ## 🎯 Key Features diff --git a/src/lib.rs b/src/lib.rs index fc8f2035..d23669a7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -2573,53 +2573,6 @@ pub fn log_trajectory( )?; Ok(()) } -/// Log mesh data to the rerun recording stream -/// # Arguments -/// * `rec` - The rerun::RecordingStream instance -/// * `division` - The number of divisions in the mesh -/// * `spacing` - The spacing between divisions -/// # Errors -/// * If the data cannot be logged to the recording stream -/// # Example -/// ```no_run -/// use peng_quad::log_mesh; -/// let rec = rerun::RecordingStreamBuilder::new("log.rerun").connect().unwrap(); -/// log_mesh(&rec, 10, 0.1).unwrap(); -/// ``` -pub fn log_mesh( - rec: &rerun::RecordingStream, - division: usize, - spacing: f32, -) -> Result<(), SimulationError> { - let grid_size: usize = division + 1; - let half_grid_size: f32 = (division as f32 * spacing) / 2.0; - let points: Vec = (0..grid_size) - .flat_map(|i| { - (0..grid_size).map(move |j| { - rerun::external::glam::Vec3::new( - j as f32 * spacing - half_grid_size, - i as f32 * spacing - half_grid_size, - 0.0, - ) - }) - }) - .collect(); - let horizontal_lines: Vec> = (0..grid_size) - .map(|i| points[i * grid_size..(i + 1) * grid_size].to_vec()) - .collect(); - let vertical_lines: Vec> = (0..grid_size) - .map(|j| (0..grid_size).map(|i| points[i * grid_size + j]).collect()) - .collect(); - let line_strips: Vec> = - horizontal_lines.into_iter().chain(vertical_lines).collect(); - rec.log( - "world/mesh", - &rerun::LineStrips3D::new(line_strips) - .with_colors([rerun::Color::from_rgb(255, 255, 255)]) - .with_radii([0.02]), - )?; - Ok(()) -} /// Log depth image data to the rerun recording stream /// /// When the depth value is `f32::INFINITY`, the pixel is considered invalid and logged as black diff --git a/src/main.rs b/src/main.rs index 91731f9b..f68f092e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -95,7 +95,6 @@ fn main() -> Result<(), SimulationError> { if let Some(rec) = &rec { rec.log_file_from_path(config.rerun_blueprint, None, false)?; rec.set_time_seconds("timestamp", 0); - log_mesh(rec, config.mesh.division, config.mesh.spacing)?; log_maze_tube(rec, &maze)?; log_maze_obstacles(rec, &maze)?; }