Package lejos.robotics
Interface SampleProvider
-
- All Known Subinterfaces:
SensorMode,SensorModes
- All Known Implementing Classes:
AbstractCalibrationFilter,AbstractFilter,AccelerometerAdapter,AnalogSensor,BaseSensor,CodeTemplate,CompassPoseProvider,ConcatenationFilter,CruizcoreGyro,DexterCompassSensor,DexterGPSSensor,DexterIMUSensor,DexterIMUSensor.DexterIMUAccelerationSensor,DexterLaserSensor,DexterPressureSensor250,DexterPressureSensor500,DexterThermalIRSensor,Dump,EV3ColorSensor,EV3GyroSensor,EV3IRSensor,EV3TouchSensor,EV3UltrasonicSensor,HiTechnicAccelerometer,HiTechnicAngleSensor,HiTechnicBarometer,HiTechnicColorSensor,HiTechnicColorSensor.RGBMode,HiTechnicCompass,HiTechnicEOPD,HiTechnicEOPD.ShortDistanceMode,HiTechnicGyro,HiTechnicIRSeeker,HiTechnicIRSeekerV2,HiTechnicMagneticSensor,I2CSensor,IntegrationFilter,IRLink,LDCMotor,LinearCalibrationFilter,LMotor,LowPassFilter,LSC,LServo,MaximumFilter,MeanFilter,MedianFilter,MindsensorsAbsoluteIMU,MindsensorsAbsoluteIMU.ShortSensorMode,MindsensorsAccelerometer,MindsensorsCompass,MindsensorsDistanceSensorV2,MindsensorsLightSensorArray,MindsensorsLineLeader,MindSensorsNumPad,MindSensorsPressureSensor,MinimumFilter,ModulusFilter,MSC,MServo,NXTCam,NXTColorSensor,NXTe,NXTLightSensor,NXTMMX,NXTSoundSensor,NXTSoundSensor.DBMode,NXTTouchSensor,NXTUltrasonicSensor,NXTUltrasonicSensor.DistanceMode,NXTUltrasonicSensor.PingMode,OdometryPoseProvider,OffsetCorrectionFilter,PFLink,PFMate,PSPNXController,PublishFilter,RangeFinderAdapter,RCXLightSensor,RCXLink,RCXMotorMultiplexer,RCXRotationSensor,RCXSensorMultiplexer,RCXThermometer,RemoteRequestSampleProvider,RFIDSensor,SampleBuffer,SampleThread,SensorMux,SliceFilter,SubscribedProvider,SumFilter,SumoEyesSensor,TetrixMotorController,TetrixServoController,TouchMUX,UARTSensor,ZeroFilter
public interface SampleProviderAbstraction for classes that fetch samples from a sensor and classes that are able to process samples.
A sample is a measurement taken by a sensor at a single moment in time. A sample can have one or more elements. The number of elements in a sample depends on the sensor (and sensor mode).
Sample providers comply with standards.-
Sample providers use standard units.
- Length in meters
- Angle in degrees
- Temperature in degrees celcius
- Pressure in Pascal
- Speed in m/s
- Acceleration in m/s^2
- etc...
- When there is no clear unit a sample provider use normalized values in the range between 0 and 1.
- Sample providers that measure spatial data use a right handed cartesian coordinate system with the X-axis pointing forwards, the Y-axis pointing to the left and the Z-axis pointing up. (The plug of a sensor is always on its back.)
- A positive rotation of a mobile robot is a counterclockwise rotation.
- If a sample provider measures spatial data over more than one axis, the order of the elements in a sample corresponds with the X,Y and Z axis.
- Author:
- Aswin Bouwmeester
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidfetchSample(float[] sample, int offset)Fetches a sample from a sensor or filter.intsampleSize()Returns the number of elements in a sample.
The number of elements does not change during runtime.
-
-
-
Method Detail
-
sampleSize
int sampleSize()
Returns the number of elements in a sample.
The number of elements does not change during runtime.- Returns:
- the number of elements in a sample
-
fetchSample
void fetchSample(float[] sample, int offset)Fetches a sample from a sensor or filter.- Parameters:
sample- The array to store the sample in.offset- The elements of the sample are stored in the array starting at the offset position.
-
-