Laelaps  2.3.5
RoadNarrows Robotics Small Outdoor Mobile Robot Project
laeVL6180.h File Reference

Laelaps Time-of-Flight sensors. The ToFs are used as a virtual bumper for close-in obstacle detection. More...

#include <inttypes.h>
#include <pthread.h>
#include <string>
#include <vector>
#include <map>
#include "rnr/rnrconfig.h"
#include "Laelaps/laelaps.h"
#include "Laelaps/laeUtils.h"
#include "Laelaps/laeDesc.h"
#include "Laelaps/laeTune.h"
#include "Laelaps/laeI2CMux.h"
#include "Laelaps/laeToFMux.h"

Go to the source code of this file.

Classes

struct  sensor::vl6180::VL6180xIdentification
 
class  sensor::vl6180::LaeVL6180SensorInfo
 Container class to hold VL6180 time-of-flight sensor static information. More...
 
class  sensor::vl6180::LaeVL6180Mux
 VL6180 Time of Flight Class. More...
 
class  sensor::vl6180::LaeRangeInterface
 Range sensors interface base class. More...
 
class  sensor::vl6180::LaeVL6180MuxArray
 VL6180 Time of Flight Array Class. More...
 
class  sensor::vl6180::LaeRangeMuxSubproc
 Multiplexed range sensors class. More...
 
class  sensor::vl6180::LaeRangeSensorGroup
 Range sensor group class. More...
 

Namespaces

 sensor
 The sensor namespace.
 

Macros

#define VL6180X_ADDR   0x29
 I2C 7-bit address.
 
#define VL6180X_IR_LAMBDA   8.5e-07
 850nm wavelength (m)
 
#define VL6180X_RANGE_MIN   0.0
 minimum range (m)
 
#define VL6180X_RANGE_MAX   0.2
 maximum range (m)
 
#define VL6180X_RANGE_FOV   40.0
 field of view (degrees)
 
#define VL6180X_RANGE_NO_OBJ   1000000.0
 no object detected
 
#define VL6180X_RANGE_OFFSET_MIN   -128
 minimum tof offset
 
#define VL6180X_RANGE_OFFSET_MAX   127
 maximum tof offset
 
#define VL6180X_RANGE_XTALK_MIN   0
 minimum tof cross-talk
 
#define VL6180X_RANGE_XTALK_MAX   0xffff
 maximum tof cross-talk
 
#define VL6180X_AMBIENT_RES   0xffff
 16-bit ambient light resolution
 
#define VL6180X_AMBIENT_MIN   0.0
 minimum ambient light (lux)
 
#define VL6180X_AMBIENT_MAX   1000000.0
 maximum ambient light (lux)
 
#define VL6180X_AMBIENT_GAIN_MIN   1.0
 minimum als analog gain
 
#define VL6180X_AMBIENT_GAIN_MAX   40.0
 maximum als analog gain
 
#define VL6180X_AMBIENT_GAIN_MASK   0x07
 als analog gain mask
 
#define VL6180X_AMBIENT_INT_T_MIN   1
 minimum als int. period (msec)
 
#define VL6180X_AMBIENT_INT_T_MAX   512
 maximum als int. period (msec)
 
#define VL6180X_AMBIENT_INT_T_REC   100
 recommended int. period (msec)
 
#define VL6180X_AMBIENT_INT_T_MASK   0x1ff
 als integration period mask
 
#define VL6180X_ERR_MEAS   -1.0
 error meassurement
 
#define VL6180X_T_AUTO   0xffff
 auto-determine wait time
 
#define VL6180X_FACTORY_DFT   -100000
 use factory default
 
#define VL6180x_FAILURE_RESET   -1
 
#define VL6180X_IDENTIFICATION_MODEL_ID   0x0000
 
#define VL6180X_IDENTIFICATION_MODEL_REV_MAJOR   0x0001
 
#define VL6180X_IDENTIFICATION_MODEL_REV_MINOR   0x0002
 
#define VL6180X_IDENTIFICATION_MODULE_REV_MAJOR   0x0003
 
#define VL6180X_IDENTIFICATION_MODULE_REV_MINOR   0x0004
 
#define VL6180X_IDENTIFICATION_DATE   0x0006
 
#define VL6180X_IDENTIFICATION_TIME   0x0008
 
#define VL6180X_SYSTEM_MODE_GPIO0   0x0010
 
