pub trait SimulationSetup {
// Required method
fn set_franka_urdf_path(&self) -> PathBuf;
// Provided methods
fn set_simulation_time_step(&self) -> Duration { ... }
fn setup_simulation(&mut self, _client: Rc<RefCell<PhysicsClient>>) { ... }
fn setup_camera(&mut self, _client: Rc<RefCell<PhysicsClient>>) { ... }
fn get_camera_image(
&mut self,
_client: Rc<RefCell<PhysicsClient>>,
) -> RgbaImage { ... }
}Expand description
A trait which contains methods for handling the simulation. Apart from
set_franka_urdf_path,
all methods have a default implementation,
so you do not have to implement them if you do not need them.
Required Methods§
Sourcefn set_franka_urdf_path(&self) -> PathBuf
fn set_franka_urdf_path(&self) -> PathBuf
Return the path to the URDF file of the Franka robot.
Provided Methods§
Sourcefn set_simulation_time_step(&self) -> Duration
fn set_simulation_time_step(&self) -> Duration
Sets how often the simulation should be updated inside the control loop. The default is 1/240s = 240 Hz
Sourcefn setup_simulation(&mut self, _client: Rc<RefCell<PhysicsClient>>)
fn setup_simulation(&mut self, _client: Rc<RefCell<PhysicsClient>>)
this method runs directly after the simulation is spawned. Use this method for example to load additional object into the simulation.
Sourcefn setup_camera(&mut self, _client: Rc<RefCell<PhysicsClient>>)
fn setup_camera(&mut self, _client: Rc<RefCell<PhysicsClient>>)
this method is intended to let you setup the camera. It is run directly after setup_simulation.
Sourcefn get_camera_image(&mut self, _client: Rc<RefCell<PhysicsClient>>) -> RgbaImage
fn get_camera_image(&mut self, _client: Rc<RefCell<PhysicsClient>>) -> RgbaImage
determine how you want to get the camera image with this method.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".