(max_time=_MAX_TIME_SECONDS)
Runs the locomotion controller example.
Runs the locomotion controller example.
Runs the locomotion controller example .
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, info = controller.get_action()

    env.step(hybrid_action)
    current_time = env.robot.GetTimeSinceReset()
def _run_example ( max_time = _MAX_TIME_SECONDS ) : 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 , info = controller . get_action ( ) env . step ( hybrid_action ) current_time = env . robot . GetTimeSinceReset ( )