Example #1
0
def _build_humanoid_walls_env():
    """Build humanoid walker walls environment."""
    walker = walkers.CMUHumanoidPositionControlled(
        name='walker',
        observable_options={'egocentric_camera': dict(enabled=True)},
    )
    wall_width = distributions.Uniform(low=1, high=7)
    wall_height = distributions.Uniform(low=2.5, high=4.0)
    swap_wall_side = distributions.Bernoulli(prob=0.5)
    wall_r = distributions.Uniform(low=0.5, high=0.6)
    wall_g = distributions.Uniform(low=0.21, high=0.41)
    wall_rgba = colors.RgbVariation(r=wall_r, g=wall_g, b=0, alpha=1)
    arena = arenas.WallsCorridor(wall_gap=5.0,
                                 wall_width=wall_width,
                                 wall_height=wall_height,
                                 swap_wall_side=swap_wall_side,
                                 wall_rgba=wall_rgba,
                                 corridor_width=10,
                                 corridor_length=100)
    humanoid_task = tasks.RunThroughCorridor(
        walker=walker,
        arena=arena,
        walker_spawn_rotation=1.57,  # pi / 2
        physics_timestep=0.005,
        control_timestep=0.03)
    raw_env = composer.Environment(time_limit=30,
                                   task=humanoid_task,
                                   strip_singleton_obs_buffer_dim=True)

    return raw_env
Example #2
0
def _build_humanoid_corridor_env():
    """Build humanoid walker walls environment."""
    walker = walkers.CMUHumanoidPositionControlled(
        name='walker',
        observable_options={'egocentric_camera': dict(enabled=True)},
    )
    arena = arenas.EmptyCorridor(corridor_width=10, corridor_length=100)
    humanoid_task = tasks.RunThroughCorridor(
        walker=walker,
        arena=arena,
        walker_spawn_rotation=1.57,  # pi / 2
        physics_timestep=0.005,
        control_timestep=0.03)
    raw_env = composer.Environment(time_limit=30,
                                   task=humanoid_task,
                                   strip_singleton_obs_buffer_dim=True)

    return raw_env
Example #3
0
def _build_humanoid_corridor_gaps():
    """Build humanoid walker walls environment."""
    walker = walkers.CMUHumanoidPositionControlled(
        name='walker',
        observable_options={'egocentric_camera': dict(enabled=True)},
    )
    platform_length = distributions.Uniform(low=0.3, high=2.5)
    gap_length = distributions.Uniform(low=0.75, high=1.25)
    arena = arenas.GapsCorridor(corridor_width=10,
                                platform_length=platform_length,
                                gap_length=gap_length,
                                corridor_length=100)
    humanoid_task = tasks.RunThroughCorridor(
        walker=walker,
        arena=arena,
        walker_spawn_position=(2, 0, 0),
        walker_spawn_rotation=1.57,  # pi / 2
        physics_timestep=0.005,
        control_timestep=0.03)
    raw_env = composer.Environment(time_limit=30,
                                   task=humanoid_task,
                                   strip_singleton_obs_buffer_dim=True)

    return raw_env
Example #4
0
 def _make_wrong_walker(name):
   return walkers.CMUHumanoidPositionControlled(
       include_face=False, model_version='2020', scale_default=True,
       name=name)