Skip to content

jacks808/linorobot-in-action

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 

Repository files navigation

Linorobot in Action

Build a linorobot from scratch

This is a document project describe how to build a linorobot from scratch.

Table of content

Introduction

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.

Hardware

In this part, I will tell how to build hardware part about linorobot. Including Hardware and how to assemble them together.

Hardware list

Here is the hardware list that I used, all of this part can be found at Taobao or Amazon

More supported hardware can be found here

Assemble

// Todo

Hardware test and driver installation

In this section, I will show you how to make sure hardware works well, and install the required drivers.

Laser sensor

https://www.slamtec.com/en/Lidar/A1Spec

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

Hardware test

  1. Assemble PRLiDAR A1 with drive board .

  2. Find a Micro USB-B image-20181010174342181 Line, connect drive board to your computer

  3. Then LiDAR should start rotating clockwise.

Driver installation (MacOS)

  1. Install serial port driver

    Driver installation file can be found at CP210x USB to UART Bridge VCP Drivers

  2. Download SDK from github

    git clone [email protected]:Slamtec/rplidar_sdk.git
  3. 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.

  4. Find USB serial:

    ls -l /dev/tty.*

    If you see /dev/tty.SLAB_USBtoUART That means driver is work:

    image-20181010180503117

  5. 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
    

Software

In this part, I will introduce how to install ROS on Respberry Pi. After that, linorobot Installation will be shown step by step.

Install OS for Raspberry Pi

This image is comes from here

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:

  1. Download img file for Respberry Pi: Img Link

  2. Use Etcher to write image to Respberry Pi SD card:

    1. Select Image

    2. Select Drive

    3. Flash

    4. Validating

      If everything is OK, you should see this:

      Jietu20181008-171027@2x

  3. Insert in your TF card to Respberry Pi. Power on, And wait some time (in 3 mins)

  4. Open Wifi config page to find a new Wifi point named: ubiquityrobotXXXX where XXXX is part of the MAC address. The wifi password is robotseverywhere.

  5. After connected, use ssh [email protected] with a password ubuntu to login.

If everything is OK you should see this:

image-20181008194204967

And ros is installed:

image-20181008195309767

Make your Respberry Pi connect to internet

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:

  1. Connect Mac to a AP with internet. (Note: Please Do NOT use 802.1x wifi AP)

  2. Connect Respberry Pi to Mac with a network line.

  3. Open System Settings-> Share : image-20181012202422842 , and config like show bellow:

    image-20181012202610951

  4. Open a terminal, run: arp -a to find all host on same AP, find the host marked as bridge

    image-20181012203237843

  5. ssh [email protected]

  6. Test network status: ping baidu.com

    image-20181012203603659

If everything is OK, your Respberry Pi will connect to internet.

Linorobot Installation

In this section, I will show how to install linorobot on Respberry Pi.

  1. Login in to your Respberry Pi:

    ssh [email protected]

  2. clone the install package:

    git clone https://github.com/linorobot/lino_install
    cd lino_install
  3. 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
  4. Run install script, where base in( 2wd, 4wd, ackermann, mecanum) and sensor in( xv11, rplidar, ydlidar, hokuyo, kinect, realsense). I am use 2wd base and rplidar, so run:

  5. ./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

  6. Wait to finish, (It takes me more than 30 mins, so be patient)

Some issue you maybe face:

  • unsupported locale setting , try this
  • fatal error: lino_msgs/PID.h: No such file or directory, rerun install script several times.

Update Notes

  • 2018-10-10 Add Hardware test and driver installation include laser sensor
  • 2018-10-12 Add Make your Respberry Pi connect to internet and Linorobot Installation

Useful links

About

Build a linorobot from scratch

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published