(self, pybullet_client, time_step=0.002, **kwargs)
Initializes the robot class.
Initializes the robot class.
Initializes the robot class .
def __init__(self, pybullet_client, time_step=0.002, **kwargs):
    """Initializes the robot class."""
    # Initialize pd gain vector
    self.motor_kps = np.array([ABDUCTION_P_GAIN, HIP_P_GAIN, KNEE_P_GAIN] * 4)
    self.motor_kds = np.array([ABDUCTION_D_GAIN, HIP_D_GAIN, KNEE_D_GAIN] * 4)
    self._pybullet_client = pybullet_client
    self.time_step = time_step

    # Robot state variables
    self._init_complete = False
    self._base_orientation = None
    self._raw_state = None
    self._last_raw_state = None
    self._motor_angles = np.zeros(12)
    self._motor_velocities = np.zeros(12)
    self._joint_states = None
    self._last_reset_time = time.time()
    self._velocity_estimator = a1_robot_velocity_estimator.VelocityEstimator(
        self)

    # Initiate UDP for robot state and actions
    self._robot_interface = RobotInterface()
    self._robot_interface.send_command(np.zeros(60, dtype=np.float32))

    kwargs['on_rack'] = True
    super(A1Robot, self).__init__(pybullet_client,
                                  time_step=time_step,
                                  **kwargs)
    self._init_complete = True
def __init__ ( self , pybullet_client , time_step = 0.002 , * * kwargs ) : # Initialize pd gain vector self . motor_kps = np . array ( [ ABDUCTION_P_GAIN , HIP_P_GAIN , KNEE_P_GAIN ] * 4 ) self . motor_kds = np . array ( [ ABDUCTION_D_GAIN , HIP_D_GAIN , KNEE_D_GAIN ] * 4 ) self . _pybullet_client = pybullet_client self . time_step = time_step # Robot state variables self . _init_complete = False self . _base_orientation = None self . _raw_state = None self . _last_raw_state = None self . _motor_angles = np . zeros ( 12 ) self . _motor_velocities = np . zeros ( 12 ) self . _joint_states = None self . _last_reset_time = time . time ( ) self . _velocity_estimator = a1_robot_velocity_estimator . VelocityEstimator ( self ) # Initiate UDP for robot state and actions self . _robot_interface = RobotInterface ( ) self . _robot_interface . send_command ( np . zeros ( 60 , dtype = np . float32 ) ) kwargs [ 'on_rack' ] = True super ( A1Robot , self ) . __init__ ( pybullet_client , time_step = time_step , * * kwargs ) self . _init_complete = True