Skip to content

Commit

Permalink
moved steping to first run
Browse files Browse the repository at this point in the history
  • Loading branch information
samuel-cavalcanti committed Oct 14, 2023
1 parent c507c91 commit 1ea33d9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions examples/simple_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,14 @@ fn main() -> Result<(), RemoteAPIError> {
client.sim_set_object_position(*h, pos, Some(sim::HANDLE_WORLD))?;
}

client.sim_set_stepping(true)?;

client.sim_start_simulation()?;
// Run a simulation in asynchronous mode:
let mut time = client.sim_get_simulation_time()?;
while time < 3.0 {
time = client.sim_get_simulation_time()?;
client.sim_step()?;

println!("Simulation time: {time:.2} [s] (simulation running asynchronously to client, i.e. non-stepped)", time = time);
}
Expand Down

0 comments on commit 1ea33d9

Please sign in to comment.