(self)
Receives observation from robot.

    Synchronous ReceiveObservation is not supported in A1,
    so changging it to noop instead.
Receives observation from robot.
Receives observation from robot .
def ReceiveObservation(self):
    """Receives observation from robot.

    Synchronous ReceiveObservation is not supported in A1,
    so changging it to noop instead.
    """
    state = self._robot_interface.receive_observation()
    self._raw_state = state
    # Convert quaternion from wxyz to xyzw, which is default for Pybullet.
    q = state.imu.quaternion
    self._base_orientation = np.array([q[1], q[2], q[3], q[0]])
    self._motor_angles = np.array([motor.q for motor in state.motorState[:12]])
    self._motor_velocities = np.array(
        [motor.dq for motor in state.motorState[:12]])
    self._joint_states = np.array(
        list(zip(self._motor_angles, self._motor_velocities)))
    if self._init_complete:
      # self._SetRobotStateInSim(self._motor_angles, self._motor_velocities)
      self._velocity_estimator.update(self._raw_state)
def ReceiveObservation ( self ) : state = self . _robot_interface . receive_observation ( ) self . _raw_state = state # Convert quaternion from wxyz to xyzw, which is default for Pybullet. q = state . imu . quaternion self . _base_orientation = np . array ( [ q [ 1 ] , q [ 2 ] , q [ 3 ] , q [ 0 ] ] ) self . _motor_angles = np . array ( [ motor . q for motor in state . motorState [ : 12 ] ] ) self . _motor_velocities = np . array ( [ motor . dq for motor in state . motorState [ : 12 ] ] ) self . _joint_states = np . array ( list ( zip ( self . _motor_angles , self . _motor_velocities ) ) ) if self . _init_complete : # self._SetRobotStateInSim(self._motor_angles, self._motor_velocities) self . _velocity_estimator . update ( self . _raw_state )