_simulate_scene

Module Contents

Functions

simulate_scene(...)

Simulate a scene.

simulate_scene(scene_id: int, scene: revolve2.simulation.scene.Scene, headless: bool, record_settings: revolve2.simulation.simulator.RecordSettings | None, start_paused: bool, control_step: float, sample_step: float | None, simulation_time: int | None, simulation_timestep: float, cast_shadows: bool, fast_sim: bool, viewer_type: mujoco_simulator.viewers.ViewerType, render_backend: mujoco_simulator._render_backend.RenderBackend = RenderBackend.EGL) list[revolve2.simulation.scene.SimulationState]

Simulate a scene.

Parameters:
  • scene_id – An id for this scene, unique between all scenes ran in parallel.

  • scene – The scene to simulate.

  • headless – If False, a viewer will be opened that allows a user to manually view and manually interact with the simulation.

  • record_settings – If not None, recording will be done according to these settings.

  • start_paused – If true, the simulation will start in a paused state. Only makessense when headless is False.

  • control_step – The time between each call to the handle function of the scene handler. In seconds.

  • sample_step – The time between each state sample of the simulation. In seconds.

  • simulation_time – How long to simulate for. In seconds.

  • simulation_timestep – The duration to integrate over during each step of the simulation. In seconds.

  • cast_shadows – If shadows are cast.

  • fast_sim – If fancy rendering is disabled.

  • viewer_type – The type of viewer used for the rendering in a window.

  • render_backend – The backend to be used for rendering (EGL by default and switches to GLFW if no cameras are on the robot).

Returns:

The results of simulation. The number of returned states depends on sample_step.

Raises:

ValueError – If the viewer is not able to record.