gym_os2r.runtimes

gym_os2r.runtimes.gazebo_runtime

class gym_os2r.runtimes.gazebo_runtime.GazeboRuntime(task_cls, agent_rate, physics_rate, real_time_factor, physics_engine=0, world=None, **kwargs)

Bases: gym_ignition.runtimes.gazebo_runtime.GazeboRuntime

Implementation of Runtime for the Ignition Gazebo simulator.

Parameters
  • task_cls (type) – The class of the handled task.

  • agent_rate (float) – The rate at which the environment is called.

  • physics_rate (float) – The rate of the physics engine.

  • real_time_factor (float) – The desired RTF of the simulation.

  • physics_engine(optional) The physics engine to use.

  • world (Optional[str]) – (optional) The path to an SDF world file. The world should not contain any physics plugin.

Note

Physics randomization is still experimental and it could change in the future. Physics is loaded only once, when the simulator starts. In order to change the physics, a new simulator should be created.

property gazebo: scenario.bindings.gazebo.GazeboSimulator
Return type

GazeboSimulator

metadata = {'render.modes': ['human']}
step(action)

Run one timestep of the environment’s dynamics. When end of episode is reached, you are responsible for calling reset() to reset this environment’s state.

Accepts an action and returns a tuple (observation, reward, done, info).

Parameters

action (object) – an action provided by the agent

Returns

agent’s observation of the current environment reward (float) : amount of reward returned after previous action done (bool): whether the episode has ended, in which case further step() calls will return undefined results info (dict): contains auxiliary diagnostic information (helpful for debugging, and sometimes learning)

Return type

observation (object)