(self,
               lower_bound: _FLOAT_OR_ARRAY = -0.1,
               upper_bound: _FLOAT_OR_ARRAY = 0.1,
               convert_to_local_frame: bool = False,
               name: typing.Text = "BaseDisplacement",
               dtype: typing.Type[typing.Any] = np.float64)
Constructs BaseDisplacementSensor.

    Args:
      lower_bound: the lower bound of the base displacement
      upper_bound: the upper bound of the base displacement
      convert_to_local_frame: whether to project dx, dy to local frame based on
        robot's current yaw angle. (Note that it's a projection onto 2D plane,
        and the roll, pitch of the robot is not considered.)
      name: the name of the sensor
      dtype: data type of sensor value
Constructs BaseDisplacementSensor.
Constructs BaseDisplacementSensor .
def __init__(self,
               lower_bound: _FLOAT_OR_ARRAY = -0.1,
               upper_bound: _FLOAT_OR_ARRAY = 0.1,
               convert_to_local_frame: bool = False,
               name: typing.Text = "BaseDisplacement",
               dtype: typing.Type[typing.Any] = np.float64) -> None:
    """Constructs BaseDisplacementSensor.

    Args:
      lower_bound: the lower bound of the base displacement
      upper_bound: the upper bound of the base displacement
      convert_to_local_frame: whether to project dx, dy to local frame based on
        robot's current yaw angle. (Note that it's a projection onto 2D plane,
        and the roll, pitch of the robot is not considered.)
      name: the name of the sensor
      dtype: data type of sensor value
    """

    self._channels = ["x", "y", "z"]
    self._num_channels = len(self._channels)

    super(BaseDisplacementSensor, self).__init__(
        name=name,
        shape=(self._num_channels,),
        lower_bound=np.array([lower_bound] * 3),
        upper_bound=np.array([upper_bound] * 3),
        dtype=dtype)

    datatype = [("{}_{}".format(name, channel), self._dtype)
                for channel in self._channels]
    self._datatype = datatype
    self._convert_to_local_frame = convert_to_local_frame

    self._last_yaw = 0
    self._last_base_position = np.zeros(3)
    self._current_yaw = 0
    self._current_base_position = np.zeros(3)
def __init__ ( self , lower_bound : _FLOAT_OR_ARRAY = - 0.1 , upper_bound : _FLOAT_OR_ARRAY = 0.1 , convert_to_local_frame : bool = False , name : typing . Text = "BaseDisplacement" , dtype : typing . Type [ typing . Any ] = np . float64 ) -> None : self . _channels = [ "x" , "y" , "z" ] self . _num_channels = len ( self . _channels ) super ( BaseDisplacementSensor , self ) . __init__ ( name = name , shape = ( self . _num_channels , ) , lower_bound = np . array ( [ lower_bound ] * 3 ) , upper_bound = np . array ( [ upper_bound ] * 3 ) , dtype = dtype ) datatype = [ ( "{}_{}" . format ( name , channel ) , self . _dtype ) for channel in self . _channels ] self . _datatype = datatype self . _convert_to_local_frame = convert_to_local_frame self . _last_yaw = 0 self . _last_base_position = np . zeros ( 3 ) self . _current_yaw = 0 self . _current_base_position = np . zeros ( 3 )