#define VL6180X_SYSTEM_MODE_GPIO1   0x0011
 
#define VL6180X_SYSTEM_HISTORY_CTRL   0x0012
 
#define VL6180X_SYSTEM_INTERRUPT_CONFIG_GPIO   0x0014
 
#define VL6180X_SYSTEM_INTERRUPT_CLEAR   0x0015
 
#define VL6180X_SYSTEM_FRESH_OUT_OF_RESET   0x0016
 
#define VL6180X_SYSTEM_GROUPED_PARAMETER_HOLD   0x0017
 
#define VL6180X_SYSRANGE_START   0x0018
 
#define VL6180X_SYSRANGE_THRESH_HIGH   0x0019
 
#define VL6180X_SYSRANGE_THRESH_LOW   0x001A
 
#define VL6180X_SYSRANGE_INTERMEASUREMENT_PERIOD   0x001B
 
#define VL6180X_SYSRANGE_MAX_CONVERGENCE_TIME   0x001C
 
#define VL6180X_SYSRANGE_CROSSTALK_COMPENSATION_RATE   0x001E
 
#define VL6180X_SYSRANGE_CROSSTALK_VALID_HEIGHT   0x0021
 
#define VL6180X_SYSRANGE_EARLY_CONVERGENCE_ESTIMATE   0x0022
 
#define VL6180X_SYSRANGE_PART_TO_PART_RANGE_OFFSET   0x0024
 
#define VL6180X_SYSRANGE_RANGE_IGNORE_VALID_HEIGHT   0x0025
 
#define VL6180X_SYSRANGE_RANGE_IGNORE_THRESHOLD   0x0026
 
#define VL6180X_SYSRANGE_MAX_AMBIENT_LEVEL_MULT   0x002C
 
#define VL6180X_SYSRANGE_RANGE_CHECK_ENABLES   0x002D
 
#define VL6180X_SYSRANGE_VHV_RECALIBRATE   0x002E
 
#define VL6180X_SYSRANGE_VHV_REPEAT_RATE   0x0031
 
#define VL6180X_SYSALS_START   0x0038
 
#define VL6180X_SYSALS_THRESH_HIGH   0x003A
 
#define VL6180X_SYSALS_THRESH_LOW   0x003C
 
#define VL6180X_SYSALS_INTERMEASUREMENT_PERIOD   0x003E
 
#define VL6180X_SYSALS_ANALOGUE_GAIN   0x003F
 
#define VL6180X_SYSALS_INTEGRATION_PERIOD   0x0040
 
#define VL6180X_RESULT_RANGE_STATUS   0x004D
 
#define VL6180X_RESULT_ALS_STATUS   0x004E
 
#define VL6180X_RESULT_INTERRUPT_STATUS_GPIO   0x004F
 
#define VL6180X_RESULT_ALS_VAL   0x0050
 
#define VL6180X_RESULT_HISTORY_BUFFER   0x0052
 
#define VL6180X_RESULT_RANGE_VAL   0x0062
 
#define VL6180X_RESULT_RANGE_RAW   0x0064
 
#define VL6180X_RESULT_RANGE_RETURN_RATE   0x0066
 
#define VL6180X_RESULT_RANGE_REFERENCE_RATE   0x0068
 
#define VL6180X_RESULT_RANGE_RETURN_SIGNAL_COUNT   0x006C
 
#define VL6180X_RESULT_RANGE_REFERENCE_SIGNAL_COUNT   0x0070
 
#define VL6180X_RESULT_RANGE_RETURN_AMB_COUNT   0x0074
 
#define VL6180X_RESULT_RANGE_REFERENCE_AMB_COUNT   0x0078
 
#define VL6180X_RESULT_RANGE_RETURN_CONV_TIME   0x007C
 
#define VL6180X_RESULT_RANGE_REFERENCE_CONV_TIME   0x0080
 
#define VL6180X_READOUT_AVERAGING_SAMPLE_PERIOD   0x010A
 
#define VL6180X_FIRMWARE_BOOTUP   0x0119
 
#define VL6180X_FIRMWARE_RESULT_SCALER   0x0120
 
#define VL6180X_I2C_SLAVE_DEVICE_ADDRESS   0x0212
 
#define VL6180X_INTERLEAVED_MODE_ENABLE   0x02A3
 

Enumerations

