gym_os2r.randomizers

gym_os2r.randomizers.monopod

class gym_os2r.randomizers.monopod.MonopodEnvRandomizer(env, num_physics_rollouts=0, **kwargs)

Bases: gym_ignition.randomizers.gazebo_env_randomizer.GazeboEnvRandomizer, gym_os2r.randomizers.monopod.MonopodRandomizersMixin

Concrete implementation of monopod environments randomization.

get_state_info(state, actions)
class gym_os2r.randomizers.monopod.MonopodRandomizersMixin(randomize_physics_after_rollouts=0)

Bases: gym_ignition.randomizers.abc.TaskRandomizer, gym_ignition.randomizers.abc.PhysicsRandomizer, gym_ignition.randomizers.abc.ModelDescriptionRandomizer, abc.ABC

Mixin that collects the implementation of task, model and physics randomizations for monopod environments.

get_engine()

Return the physics engine to use for the rollout.

Note

Supported physics engines:

  • scenario.bindings.gazebo.PhysicsEngine_dart

Returns

The desired physics engine to set in the world.

randomize_ground_description(task, **kwargs)
Return type

str

randomize_model_description(task, **kwargs)

Randomize the model description.

Parameters

task (MonopodTask) – The task that operates on the model description to randomize.

Return type

str

Returns

A string with the randomized model description.

randomize_physics(task, **kwargs)

Method that insert and configures the physics of a Task’s world.

By default this method loads a plugin that uses DART with no randomizations. Randomizing physics engine parameters or changing physics engine backend could be done by redefining this method and passing it to GazeboRuntime.

Parameters

task (MonopodTask) – A task containing a world object without physics.

Return type

None

randomize_task(task, **kwargs)

Randomize a Task instance.

Parameters

task (MonopodTask) – the task to randomize.

Note

Note that each task has a world property that provides access to the simulated scenario.bindings.core.World.

Return type

None

gym_os2r.randomizers.monopod_no_rand

class gym_os2r.randomizers.monopod_no_rand.MonopodEnvNoRandomizer(env, **kwargs)

Bases: gym_ignition.randomizers.gazebo_env_randomizer.GazeboEnvRandomizer

Dummy environment randomizer for monopod tasks.

Check gym_os2r.randomizers.monopod.MonopodRandomizersMixin for an example that randomizes the task, the physics, and the model.

get_state_info(state, actions)
randomize_task(task, **kwargs)

Prepare the scene for monopod tasks. It simply removes the monopod of the previous rollout and inserts a new one in the default state. Then, the active Task will reset the state of the monopod depending on the implemented decision-making logic.

Return type

None