예제 #1
0
 def set_rotation_vector(self, rotation_vector: xyz.Xyz) -> "Sensors":
     """
     Sets the channel
     :param rotation_vector: Channel to set
     :return: A modified instance of self
     """
     redvox.api1000.common.typing.check_type(rotation_vector, [xyz.Xyz])
     self.get_proto().rotation_vector.CopyFrom(rotation_vector.get_proto())
     self._rotation_vector = xyz.Xyz(self.get_proto().rotation_vector)
     return self
예제 #2
0
 def set_accelerometer(self, accelerometer: xyz.Xyz) -> "Sensors":
     """
     Sets the channel
     :param accelerometer: Channel to set
     :return: A modified instance of self
     """
     redvox.api1000.common.typing.check_type(accelerometer, [xyz.Xyz])
     self.get_proto().accelerometer.CopyFrom(accelerometer.get_proto())
     self._accelerometer = xyz.Xyz(self.get_proto().accelerometer)
     return self
예제 #3
0
 def set_gyroscope(self, gyroscope: xyz.Xyz) -> "Sensors":
     """
     Sets the channel
     :param gyroscope: Channel to set
     :return: A modified instance of self
     """
     redvox.api1000.common.typing.check_type(gyroscope, [xyz.Xyz])
     self.get_proto().gyroscope.CopyFrom(gyroscope.get_proto())
     self._gyroscope = xyz.Xyz(self.get_proto().gyroscope)
     return self
예제 #4
0
 def set_orientation(self, orientation: xyz.Xyz) -> "Sensors":
     """
     Sets the channel
     :param orientation: Channel to set
     :return: A modified instance of self
     """
     redvox.api1000.common.typing.check_type(orientation, [xyz.Xyz])
     self.get_proto().orientation.CopyFrom(orientation.get_proto())
     self._orientation = xyz.Xyz(self.get_proto().orientation)
     return self
예제 #5
0
 def set_gravity(self, gravity: xyz.Xyz) -> "Sensors":
     """
     Sets the channel
     :param gravity: Channel to set
     :return: A modified instance of self
     """
     redvox.api1000.common.typing.check_type(gravity, [xyz.Xyz])
     self.get_proto().gravity.CopyFrom(gravity.get_proto())
     self._gravity = xyz.Xyz(self.get_proto().gravity)
     return self
예제 #6
0
 def new_rotation_vector(self) -> xyz.Xyz:
     """
     :return: A new empty sensor
     """
     self.remove_rotation_vector()
     self.get_proto().rotation_vector.SetInParent()
     self._rotation_vector = xyz.Xyz(self.get_proto().rotation_vector)
     self._rotation_vector.get_timestamps().set_default_unit()
     # noinspection PyTypeChecker
     self._rotation_vector.set_unit_xyz(common.Unit.UNITLESS)
     return self._rotation_vector
예제 #7
0
 def new_accelerometer(self) -> xyz.Xyz:
     """
     :return: A new empty sensor
     """
     self.remove_accelerometer()
     self.get_proto().accelerometer.SetInParent()
     self._accelerometer = xyz.Xyz(self.get_proto().accelerometer)
     self._accelerometer.get_timestamps().set_default_unit()
     # noinspection PyTypeChecker
     self._accelerometer.set_unit_xyz(common.Unit.METERS_PER_SECOND_SQUARED)
     return self._accelerometer
예제 #8
0
 def new_orientation(self) -> xyz.Xyz:
     """
     :return: A new empty sensor
     """
     self.remove_orientation()
     self.get_proto().orientation.SetInParent()
     self._orientation = xyz.Xyz(self.get_proto().orientation)
     self._orientation.get_timestamps().set_default_unit()
     # noinspection PyTypeChecker
     self._orientation.set_unit_xyz(common.Unit.RADIANS)
     return self._orientation
예제 #9
0
 def new_magnetometer(self) -> xyz.Xyz:
     """
     :return: A new empty sensor
     """
     self.remove_magnetometer()
     self.get_proto().magnetometer.SetInParent()
     self._magnetometer = xyz.Xyz(self.get_proto().magnetometer)
     self._magnetometer.get_timestamps().set_default_unit()
     # noinspection PyTypeChecker
     self._magnetometer.set_unit_xyz(common.Unit.MICROTESLA)
     return self._magnetometer
예제 #10
0
 def new_gyroscope(self) -> xyz.Xyz:
     """
     :return: A new empty sensor
     """
     self.remove_gyroscope()
     self.get_proto().gyroscope.SetInParent()
     self._gyroscope = xyz.Xyz(self.get_proto().gyroscope)
     self._gyroscope.get_timestamps().set_default_unit()
     # noinspection PyTypeChecker
     self._gyroscope.set_unit_xyz(common.Unit.RADIANS_PER_SECOND)
     return self._gyroscope
예제 #11
0
 def new_gravity(self) -> xyz.Xyz:
     """
     :return: A new empty sensor
     """
     self.remove_gravity()
     self.get_proto().gravity.SetInParent()
     self._gravity = xyz.Xyz(self.get_proto().gravity)
     self._gravity.get_timestamps().set_default_unit()
     # noinspection PyTypeChecker
     self._gravity.set_unit_xyz(common.Unit.METERS_PER_SECOND_SQUARED)
     return self._gravity
예제 #12
0
 def set_linear_acceleration(self,
                             linear_acceleration: xyz.Xyz) -> "Sensors":
     """
     Sets the channel
     :param linear_acceleration: Channel to set
     :return: A modified instance of self
     """
     redvox.api1000.common.typing.check_type(linear_acceleration, [xyz.Xyz])
     self.get_proto().linear_acceleration.CopyFrom(
         linear_acceleration.get_proto())
     self._linear_acceleration = xyz.Xyz(
         self.get_proto().linear_acceleration)
     return self
예제 #13
0
 def __init__(self, sensors_proto: redvox_api_m_pb2.RedvoxPacketM.Sensors):
     super().__init__(sensors_proto)
     self._accelerometer: xyz.Xyz = xyz.Xyz(sensors_proto.accelerometer)
     self._ambient_temperature: single.Single = single.Single(
         sensors_proto.ambient_temperature)
     self._audio: audio.Audio = audio.Audio(sensors_proto.audio)
     self._compressed_audio: audio.CompressedAudio = audio.CompressedAudio(
         sensors_proto.compressed_audio)
     self._gravity: xyz.Xyz = xyz.Xyz(sensors_proto.gravity)
     self._gyroscope: xyz.Xyz = xyz.Xyz(sensors_proto.gyroscope)
     self._image: image.Image = image.Image(sensors_proto.image)
     self._light: single.Single = single.Single(sensors_proto.light)
     self._linear_acceleration: xyz.Xyz = xyz.Xyz(
         sensors_proto.linear_acceleration)
     self._location: location.Location = location.Location(
         sensors_proto.location)
     self._magnetometer: xyz.Xyz = xyz.Xyz(sensors_proto.magnetometer)
     self._orientation: xyz.Xyz = xyz.Xyz(sensors_proto.orientation)
     self._pressure: single.Single = single.Single(sensors_proto.pressure)
     self._proximity: single.Single = single.Single(sensors_proto.proximity)
     self._relative_humidity: single.Single = single.Single(
         sensors_proto.relative_humidity)
     self._rotation_vector: xyz.Xyz = xyz.Xyz(sensors_proto.rotation_vector)
     self._velocity: xyz.Xyz = xyz.Xyz(sensors_proto.velocity)