ROME2 / Mbed 2 deprecated ROME2_P5

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

LIDAR Class Reference

LIDAR Class Reference

This is a device driver class for the Slamtec RP LIDAR A1. More...

#include <LIDAR.h>

Public Member Functions

 LIDAR (RawSerial &serial)
 Creates a LIDAR object.
virtual ~LIDAR ()
 Stops the lidar and deletes this object.
short getDistance (short angle)
 Returns the distance measurement of the lidar at a given angle.
short getDistanceOfBeacon ()
 Returns the distance to a detected beacon.
short getAngleOfBeacon ()
 Returns the angle of a detected beacon.
void lookForBeacon ()
 This method implements an algorithm that looks for the position of a beacon.

Detailed Description

This is a device driver class for the Slamtec RP LIDAR A1.

Definition at line 16 of file LIDAR.h.


Constructor & Destructor Documentation

LIDAR ( RawSerial &  serial )

Creates a LIDAR object.

Parameters:
seriala reference to a serial interface to communicate with the laser scanner.

Definition at line 16 of file LIDAR.cpp.

~LIDAR (  ) [virtual]

Stops the lidar and deletes this object.

Definition at line 45 of file LIDAR.cpp.


Member Function Documentation

short getAngleOfBeacon (  )

Returns the angle of a detected beacon.

Returns:
the angle of the beacon, given in [deg] in the range 0..359.

Definition at line 79 of file LIDAR.cpp.

short getDistance ( short  angle )

Returns the distance measurement of the lidar at a given angle.

Parameters:
anglethe angle, given in [deg] in the range 0..359.
Returns:
the measured distance, given in [mm].

Definition at line 58 of file LIDAR.cpp.

short getDistanceOfBeacon (  )

Returns the distance to a detected beacon.

Returns:
the distance to the beacon, given in [mm], or zero, if no beacon was found.

Definition at line 70 of file LIDAR.cpp.

void lookForBeacon (  )

This method implements an algorithm that looks for the position of a beacon.

It should be called periodically by a low-priority background task.

dist_diff_start[n]=i; n++;

printf(" start: %d \r\n",i);

dist_diff_stop[m]=i; m++; printf(" stop: %d \r\n",i);

for(i=0;i<10;i++){ printf(" %d: %d ", i,dist_diff_start[i]); } printf("\n\r") ; for(i=0;i<10;i++){ printf(" %d: %d ", i,dist_diff_stop[i]); }

Definition at line 88 of file LIDAR.cpp.