def get_gyroscope_values(self): res, packed_vec = vrep.simxGetStringSignal( self._client, self._stream_names['gyroscope'], vrep.simx_opmode_buffer) if res == vrep.simx_return_ok: self._gyroscope_reading = vrep.simxUnpackFloats(packed_vec) return np.asarray(self._gyroscope_reading)
def get_proximity_values(self): res, packed_vec = vrep.simxGetStringSignal( self._client, self._stream_names['proximity_sensor'], vrep.simx_opmode_buffer) if res == vrep.simx_return_ok: self._proximity_reading = vrep.simxUnpackFloats(packed_vec) return np.round(self._proximity_reading, 3)
def get_encoders_rotations(self): res, packed_vec = vrep.simxGetStringSignal( self._client, self._stream_names['encoders'], vrep.simx_opmode_buffer) if res == vrep.simx_return_ok: self._encoder_reading = vrep.simxUnpackFloats(packed_vec) return np.round(self._encoder_reading, 3)
def get_encoders_rotations(self) -> np.ndarray: """Reads encoders ticks from robot. Returns: encoder_ticks: Current values of encoders ticks. """ res, packed_vec = vrep.simxReadStringStream( self._client, self._stream_names['encoders'], vrep.simx_opmode_oneshot) if res == vrep.simx_return_ok: self._encoder_ticks = vrep.simxUnpackFloats(packed_vec) self._encoder_ticks = np.round(self._encoder_ticks, 3) return self._encoder_ticks
def get_gyroscope_values(self) -> np.ndarray: """Reads gyroscope values from robot. Returns: gyroscope_values: Array of values received from gyroscope. """ res, packed_vec = vrep.simxReadStringStream( self._client, self._stream_names['gyroscope'], vrep.simx_opmode_oneshot) if res == vrep.simx_return_ok: self._gyroscope_values = vrep.simxUnpackFloats(packed_vec) self._gyroscope_values = np.asarray(self._gyroscope_values) return self._gyroscope_values
def get_accelerometer_values(self) -> np.ndarray: """Reads accelerometer values from robot. Returns: accelerometer_values: Array of values received from accelerometer. """ res, packed_vec = vrep.simxReadStringStream( self._client, self._stream_names['accelerometer'], vrep.simx_opmode_oneshot) if res == vrep.simx_return_ok: self._accelerometer_values = vrep.simxUnpackFloats(packed_vec) self._accelerometer_values = np.asarray(self._accelerometer_values) return self._accelerometer_values
def get_proximity_values(self) -> np.ndarray: """Reads proximity sensors values from robot. Returns: proximity_sensor_values: Array of proximity sensor values. """ res, packed_vec = vrep.simxReadStringStream( self._client, self._stream_names['proximity_sensor'], vrep.simx_opmode_oneshot) if res == vrep.simx_return_ok: self._proximity_sensor_values = vrep.simxUnpackFloats(packed_vec) self._proximity_sensor_values = np.round( self._proximity_sensor_values, 3) return self._proximity_sensor_values