Skip to content

Commit

Permalink
formated files
Browse files Browse the repository at this point in the history
  • Loading branch information
samuel-cavalcanti committed Sep 15, 2023
1 parent dea5122 commit 0169ca8
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 14 deletions.
1 change: 0 additions & 1 deletion examples/get_simulation_time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ fn main() -> Result<(), RemoteAPIError> {
..RemoteApiClientParams::default()
})?;


sim.set_stepping(true)?;

sim.start_simulation()?;
Expand Down
4 changes: 2 additions & 2 deletions examples/opencv_example/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ fn main() -> Result<(), RemoteAPIError> {
..RemoteApiClientParams::default()
})?;


let vision_sensor_handle = client.get_object("/VisionSensor".to_string(), None)?;

client.set_stepping(true)?;
Expand All @@ -29,7 +28,8 @@ fn main() -> Result<(), RemoteAPIError> {
let start_time = client.get_simulation_time()?;
let mut time = start_time;
while time - start_time < 5.0 {
let (img, res) = client.get_vision_sensor_img(vision_sensor_handle, None, None, None, None)?;
let (img, res) =
client.get_vision_sensor_img(vision_sensor_handle, None, None, None, None)?;

opencv_show_image(img, res);

Expand Down
5 changes: 3 additions & 2 deletions examples/simple_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ fn main() -> Result<(), RemoteAPIError> {
..RemoteApiClientParams::default()
})?;


// When simulation is not running, ZMQ message handling could be a bit
// slow, since the idle loop runs at 8 Hz by default. So let's make
// sure that the idle loop runs at full speed for this program:
Expand All @@ -31,7 +30,9 @@ fn main() -> Result<(), RemoteAPIError> {
client.set_int32_param(sim::INTPARAM_IDLE_FPS, 0)?;

// Create a few dummies and set their positions:
let handles: Vec<i64> = (0..50).map(|_| client.create_dummy(0.01).unwrap()).collect();
let handles: Vec<i64> = (0..50)
.map(|_| client.create_dummy(0.01).unwrap())
.collect();

for (i, h) in handles.iter().enumerate() {
let i = i as f64;
Expand Down
4 changes: 2 additions & 2 deletions examples/synchronous_image_transmission.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ fn main() -> Result<(), RemoteAPIError> {
..RemoteApiClientParams::default()
})?;


let vision_sensor_handle = client.get_object("/VisionSensor".to_string(), None)?;

let passive_vision_sensor_handle = client.get_object("/PassiveVisionSensor".to_string(), None)?;
let passive_vision_sensor_handle =
client.get_object("/PassiveVisionSensor".to_string(), None)?;

client.set_stepping(true)?;

Expand Down
9 changes: 4 additions & 5 deletions src/remote_api_client/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,8 @@ impl RemoteApiClientInterface for &RemoteApiClient {
}
}

impl Sim for RemoteApiClient{}
impl Sim for &RemoteApiClient{}

impl SimIk for RemoteApiClient{}
impl SimIk for &RemoteApiClient{}
impl Sim for RemoteApiClient {}
impl Sim for &RemoteApiClient {}

impl SimIk for RemoteApiClient {}
impl SimIk for &RemoteApiClient {}
1 change: 0 additions & 1 deletion src/remote_api_objects/sim/sim_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@ use crate::remote_api_client::RemoteApiClientInterface;
use crate::zmq_requests::RawRequest;

include!("../../../c_transpiler/assets/sim.rs");

1 change: 0 additions & 1 deletion src/remote_api_objects/sim/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ fn test_get_simulation_time_functions() -> Result<(), RemoteAPIError> {
result: RefCell::new(json!({"ret":[1],"success":true})),
};


sim.start_simulation()?;
let payload = log_utils::to_byte_array_string(&sim.get_payload());
println!("{payload}");
Expand Down

0 comments on commit 0169ca8

Please sign in to comment.