Skip to content

Commit

Permalink
remove log_mesh since rerun 0.21.0 support world grid; update deps
Browse files Browse the repository at this point in the history
  • Loading branch information
makeecat committed Dec 18, 2024
1 parent 8306a27 commit 1a54ac0
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 53 deletions.
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]>"]
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"
Expand All @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
47 changes: 0 additions & 47 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<rerun::external::glam::Vec3> = (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<Vec<rerun::external::glam::Vec3>> = (0..grid_size)
.map(|i| points[i * grid_size..(i + 1) * grid_size].to_vec())
.collect();
let vertical_lines: Vec<Vec<rerun::external::glam::Vec3>> = (0..grid_size)
.map(|j| (0..grid_size).map(|i| points[i * grid_size + j]).collect())
.collect();
let line_strips: Vec<Vec<rerun::external::glam::Vec3>> =
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
Expand Down
1 change: 0 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)?;
}
Expand Down

0 comments on commit 1a54ac0

Please sign in to comment.