Giter Club home page Giter Club logo

regilo's Introduction

Regilo

Build Status Latest Version License Documentation Coverage Status

A simple C++ library for controlling the Neato XV robot and the Hokuyo scanner.

regilo allows you to communicate with the Neato robot or the Hokuyo scanner through a serial port or sockets. You can use some implemented methods like setTestMode(), setMotor() (for Neato XV), getVersion() (for Hokuyo), getScan() (for both), or run any other command with the sendCommand() method.

Download

In the supported operating systems (currently Arch Linux, Debian, Ubuntu, and Fedora), you can install the appropriate package. Otherwise, you can download the source code, build regilo according to the build instructions below, and install it.

Usage

Neato XV

// Create the controller
regilo::NeatoSocketController controller;

// Connect it
controller.connect("10.0.0.1:12345");

// Set the test mode and LDS rotation
controller.setTestMode(true);
controller.setLdsRotation(true);

// Grab a scan from the robot
regilo::ScanData data = controller.getScan();

// Unset the test mode and LDS rotation
controller.setLdsRotation(false);
controller.setTestMode(false);

Hokuyo

// Create the controller
regilo::HokuyoSerialController controller;

// Connect it
controller.connect("/dev/ttyACM0");

// Grab a scan from the scanner
regilo::ScanData data = controller.getScan();

Dependencies

The library uses

The regilo-visual example also needs

Build

Make sure you have installed all necessary dependencies before building.

$ mkdir build && cd build
$ cmake ..
$ make

Use one of the following options if you want to build the examples as well

  • $ cmake -Dexample:bool=on .. for the console example (regilo-scan),
  • $ cmake -Dexample-gui:bool=on .. for the GUI example (regilo-visual),
  • $ cmake -Dexamples:bool=on .. for all examples.

For a faster build on a multicore processor, you can use:

$ make -j $(nproc)

Installation

To install the regilo library (and its examples), simply run as root:

# make install

To uninstall:

# make uninstall

Packages

There are three packages you can install. The package names adhere to the conventions of the operating systems.

Operating system Package name Package content
Arch Linux regilo-lib only runtime library
regilo library, headers, regilo-scan
Debian / Ubuntu libregilo only runtime library
libregilo-dev library, headers, regilo-scan
Fedora regilo only runtime library
regilo-devel library, headers, regilo-scan
All regilo-visual library, regilo-visual

Arch Linux

You can install regilo, regilo-lib, and regilo-visual in Arch Linux from the AUR.

Do not forget to add my PGP key (fingerprint D258 09BF 3563 AA56 A12B 0F4D 545E DD46 FBAC 61E6).

$ gpg --recv-key D25809BF3563AA56A12B0F4D545EDD46FBAC61E6

Ubuntu

In Ubuntu, you can use my ppa:branoholy/regilo and install the libregilo, libregilo-dev, and regilo-visual packages.

$ sudo add-apt-repository ppa:branoholy/regilo
$ sudo apt-get update
$ sudo apt-get install libregilo-dev

Debian

openSUSE Build Service can be used in Debian 8. You need to add my key and repository, and then you can install the libregilo, libregilo-dev, and regilo-visual packages.

$ sudo sh -c "wget http://download.opensuse.org/repositories/home:/branoholy:/regilo/Debian_8.0/Release.key -O - | apt-key add -"
$ sudo sh -c "echo 'deb http://download.opensuse.org/repositories/home:/branoholy:/regilo/Debian_8.0/ ./' >> /etc/apt/sources.list"
$ sudo apt-get update
$ sudo apt-get install libregilo-dev

Fedora

openSUSE Build Service can be used in Fedora 23 as well. You need to add my repository and then you can install the regilo, regilo-devel, and regilo-visual packages.

$ sudo dnf config-manager --add-repo http://download.opensuse.org/repositories/home:/branoholy:/regilo/Fedora_23/home:branoholy:regilo.repo
$ sudo dnf install regilo-devel

Examples

See examples for more information about using of this library.

regilo-scan is a simple example that connects to the Neato or Hokuyo, performs one scan, and prints it.

regilo-visual is more complex and requires the wxWidgets library. It can be used to drive with the Neato, scan automatically or manually, and log the output. Same scanning functionality can be done with the Hokuyo as well.

Regilo Visual Screenshot

License

Regilo is licensed under GNU GPL v3 (see the LICENSE file).

regilo's People

Contributors

branoholy avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

geordi

regilo's Issues

Create unit tests

Test everything to get 100% coverage.

  • ScanRecord & ScanData
  • Log & TimedLog
  • SerialController
  • SocketController
  • HokuyoController
  • NeatoController

Incorrect CMake Options

CMake option() should be used only for bool variables. Use set instead

set(<variable> <value> [[CACHE <type> <docstring> [FORCE]] | PARENT_SCOPE])

Disallow more instructions at one line

More instructions at one line are not correctly shown in the coverage results.

The line below is marked as tested even if the method is never called.

if(obj != nullptr) obj->method();

A split to more lines should correct it.

if(obj != nullptr)
    obj->method();

It is necessary to

  • change the beautifier settings,
  • reformat the source code,
  • check new coverage results.

Change the arguments used for reading from a log

Two changes are necessary

  • The argument -c should take the device:protocol format where protocol could be log. Then, the -e argument could also point to a log path. The argument -l would be used only for the output log.
  • The argument -l is missing in the regilo-scan example.

Improve the Log class

  • Add a separate class for the metadata

  • Improve backward compatibility of the log classes

  • Read metadata and determinate the version/class in runtime

  • Other improvements

  • Use the following format

    # comment
    type <string>
    version <int>
    [additional metadata]
    
    <name:char/string> [<length:int> ]<value:any>
    <name:char/string> [<length:int> ]<value:any>
    
    <name:char/string> [<length:int> ]<value:any>
    <name:char/string> [<length:int> ]<value:any>
    ...
    

    Example for regilo::Log

    # Log
    type log
    version 2
    
    c 11 testmode on
    r 0
    
    c 7 gettime
    r 12 Sunday 16:45
    

    Example for regilo::TimedLog

    # TimedLog
    # Backward compatible with class log
    type timedlog
    version 2
    timeres 1 1000
    
    c 11 testmode on
    r 0
    t 1718373
    
    c 7 gettime
    r 12 Sunday 16:45
    t 18373748
    

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.