RobotDSL is a school project (ESIR3 - Automated Software Engineering class) that aims to create a simple Domain Specific Language (DSL) for Robots.
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.
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.
A RobotScript program can be translated into Arduino code using the compiler. Currently, it is specifically done for Omni4WD robots.
main_demo.mp4
After cloning this repository, don't forget to install the dependencies.
npm install && npm run langium:generate
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.
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.
Compile the necessary files
npm run build
Interpret
./bin/cli.js interpret <filepath.rbs>
Compile
./bin/cli.js compile <filepath.rbs>
Compile the necessary files
npm run build:web
Launch the server
npm run serve
Open localhost:3001
in the browser.
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.
The Langium project has been developped using VSCode as main IDE. We therefore coded some tools that ease the developpment.
npm run build:extension
Then install the extension that was produced.
You can find it in the extensions tab of vscode.
It will activate the RobotScript language support for all the .rbs
files.
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.