enum  sensor::vl6180::vl6180x_als_gain {
  sensor::vl6180::GAIN_20 = 0,
  sensor::vl6180::GAIN_10,
  sensor::vl6180::GAIN_5,
  sensor::vl6180::GAIN_2_5,
  sensor::vl6180::GAIN_1_67,
  sensor::vl6180::GAIN_1_25,
  sensor::vl6180::GAIN_1,
  sensor::vl6180::GAIN_40,
  sensor::vl6180::GAIN_NumOf
}
 Ambient Light Sensor gain value enumeration. More...
 

Detailed Description

Laelaps Time-of-Flight sensors. The ToFs are used as a virtual bumper for close-in obstacle detection.

LastChangedDate
2016-04-11 13:03:57 -0600 (Mon, 11 Apr 2016)
Rev
4381

The hardware changed between Laelaps v2.0 and subsequence v2.1+ versions.

Laelaps v2.0
The v2.0 hardware uses an i2c mutliplexer chip to toggle between the connected sensors. When a sensor was enabled, it is electrically connected to the odroid's /dev/i2c-3 bus. When disabled, the sensor was electrically isolated.
*         i2c-3   0x70           0x29      0x29           0x29
* odroid ------- i2cmux         VL6180_0, VL6180_2, ..., VL6180_7
*                   |              ^         ^              ^
*                   |    i2c-3     |         |              |
*                   -----------------------------------------
*                                   select
*
* 
Laelaps v2.1+
The v2.1+ hardware uses an Arduino compatible sub-processors. The sub-processor is a slave i2c device to the odroid, and a i2c master to 8 independent soft i2c buses, one per each sensor.
*         i2c-3   0x71    soft-i2c-0   0x29
* odroid ------- subproc ------------ VL6180_0
*                   |
*                   |     soft-i2c-1   0x29
*                   |---------------- VL6180_1
*                   |
*                       ...
*                   |
*                   |     soft-i2c-7   0x29
*                   |---------------- VL6180_7
*
* 

This code is based on the Arduino library freely available from Sparkfun. See original comment block below.

See also
https://github.com/sparkfun/ToF_Range_Finder_Sensor-VL6180/tree/master/Libraries/Arduino
https://www.sparkfun.com/products/12785
Author
Robin Knight (robin.nosp@m..kni.nosp@m.ght@r.nosp@m.oadn.nosp@m.arrow.nosp@m.s.co.nosp@m.m)

(C) 2015-2016 RoadNarrows (http://www.roadNarrows.com)
All Rights Reserved

Definition in file laeVL6180.h.

Enumeration Type Documentation

Ambient Light Sensor gain value enumeration.

From data sheet shows gain values as binary list

Enumerator
GAIN_20 

actual ALS Gain of 20

GAIN_10 

actual ALS Gain of 10.32

GAIN_5 

actual ALS Gain of 5.21

GAIN_2_5 

actual ALS Gain of 2.60

GAIN_1_67 

actual ALS Gain of 1.72

GAIN_1_25 

actual ALS Gain of 1.28

GAIN_1 

actual ALS Gain of 1.01

GAIN_40 

actual ALS Gain of 40

GAIN_NumOf 

number of gain enum values

Definition at line 247 of file laeVL6180.h.

248  {
249  GAIN_20 = 0, ///< actual ALS Gain of 20
250  GAIN_10, ///< actual ALS Gain of 10.32
251  GAIN_5, ///< actual ALS Gain of 5.21
252  GAIN_2_5, ///< actual ALS Gain of 2.60
253  GAIN_1_67, ///< actual ALS Gain of 1.72
254  GAIN_1_25, ///< actual ALS Gain of 1.28
255  GAIN_1 , ///< actual ALS Gain of 1.01
256  GAIN_40, ///< actual ALS Gain of 40
257  GAIN_NumOf ///< number of gain enum values
258  };
actual ALS Gain of 40
Definition: laeVL6180.h:256
number of gain enum values
Definition: laeVL6180.h:257
actual ALS Gain of 20
Definition: laeVL6180.h:249
actual ALS Gain of 1.72
Definition: laeVL6180.h:253
actual ALS Gain of 1.01
Definition: laeVL6180.h:255
actual ALS Gain of 10.32
Definition: laeVL6180.h:250
actual ALS Gain of 2.60
Definition: laeVL6180.h:252
actual ALS Gain of 1.28
Definition: laeVL6180.h:254
actual ALS Gain of 5.21
Definition: laeVL6180.h:251