Skip to content
This repository has been archived by the owner on Oct 2, 2024. It is now read-only.
/ RobotDSL Public archive

A domain specific language and its support for mobile robots.

License

Notifications You must be signed in to change notification settings

LFLCH/RobotDSL

Repository files navigation

RobotDSL

RobotDSL is a school project (ESIR3 - Automated Software Engineering class) that aims to create a simple Domain Specific Language (DSL) for Robots.

RobotScript

Logo name

RobotScript is a programming language specialized for mobile robots.
This repository is a Langium project.
It provides a CLI as well as a WEB IDE to compile and interpret RobotScript programs.

Interpret

From a program and a given environment, the interpreter is able to calculate the state that the robot will have at each instant. It is possible to interpret a same program for several robots.

Demo squares

Compile

A RobotScript program can be translated into Arduino code using the compiler. Currently, it is specifically done for Omni4WD robots.

Robot Preview

Demonstration

main_demo.mp4

Get Started

After cloning this repository, don't forget to install the dependencies.

npm install && npm run langium:generate

Resources

Documentation

The documentation/ folder contains several documentation files.

  • Read rbs.md to learn more about the language syntax.
  • Read web.md to learn how to use the WEB IDE.
  • Read devprocess.md to learn more about the steps the we followed to achieve this project.

Examples

Several example files of valid RobotScript code are located in the examples/ folder. They can be used as reference to understand the language and to verify the behavior of the different implemented processes.

Main commands

Use of the CLI

Compile the necessary files

npm run build

Interpret

./bin/cli.js interpret  <filepath.rbs> 

Compile

./bin/cli.js compile  <filepath.rbs> 

Use the Web IDE

Compile the necessary files

npm run build:web

Launch the server

npm run serve

Open localhost:3001 in the browser.

Update the AST from the grammar

npm run langium:generate

Some generated files will be in the src/language/generated. You will need to place them in the src/language/representation folder. Before replacing src/language/representation/currentast.ts with the content of src/language/generated/ast.ts, please read the file comments.

VScode

The Langium project has been developped using VSCode as main IDE. We therefore coded some tools that ease the developpment.

Extension

npm run build:extension

Then install the extension that was produced.

vscode extension install

You can find it in the extensions tab of vscode. It will activate the RobotScript language support for all the .rbs files.

vscode extension overview

Launches

vscode extension run

VScode enables to automate debug processes, thanks to the Run & Debug tab. There you can select several options:

  • Run Extension launches a new VScode workspace, where the .rbs will have a RobotScript language suport.
  • Start web server will launch a web server in background.