Bemerkung
Die openHAB-Dokumentation ist nur auf Englisch verfügbar.
Warnung
The openHAB bindings are still in beta, but the development was stopped.
This is the description of the openHAB API bindings for the Laser Range Finder Bricklet 2.0. General information and technical specifications for the Laser Range Finder Bricklet 2.0 are summarized in its hardware description.
An installation guide for the openHAB API bindings is part of their general description.
UID:
- tinkerforge:brickletlaserrangefinderv2:[UID]
Required firmware version:
- 2.0.0
Firmware update supported:
- yes
Channels: Actions: Parameters:
- Distance Moving Average Length – Type: integer, Default: 10, Min: 0, Max: 255
- The length of a moving averaging for the distance.
- Velocity Moving Average Length – Type: integer, Default: 10, Min: 0, Max: 255
- The length of a moving averaging for the velocity.
- Acquisition Count – Type: integer, Default: 128, Min: 1, Max: 255
- The acquisition count defines the number of times the Laser Range Finder Bricklet will integrate acquisitions to find a correlation record peak. With a higher count, the Bricklet can measure longer distances. With a lower count, the rate increases.
- Quick Termination – Type: boolean, Default: false
- If you enable Quick Termination, the distance measurement will be terminated early if a high peak was already detected. This means that a higher measurement rate can be achieved and long distances can be measured at the same time. However, the chance of false-positive distance measurements increases.
- Threshold Value – Type: integer, Default: 0, Min: 0, Max: 255
- Normally the distance is calculated with a detection algorithm that uses peak value, signal strength and noise. You can however also define a fixed Threshold Value. Set this to a low value if you want to measure the distance to something that has very little reflection (e.g. glass) and set it to a high value if you want to measure the distance to something with a very high reflection (e.g. mirror). Set this to 0 to use the default algorithm.
- Fixed Measurement Frequency – Type: boolean, Default: false
- For a stable velocity measurement you should set a fixed measurement frequency. See Measurement Frequency for details.
- Measurement Frequency – Type: integer, Default: 10, Min: 10, Max: 500
- If the fixed measurement frequency is enabled, the measurement frequency is forced to this value. If it is disabled, the Laser Range Finder Bricklet will use the optimal frequency according to the other configurations and the actual measured distance. Since the rate is not fixed in this case, the velocity measurement is not stable. For a stable velocity measurement you should set a fixed measurement frequency. The lower the frequency, the higher is the resolution of the calculated velocity.
- Distance LED – Type: Choice, Default: Show Distance
- Configures the distance LED to be either turned off, turned on, blink in heartbeat mode or show the distance (brighter = object is nearer).
- Options: Off, On, Show Heartbeat, Show Distance
- Status LED Configuration – Type: Choice, Default: Show Status
- The status LED configuration. By default the LED shows communication traffic between Brick and Bricklet, it flickers once for every 10 received data packets. You can also turn the LED permanently on/off or show a heartbeat. If the Bricklet is in bootloader mode, the LED is will show heartbeat by default.
- Options: Off, On, Show Heartbeat, Show Status
Distance
¶The measured distance. The laser has to be enabled.
Type:
- Number:Length
UID:
- tinkerforge:brickletlaserrangefinderv2:[UID]:BrickletLaserRangeFinderV2Distance
Read only:
- Yes
Unit:
- Meter
Range:
- 0 Meter to 40 Meter (Step 0.01 Meter)
Parameters:
- Update Interval – Type: integer, Default: 1000, Unit: ms, Min: 0, Max: 4294967295
- Specifies the update interval in milliseconds. A value of 0 disables automatic updates.
Velocity
¶The measured velocity. The velocity measurement only produces stables results if a fixed measurement frequency is configured. Also the laser has to be enabled.
Type:
- Number:Speed
UID:
- tinkerforge:brickletlaserrangefinderv2:[UID]:BrickletLaserRangeFinderV2Velocity
Read only:
- Yes
Unit:
- Meter Per Second
Range:
- -128 Meter Per Second to 127 Meter Per Second (Step 0.01 Meter Per Second)
Parameters:
- Update Interval – Type: integer, Default: 1000, Unit: ms, Min: 0, Max: 4294967295
- Specifies the update interval in milliseconds. A value of 0 disables automatic updates.
Laser
¶Activates/Deactivates the laser of the LIDAR.
Type:
- Switch
UID:
- tinkerforge:brickletlaserrangefinderv2:[UID]:BrickletLaserRangeFinderV2Laser
Read only:
- No
Actions can be used in rules by creating an action object. All actions return a Map<String, Object>. Returned values can be accessed by name, sometimes the type deduction needs some hints, as shown below:
val actions = getActions("tinkerforge", "tinkerforge:brickletlaserrangefinderv2:[UID]")
val hwVersion = actions.brickletLaserRangeFinderV2GetIdentity().get("hardwareVersion") as short[]
logInfo("Example", "Hardware version: " + hwVersion.get(0) + "." + hwVersion.get(1) + "." + hwVersion.get(2))
brickletLaserRangeFinderV2GetDistance
()¶Return Map: |
|
---|
Returns the measured distance.
The laser has to be enabled, see Laser
.
If you want to get the value periodically, it is recommended to use the
Distance
channel. You can set the channel configuration
with the configuration of Distance
.
brickletLaserRangeFinderV2GetVelocity
()¶Return Map: |
|
---|
Returns the measured velocity. The value has a range of -12800 to 12700 and is given in 1/100 m/s.
The velocity measurement only produces stables results if a fixed
measurement rate (see the thing configuration) is configured. Also the laser
has to be enabled, see Laser
.
If you want to get the value periodically, it is recommended to use the
Velocity
channel. You can set the channel configuration
with the configuration of Velocity
.
brickletLaserRangeFinderV2SetEnable
(boolean enable)¶Parameters: |
|
---|
Enables the laser of the LIDAR if set to true.
We recommend that you wait 250ms after enabling the laser before
the first call of Distance
to ensure stable measurements.
brickletLaserRangeFinderV2GetEnable
()¶Return Map: |
|
---|
Returns the value as set by Laser
.
brickletLaserRangeFinderV2GetConfiguration
()¶Return Map: |
|
---|
Returns the configuration as set by the thing configuration.
brickletLaserRangeFinderV2GetDistanceLEDConfig
()¶Return Map: |
|
---|
Returns the LED configuration as set by the thing configuration
The following constants are available for this function:
For config:
brickletLaserRangeFinderV2GetMovingAverage
()¶Return Map: |
|
---|
Returns the length moving average as set by the thing configuration.
brickletLaserRangeFinderV2GetOffsetCalibration
()¶Return Map: |
|
---|
Returns the offset value as set by This function is not available in openHAB. Please use Brick Viewer to change persistant device settings.
brickletLaserRangeFinderV2GetChipTemperature
()¶Return Map: |
|
---|
Returns the temperature as measured inside the microcontroller. The value returned is not the ambient temperature!
The temperature is only proportional to the real temperature and it has bad accuracy. Practically it is only useful as an indicator for temperature changes.
brickletLaserRangeFinderV2GetStatusLEDConfig
()¶Return Map: |
|
---|
Returns the configuration as set by the thing configuration
The following constants are available for this function:
For config:
brickletLaserRangeFinderV2GetSPITFPErrorCount
()¶Return Map: |
|
---|
Returns the error count for the communication between Brick and Bricklet.
The errors are divided into
The errors counts are for errors that occur on the Bricklet side. All Bricks have a similar function that returns the errors on the Brick side.
brickletLaserRangeFinderV2Reset
()¶Calling this function will reset the Bricklet. All configurations will be lost.
After a reset you have to create new device objects, calling functions on the existing ones will result in undefined behavior!
brickletLaserRangeFinderV2GetIdentity
()¶Return Map: |
|
---|
Returns the UID, the UID where the Bricklet is connected to, the position, the hardware and firmware version as well as the device identifier.
The position can be 'a', 'b', 'c', 'd', 'e', 'f', 'g' or 'h' (Bricklet Port). A Bricklet connected to an Isolator Bricklet is always at position 'z'.
The device identifier numbers can be found here.