Exemple #1
0
def main():
    arg_parser = argparse.ArgumentParser()
    arg_parser.add_argument("--seed", dest="seed", type=int, default=None)
    arg_parser.add_argument("--visualize",
                            dest="visualize",
                            action="store_true",
                            default=True)

    args = arg_parser.parse_args()

    env = env_builder.build_laikago_env(enable_rendering=args.visualize)

    test(env=env)

    return
Exemple #2
0
def main():
    arg_parser = argparse.ArgumentParser()
    arg_parser.add_argument("--seed", dest="seed", type=int, default=None)
    arg_parser.add_argument("--visualize",
                            dest="visualize",
                            action="store_true",
                            default=True)

    args = arg_parser.parse_args()

    env = env_builder.build_laikago_env(
        motor_control_mode=robot_config.MotorControlMode.POSITION,
        enable_rendering=args.visualize)

    test(env=env)

    return
def _run_example(max_time=_MAX_TIME_SECONDS):
  """Runs the locomotion controller example."""

  env = env_builder.build_laikago_env( motor_control_mode = robot_config.MotorControlMode.HYBRID, enable_rendering=True)
  env.reset()
  controller = _setup_controller(env.robot)
  controller.reset()

  current_time = env.robot.GetTimeSinceReset()
  while current_time < max_time:
    # Updates the controller behavior parameters.
    lin_speed, ang_speed = _generate_example_linear_angular_speed(current_time)
    _update_controller_params(controller, lin_speed, ang_speed)

    # Needed before every call to get_action().
    controller.update()
    hybrid_action = controller.get_action()

    env.step(hybrid_action)
    current_time = env.robot.GetTimeSinceReset()