Build a linorobot from scratch
This is a document project describe how to build a linorobot from scratch.
- Introduction
- Hardware
- Hardware test and driver installation
- Software
- Debug&test
- FAQ
- Update Notes
- Useful links
This github project is describe how to build a Linorobot from scratch. Includeing hardware, software, debug and test.
Linorobot is a suite of Open Source ROS compatible robots that aims to provide students, developers, and researchers a low-cost platform in creating new exciting applications on top of ROS. More about Linorobot can be found here
Author of this project: jack.wang a fullstack engneree focus on software, robots and autonomous vehicle.
In this part, I will tell how to build hardware part about linorobot. Including Hardware and how to assemble them together.
Here is the hardware list that I used, all of this part can be found at Taobao or Amazon
-
Laser sensors:
-
IMU:
-
Micro-controller:
-
Ubuntu install ARM based dev board:
-
Motor Drivers:
-
Motor and Wheels:
-
connecting wires:
More supported hardware can be found here
// Todo
In this section, I will show you how to make sure hardware works well, and install the required drivers.
RPLIDAR A1
contains a range scanner system and a motor system. After power on each sub-system,RPLIDAR A1
start rotating and scanning clockwise. User can get range scan data through the communication interface (Serial port/USB).Reference from RPLiDAR datasheet
-
Assemble
PRLiDAR A1
with drive board . -
Find a
Micro USB-B
Line, connect drive board to your computer -
Then LiDAR should start rotating clockwise.
-
Install serial port driver
Driver installation file can be found at CP210x USB to UART Bridge VCP Drivers
-
Download SDK from github
git clone [email protected]:Slamtec/rplidar_sdk.git
-
Complie SDK
Make sure you have
g++
installed and run:cd rplidar_sdk_v1.9.0_1/sdk && make
After compile, directory
output/Darwin/Release
should be generated. And you can find:-
simple_grabber
This demo application simply connects to an RPLIDAR device and outputs the scan data to the console.
-
ultra_simple
This demo application grabs two round of scan data and shows the range data as histogram in the command line mode.
-
-
Find USB serial:
ls -l /dev/tty.*
If you see
/dev/tty.SLAB_USBtoUART
That means driver is work: -
Run
simple_grabber
In directory:
rplidar_sdk_v1.9.0_1/sdk/output/Darwin/Release
./ultra_simple /dev/tty.SLAB_USBtoUART
You should see something like this:
Ultra simple LIDAR data grabber for RPLIDAR. Version: 1.9.0 RPLIDAR S/N: 52989AF0C5E29DD2B6E39DF5D14B3116 Firmware Ver: 1.24 Hardware Rev: 5 RPLidar health status : 0 *WARN* YOU ARE USING DEPRECATED API: grabScanData(), PLEASE MOVE TO grabScanDataHq() *WARN* YOU ARE USING DEPRECATED API: ascendScanData(rplidar_response_measurement_node_t*, size_t), PLEASE MOVE TO ascendScanData(rplidar_response_measurement_node_hq_t*, size_t) theta: 0.55 Dist: 00898.00 Q: 47 theta: 1.59 Dist: 00000.00 Q: 0 theta: 2.14 Dist: 00000.00 Q: 0 theta: 2.67 Dist: 00000.00 Q: 0 theta: 3.22 Dist: 00000.00 Q: 0 theta: 3.75 Dist: 00000.00 Q: 0 theta: 4.30 Dist: 00000.00 Q: 0 theta: 4.83 Dist: 00000.00 Q: 0 theta: 7.00 Dist: 00000.00 Q: 0 theta: 7.53 Dist: 00000.00 Q: 0 theta: 8.08 Dist: 00000.00 Q: 0 theta: 8.61 Dist: 00000.00 Q: 0 theta: 9.16 Dist: 00000.00 Q: 0 theta: 9.69 Dist: 00000.00 Q: 0 theta: 10.23 Dist: 00000.00 Q: 0 theta: 10.77 Dist: 00000.00 Q: 0
In this part, I will introduce how to install ROS on Respberry Pi. After that, linorobot Installation will be shown step by step.
Usually, I use Ubuntu 16.04 for ROS, but after read this document: Installing ROS Kinetic on the Raspberry Pi. I directly install pre-installed Ros Ubuntu image offer by Ubiquity
, which can be found here.
Install steps:
-
Download
img
file for Respberry Pi: Img Link -
Use
Etcher
to writeimage
to Respberry Pi SD card: -
Insert in your TF card to Respberry Pi. Power on, And wait some time (in 3 mins)
-
Open Wifi config page to find a new Wifi point named:
ubiquityrobotXXXX
where XXXX is part of the MAC address. The wifi password isrobotseverywhere
. -
After connected, use
ssh [email protected]
with a passwordubuntu
to login.
If everything is OK you should see this:
And ros is installed:
To install needed software, we need to make Respberry Pi connect to internet.
On Mac OS, use share network
to share a internet connection to Respberry Pi is very simple. Here is the way:
-
Connect Mac to a AP with internet. (Note: Please Do NOT use
802.1x
wifi AP) -
Connect Respberry Pi to Mac with a network line.
-
Open
System Settings
->Share
: , and config like show bellow: -
Open a terminal, run:
arp -a
to find all host on same AP, find the host marked asbridge
-
Test network status:
ping baidu.com
If everything is OK, your Respberry Pi will connect to internet.
In this section, I will show how to install linorobot on Respberry Pi.
-
Login in to your Respberry Pi:
-
clone the install package:
git clone https://github.com/linorobot/lino_install cd lino_install
-
For Raspberry Pis it is recommended to have a swap file to prevent the initial build from failing. You can disable this once the installation is done.
sudo apt-get install dphys-swapfile
-
Run install script, where base in(
2wd
,4wd
,ackermann
,mecanum
) and sensor in(xv11
,rplidar
,ydlidar
,hokuyo
,kinect
,realsense
). I am use2wd
base andrplidar
, so run: -
./install 2wd rplidar
Then, you will see this:
armv7l ______ _____________ _________ ________ _______ ________ _______ ___ / ____ _/___ | / /__ __ \___ __ \__ __ \___ __ )__ __ \___ __ / __ / __ |/ / _ / / /__ /_/ /_ / / /__ __ |_ / / /__ / _ /_____/ / _ /| / / /_/ / _ _, _/ / /_/ / _ /_/ / / /_/ / _ / /_____//___/ /_/ |_/ \____/ /_/ |_| \____/ /_____/ \____/ /_/ http://linorobot.org You are installing ROS-kinetic Linorobot for 2wd base with a rplidar sensor. Enter [y] to continue.
Entry
y
-
Wait to finish, (It takes me more than 30 mins, so be patient)
Some issue you maybe face:
unsupported locale setting
, try thisfatal error: lino_msgs/PID.h: No such file or directory
, rerun install script several times.
- 2018-10-10 Add
Hardware test and driver installation
includelaser sensor
- 2018-10-12 Add
Make your Respberry Pi connect to internet
andLinorobot Installation
- Linorobot home page: https://linorobot.org
- Linorobot getting stated: https://github.com/linorobot/linorobot/wiki/1.-Getting-Started#11-what-you-need
- Ros home page: http://ros.org
- Respberry Help page: https://www.raspberrypi.org/help/
- Ubiquityrobotics home page: https://ubiquityrobotics.com/
- INTRODUCING THE TEENSY 3.5 AND 3.6: https://hackaday.com/2016/08/17/introducing-the-teensy-3-5-and-3-6/
- PRLiDAR A1 Download page: https://www.slamtec.com/en/Support#rplidar-a1
- PRLiDAR SDK: https://github.com/slamtec/rplidar_sdk
- PRLiDAR ROS: https://github.com/slamtec/rplidar_ros