Leddar Library for Arduino

Contents

History

Release

Date

Changes

1.0

22/01/2014

Initial release.

1.1

30/06/2014

Added support for RS485 shields which do not have automatic direction control.

1.2

12/03/2015

Corrected a minor compatibility issue

Background

LeddarTM (Light Emitting Diode Detection and Ranging) is a novel detection and ranging technology created by LeddarTech that performs detection and ranging by time-of-flight measurement using pulses from infrared LEDs. While ultrasonic sensors are typically limited in their range of detection, LeddarTM Technology can detect and locate objects at a distance of up to 50 meters under the harshest conditions.

By using an area sensor as the collecting device of the reflected beam, the sensor simultaneously provides a given number of range values for different parts of the scene without any moving parts as generally used for area scanning.

Illumination Area and Detection Zone

Description

This library enables an Arduino board equiped with a RS-485 shield to communicate with any Leddar device via Modbus protocol and parse the information into simple data structures. For optimization purposes, this library only implements the necessary Modbus functions to work with a Leddar. This is not a Modbus Library.

Leddar

Methods

Constructor, creates a Leddar structure with the desired Baud rate and Slave ID

init();

Initializes the serial port for communication

getDetections();

Retrieves detections from the Leddar, stores them in the Detections[] array.

Variables

unsigned char NbDet;

Number of detections returned by the Leddar

Detection Detections[50];

Array containing the channel number, distance (in cm) and amplitude for each detection.

Note: While not very common, it is possible for a channel to have multiple detections if multiple objects are present in the field of view, and a modbus packet will transmit a maximum of 50 detections.

unsigned long TimeStamp;

Timestamp of the last acquisition.. The timestamp is expressed as the number of milliseconds since the Leddar was powered up.

unsigned char LEDPower;

Current LED power as a percentage of maximum.

unsigned char Status;

Acquisition statuses. This is a 8-bit field with 2 bits currently defined: bit 0 indicates that automatic LED intensity is enabled if 1, bit 2 indicates that object demerging is enabled if 1.