(self, reload_urdf=True, default_motor_angles=None, reset_time=3.0)
Reset the robot to default motor angles.
Reset the robot to default motor angles.
Reset the robot to default motor angles .
def Reset(self, reload_urdf=True, default_motor_angles=None, reset_time=3.0):
    """Reset the robot to default motor angles."""
    super(A1Robot, self).Reset(reload_urdf=reload_urdf,
                               default_motor_angles=default_motor_angles,
                               reset_time=-1)
    logging.warning(
        "About to reset the robot, make sure the robot is hang-up.")

    if not default_motor_angles:
      default_motor_angles = a1.INIT_MOTOR_ANGLES

    current_motor_angles = self.GetMotorAngles()

    # Stand up in 1.5 seconds, and keep the behavior in this way.
    standup_time = min(reset_time, 1.5)
    for t in np.arange(0, reset_time, self.time_step * self._action_repeat):
      blend_ratio = min(t / standup_time, 1)
      action = blend_ratio * default_motor_angles + (
          1 - blend_ratio) * current_motor_angles
      self.Step(action, robot_config.MotorControlMode.POSITION)
      time.sleep(self.time_step * self._action_repeat)

    if self._enable_action_filter:
      self._ResetActionFilter()

    self._velocity_estimator.reset()
    self._state_action_counter = 0
    self._step_counter = 0
    self._last_reset_time = time.time()
def Reset ( self , reload_urdf = True , default_motor_angles = None , reset_time = 3.0 ) : super ( A1Robot , self ) . Reset ( reload_urdf = reload_urdf , default_motor_angles = default_motor_angles , reset_time = - 1 ) logging . warning ( "About to reset the robot, make sure the robot is hang-up." ) if not default_motor_angles : default_motor_angles = a1 . INIT_MOTOR_ANGLES current_motor_angles = self . GetMotorAngles ( ) # Stand up in 1.5 seconds, and keep the behavior in this way. standup_time = min ( reset_time , 1.5 ) for t in np . arange ( 0 , reset_time , self . time_step * self . _action_repeat ) : blend_ratio = min ( t / standup_time , 1 ) action = blend_ratio * default_motor_angles + ( 1 - blend_ratio ) * current_motor_angles self . Step ( action , robot_config . MotorControlMode . POSITION ) time . sleep ( self . time_step * self . _action_repeat ) if self . _enable_action_filter : self . _ResetActionFilter ( ) self . _velocity_estimator . reset ( ) self . _state_action_counter = 0 self . _step_counter = 0 self . _last_reset_time = time . time ( )