rpk-01-arduino-driver-support-demo.pdf

(1470 KB) Pobierz
RPLIDAR Application Note
Arduino Driver Support & Demo
2014-5
Rev.1
Copyright 2009-2014 RoboPeak Team
http://www.RoboPeak.com
RPLIDAR Application Note
Arduino Driver Support & Demo
Contents:
1.
OVERVIEW
................................................................................................................................. 2
P
ERFORMANCE
I
SSUE
............................................................................................................................... 2
2.
RPLIDAR ARDUINO DRIVER LIBRARY
......................................................................................... 3
A
BOUT THE
L
IBRARY
................................................................................................................................. 3
S
YSTEM
R
EQUIREMENT
............................................................................................................................. 3
L
IBRARY
I
NSTALLATION
.............................................................................................................................. 3
E
XAMPLES
............................................................................................................................................... 4
3.
EXAMPLE DEMONSTRATIONS
................................................................................................... 6
B
ASICS
.................................................................................................................................................... 6
E
XAMPLE
:
SIMPLE
_
CONNECT
..................................................................................................................... 8
E
XAMPLE
:
DISTANCE
_
TO
_
COLOR
................................................................................................................ 9
4.
REVISION HISTORY
.................................................................................................................. 11
1
/
11
Copyright 2009-2014 RoboPeak
http://www.RoboPeak.com
RPLIDAR Application Note
Arduino Driver Support & Demo
1.
Overview
RoboPeak provides RPLIDAR driver library and related demo sketches to help users fast
integrate RPLIDAR into their Arduino based systems.
The Arduino driver library can be used on standard Atmel AVR based Arduino boards like
Arduino UNO and any other Arduino-compatible boards like Intel Galileo, Leaf Lab maple
and etc.
The library provides similar APIs with those appeared in the standard RPLIDAR SDK.
In this document, a simple demo based on the RPLIDAR Arduino driver is introduced.
Performance Issue
Users are required to pay attention to the code efficiency when using this RPLIDAR
Arduino driver Library.
As RPLIDAR continuous outputs data to a host system with 2000 samples per second, the
host system must
perform data processing task within 500us
for each samples
(measurement data) it receives.
For standard Atmel AVR based Arduino board like Arduino UNO or Arduino Mega, due to
the slow speed of the MCU, application code must be efficient enough to finish the
processing task in time. Otherwise, sample data lose may occur.
For sophisticated applications like SLAM, RoboPeak recommend users to use a more
powerful system other than the standard Arduino.
2
/
11
Copyright 2009-2014 RoboPeak
http://www.RoboPeak.com
RPLIDAR Application Note
Arduino Driver Support & Demo
2. RPLIDAR Arduino Driver Library
About the Library
The RPLIDAR’s Arduino Driver Library is available on RPLIDAR’s product download
page:
http://rplidar.robopeak.com
The source code can be found on github:
https://github.com/robopeak/rplidar_arduino
System Requirement
Arduino IDE:
1.0.5 or higher
Hardware:
Arduino board or compatible versions with AT LEAST one hardware serial port
RPLIDAR Model A1M1 Development Kit
Library Installation
The driver library is provided as a standard Arduino Library, i.e. a ZIP package which
can be installed into the Arduino IDE using the Import Library command provided by
the Arduino IDE.
Please follow the following steps to install it, or refer to the instructions on the
Arduino website:
http://arduino.cc/en/Guide/Libraries
STEP#1
Download the Arduino driver library ZIP package, and import it using the Add Library
command in the Arduino IDE:
3
/
11
Copyright 2009-2014 RoboPeak
http://www.RoboPeak.com
RPLIDAR Application Note
Arduino Driver Support & Demo
STEP#2
Once the driver library gets imported, you will see the related item in the available
library list menu.
Examples
You may start using the driver library by first referring to the included examples
provided by the library package.
Once the library gets installed, you can find the related examples in the example list
menu:
4
/
11
Copyright 2009-2014 RoboPeak
http://www.RoboPeak.com
Zgłoś jeśli naruszono regulamin