Skip to content

Commit

Permalink
add default rerun blueprint rbl
Browse files Browse the repository at this point in the history
  • Loading branch information
makeecat committed Nov 4, 2024
1 parent 8e7171f commit 873d140
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
Binary file added config/peng_default_blueprint.rbl
Binary file not shown.
2 changes: 2 additions & 0 deletions config/quad.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ use_multithreading_depth_rendering: true # Enable multithreading for depth rende
use_rk4_for_dynamics_update: false # Enable Runge-Kutta 4th order integration for dynamics, otherwise Euler integration is used
use_rk4_for_dynamics_control: false # Enable Runge-Kutta 4th order integration for dynamics, otherwise Euler integration is used

rerun_blueprint: "config/peng_default_blueprint.rbl"

simulation:
control_frequency: 200 # Frequency of control loop execution (Hz)
simulation_frequency: 1000 # Frequency of physics simulation updates (Hz)
Expand Down
2 changes: 2 additions & 0 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ pub struct Config {
pub mesh: MeshConfig,
/// Planner schedule configuration
pub planner_schedule: Vec<PlannerStep>,
/// Rerun blueprint path
pub rerun_blueprint: String,
/// Use rerun.io for recording
pub use_rerun: bool,
/// Render depth
Expand Down
5 changes: 4 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ fn main() -> Result<(), SimulationError> {
log::info!("Loading configuration: {}", args[1]);
config_str = &args[1];
}
let config = config::Config::from_yaml(config_str).expect("Failed to load configuration");
let config = config::Config::from_yaml(config_str).expect("Failed to load configuration.");
let mut quad = Quadrotor::new(
1.0 / config.simulation.simulation_frequency as f32,
config.quadrotor.mass,
Expand Down Expand Up @@ -72,6 +72,9 @@ fn main() -> Result<(), SimulationError> {
} else {
None
};
if let Some(rec) = &rec {
rec.log_file_from_path(config.rerun_blueprint, None, false)?;
}
if let Some(rec) = &rec {
rec.set_time_seconds("timestamp", 0);
log_mesh(rec, config.mesh.division, config.mesh.spacing)?;
Expand Down

0 comments on commit 873d140

Please sign in to comment.