ModularSensors > Files > sensors / MaxBotixSonar.h

MaxBotixSonar.h file

Contains the MaxBotixSonar sensor subclass and the MaxBotixSonar_Range variable subclass.

These are for the MaxBotix HRXL-MaxSonar ultrasonic range finders.

Classes

class MaxBotixSonar
The Sensor sub-class for the MaxBotix ultrasonic range finders.
class MaxBotixSonar_Range
The Variable sub-class used for the range output from a MaxBotix HRXL-MaxSonar ultrasonic range finder.

Defines

#define HRXL_NUM_VARIABLES = 1
Sensor::_numReturnedValues; the HRXL can report 1 value.

Sensor Timing

The sensor timing for a Maxbotix HRXL ultrasonic range finder

#define HRXL_WARM_UP_TIME_MS = 160
Sensor::_warmUpTime_ms; warm up time to completion of header: 160ms.
#define HRXL_STABILIZATION_TIME_MS = 0
Sensor::_stabilizationTime_ms; the HRXL is stable as soon as it warms up (0ms stabilization).
#define HRXL_MEASUREMENT_TIME_MS = 166
Sensor::_measurementTime_ms; the HRXL takes 166ms to complete a measurement.

Range

The range variable from a Maxbotix HRXL ultrasonic range finder

  • Range is 300 to 5000mm or 500 to 9999mm, depending on model
  • Accuracy is ±1%

MaxBotixSonar_Range(MaxBotixSonar* parentSense, const char* uuid = "", const char* varCode = HRXL_DEFAULT_CODE) explicit

Construct a new MaxBotixSonar_Range object.

Parameters
parentSense The parent MaxBotixSonar providing the result values.
uuid A universally unique identifier (UUID or GUID) for the variable; optional with the default value of an empty string.
varCode A short code to help identify the variable in files; optional with a default value of "SonarRange".

#define HRXL_RESOLUTION = 0
Decimals places in string representation; range should have 0 - resolution is 1mm.
#define HRXL_VAR_NUM = 0
Sensor variable number; range is stored in sensorValues[0].
#define HRXL_VAR_NAME = "distance"
Variable name in ODM2 controlled vocabulary; "distance".
#define HRXL_UNIT_NAME = "millimeter"
Variable unit name in ODM2 controlled vocabulary; "millimeter".
#define HRXL_DEFAULT_CODE = "SonarRange"
Default variable short code; "SonarRange".