(robot)
return controller
Demonstrates how to create a locomotion controller.
Demonstrates how to create a locomotion controller.
Demonstrates how to create a locomotion controller .
def _setup_controller(robot):
  """Demonstrates how to create a locomotion controller."""
  desired_speed = (0, 0)
  desired_twisting_speed = 0

  gait_generator = openloop_gait_generator.OpenloopGaitGenerator(
      robot,
      stance_duration=_STANCE_DURATION_SECONDS,
      duty_factor=_DUTY_FACTOR,
      initial_leg_phase=_INIT_PHASE_FULL_CYCLE)
  state_estimator = com_velocity_estimator.COMVelocityEstimator(robot)
  sw_controller = raibert_swing_leg_controller.RaibertSwingLegController(
      robot,
      gait_generator,
      state_estimator,
      desired_speed=desired_speed,
      desired_twisting_speed=desired_twisting_speed,
      desired_height=_BODY_HEIGHT,
      foot_clearance=0.01
  )
  st_controller = torque_stance_leg_controller.TorqueStanceLegController(
      robot,
      gait_generator,
      state_estimator,
      desired_speed=desired_speed,
      desired_twisting_speed=desired_twisting_speed,
      desired_body_height=_BODY_HEIGHT,
      body_mass=215 / 9.8,
      body_inertia=(0.07335, 0, 0, 0, 0.25068, 0, 0, 0, 0.25447),
  )

  controller = locomotion_controller.LocomotionController(
      robot=robot,
      gait_generator=gait_generator,
      state_estimator=state_estimator,
      swing_leg_controller=sw_controller,
      stance_leg_controller=st_controller,
      clock=robot.GetTimeSinceReset)
  return controller
def _setup_controller ( robot ) : desired_speed = ( 0 , 0 ) desired_twisting_speed = 0 gait_generator = openloop_gait_generator . OpenloopGaitGenerator ( robot , stance_duration = _STANCE_DURATION_SECONDS , duty_factor = _DUTY_FACTOR , initial_leg_phase = _INIT_PHASE_FULL_CYCLE ) state_estimator = com_velocity_estimator . COMVelocityEstimator ( robot ) sw_controller = raibert_swing_leg_controller . RaibertSwingLegController ( robot , gait_generator , state_estimator , desired_speed = desired_speed , desired_twisting_speed = desired_twisting_speed , desired_height = _BODY_HEIGHT , foot_clearance = 0.01 ) st_controller = torque_stance_leg_controller . TorqueStanceLegController ( robot , gait_generator , state_estimator , desired_speed = desired_speed , desired_twisting_speed = desired_twisting_speed , desired_body_height = _BODY_HEIGHT , body_mass = 215 / 9.8 , body_inertia = ( 0.07335 , 0 , 0 , 0 , 0.25068 , 0 , 0 , 0 , 0.25447 ) , ) controller = locomotion_controller . LocomotionController ( robot = robot , gait_generator = gait_generator , state_estimator = state_estimator , swing_leg_controller = sw_controller , stance_leg_controller = st_controller , clock = robot . GetTimeSinceReset ) return controller