The Robotics Language is an open compiler where users can develop languages to generate ROS code
Clone or download
Latest commit c8a2a4d Oct 8, 2018
Permalink
Failed to load latest commit information.
Development/Editors/atom fixed comment Aug 24, 2018
RoboticsLanguage Merge pull request #39 from robotcaresystems/feature/language/assign Oct 8, 2018
.gitignore initial commit Mar 27, 2018
.gitlab-ci.yml initial commit Mar 27, 2018
ACKNOWLEDGEMENTS.md initial commit Mar 27, 2018
BUGS.md initial Sep 24, 2018
LICENSE initial commit Mar 27, 2018
README.md bugfix Sep 28, 2018
TODO.md todo Aug 28, 2018
setup.cfg testing Jun 26, 2018
setup.py bug fix Sep 30, 2018

README.md

What is the language of Robotics?

This is a very deep question with difficult answers. If robotics is meant to equal or even surpass human capabilities, then the language of robotics should be able to describe human behaviour, all the way from muscle activation to intelligence. Achieving this on a single programming language seems like an impossible task. This project proposes a new framework where multiple domain specific languages are used together to describe the behaviour of a robot. Specifically, the Robotics Language (RoL) is a high level robotics programming language that generates ROS c++ nodes, HTML interfaces, or other elements.

Domain Specific Languages are computer languages specialised to a particular application domain. Such languages use the minimum information required to describe a particular concept for a domain, thus present an abstraction of information. This project uses the concept of mini-languages to abstract programming by combining multiple domain specific languages in a single file.

The base RoL language has a structure similar to standard high-level programming languages

# A simple topic echo node
node(
  name:'example echo',

  definitions: block(
    # the input signal
    echo_in ∈ Signals(Strings, rosTopic:'/echo/in', onNew: echo_out = echo_in ),

    # the echo signal
    echo_out ∈ Signals(Strings, rosTopic:'/echo/out')
  )
)

The power of the RoL is in its ability to integrate mini-languages to build code abstractions.

# A finite state machine
node(
  name:'example state machine',

  definitions: block(

    # a mini-language: code is defined within `<{ }>`
    FiniteStateMachine<{

      name:machine
      initial:idle

      (idle)-start->(running)-stop->(idle)
      (running)-error->(fault)-reset->(idle)
      (idle)-calibration->(calibrate)-reset->(idle)

    }>,

    # the start signal
    start ∈ Signals(Empty, rosTopic:'/start', onNew: machine.fire('start')),

    # the stop signal
    stop ∈ Signals(Empty, rosTopic:'/stop', onNew: machine.fire('stop'))

  )
)

Automatically generated graphical user interfaces in the browser allow for development and monitoring.

RoL contains high-level language element abstractions that are very useful for robotics, such as Interval Temporal Logic for signals.

node(
  name:'temporal logic test example',

  definitions: block(

    # a signal
    x ∈ Signals(Booleans, rosTopic:'/temporal_logic/x'),

    when(□[1,0](x),
      print('always in the last second')),

    when(◇[4,1](x),
      print('eventually from 4 seconds to 1 second ago')),

    when(□[5,0](◇[1,0](x) ∧ ◇[1,0](¬x)),
      print('oscillating faster then 1Hz for at least 5 seconds'))

  )
)

Generated GUIs visualise the signals in time and the outcome of the logic.

The RoL is in practice an open compiler where users can develop their own languages by means of plug-ins. The RoL is programmed in python and uses XML as the internal abstract syntax tree.

Documentation

Install

If you are a user run:

pip install .

If you are a developer run:

pip install -e .

Examples

You can try the RoL compiler by testing the examples in the folder RoboticsLanguage/Examples:

rol RoboticsLanguage/Examples/helloworld.rol

This will create a ROS node in the folder ~/deploy. If you have installed the catkin workspace at ~/catkin_ws then you can supply the path to the compiler and compile and launch the node directly:

rol --deploy-path ~/catkin_ws/src/deploy/ RoboticsLanguage/Examples/helloworld.rol -c -l

Docker image

You can test the robotics language using a docker environment. First make sure the Robotics Language is installed

sudo -H pip install -e .

Next start the docker image

rol_docker

You can open another shell by repeating the previous command as many times as you want.

Once in the docker, everything is configured. You can compile the example:

rol RoboticsLanguage/Examples/helloworld.rol -c

Make sure to source for the first time:

source ~/catkin_ws/devel/setup.bash

Now you are ready to launch:

rol RoboticsLanguage/Examples/helloworld.rol -l

Work in progress

The Robotics Language is continuously evolving. Not all features are implemented. If find errors or you wish a new feature please let us know.

Acknowledgements

The Robotics Language is developed by Robot Care Systems B.V. (http://www.robotcaresystems.com)


rosin_logo

Supported by ROSIN - ROS-Industrial Quality-Assured Robot Software Components.
More information: rosin-project.eu

eu_flag

This project has received funding from the European Union’s Horizon 2020
research and innovation programme under grant agreement no. 732287.