This is a project aiming to aid remote caretakers with expressing body language to patients using humanoid robots.
npm install -g yarn
) choco install rabbitmq
All commands are to run from /<subdir to setup>
npm i
npm run build:web
from /robot-motion-language
directory if you have made any changes to RML
npm install
yarn start
or npm start
python -m venv venv
.\venv\Scripts\activate
pip install -r requirements.txt
python server.py
guest
guest
pip install -r requirements.txt
(Webots do not support Virtual environments as of version 2022b)robot-caretaker\webots_simulation\worlds\example.wbt
in Webots. (Simulation starts automatically)The system should now be running end-to-end.
Try clicking a button in the web-UI and see if it is sent to the robot simulation.
On the webpage there are several large buttons coresponding to a robot motion. Clicking one of these will result in the robot performing that motion.
Right-clicking on the buttons will result in creating a sequence of motions that will be performed in order when clicking the green Perform
button.
First, let's create a new motion
Add Motion
button in the navigation bar at the top of the page.SAVE
Button to save your motion function to the system.Let's add a button for performing the motion
+
button in the bottom right corner of the webpage.ENTER
.The robot should now perform the motion when clicking the button!
To delete a motion button, click the red trashcan in the bottom right corner of the webpage.
An input field will appear. Enter the exact name and sentiment of the motion button you would like to delete and press ENTER
.
To hide the input field, refresh the page.
This system allows you to easily add any robot:
/webots_simulation
directory (or create a new Webots world file)robot_controller.py
/controllers/robot_controller/config.yaml
(any joint-rotation not present in the config file can safely be added. Use the naming convention of the other joints)The system should now be functional with your newly added robot.
RML is a custom DSL that allows easy creation of motions. RML is intended to use in the monaco code editor in the browser.
Use the editor as any other text editor.
Press Enter
for newline.
Press Tab
for an indent.
If any text has a red
underline, hover
your mouse over it to see what the problem is and follow the message to fix it.
When you open up the editor, an RML example should be displayed.
Notice the indentation structure. This is not strictly neccessary, but makes the program much easier to read.
define wave
Defines a motion called wave
. The define
contains more RML code, demonstrated by indentation. Anything more indented than the define
is contained within it. The end
at the same indentation-level as the define
, terminates it. We call commands that contains code and ends with an end
a block command
. Remember to indent any contained code for readability.
repeat 3
is another block command. It will perform any code contained between it and its end
3 times. Note that the 3
can be an arbitrary integer. Remember to indent any contained code for readability.
multimove
is another block command. It will perform any command contained between it and its end
simultaneously rather than in sequence. Remember to indent any contained code for readability.
move right shoulder pitch to -1.5
is the final command. This will move the specified joint to the specified end-position -1.5
.
define <your_motion_name>
<Rest of RML code is indented and goes here>
end
Note that \<your_motion_name> is arbitrary, but don't include spaces.
repeat <amount>
<RML code to be repeated is indented and goes here>
end
Note that \<amount> is an arbitrary integer.
multimove
<RML to be performed simultainously is indented>
end
move <side> <joint> <rotation> to <position>
Note that \<side> and \<rotation> is not always needed depending on the joint.
right
| left
head
| fingers
| wrist
| elbow
| shoulder
| torso
| hip
| knee
| ankle
| toes
pitch
| roll
| yaw
Set-ExecutionPolicy RemoteSigned
npm audit fix
(optionally with --force
)pip install
?
python -m pip install <package_to_be_installed>
backend
Contains the Flask server and is the backend of the web-app
messaging
Publisherserver.py
API endpointsfrontend
React app
public
rml-generator.js
Bundle from RML dir that allows RML to JSON generationrml-server-worker
Bundle from RML dir that allows RML to be used in monaco editor.src
components
React components (navbar, moodgrid, moodcards..)pages
The pages the React-router browses betweenApp.tsx
Main pagerobot-motion-language
(RML) The DSL to create motions with
src
cli
DSL command line functions and toolgenerator
Generates JSON from an RML programlanguage-server
generated
Langium generated semantic modelmain-browser.ts
Entry point for use in browsermain.ts
Entry point for use as extensionvalidator
Syntax validation.langium
Grammar for RMLweb
Functions used in web. Bundled and exported to frontendpackage.json
See scripts
for bundling and compilingwebots_simulation
controllers
robot_controller
General controller for robots in Webots.
config.yaml
Config file used as resolver for robot-device naming and initialization.motion_functions.py
File with motions that robots can perform. This file will be appended to when creating a new motion in the frontend.robot_controller.py
This is the robot controller.subscriber.py
Subscriber logic. Used in supercontroller.py
worlds
.wbt file to open in WebotsThe RML input is not currently sanitized before it is stored in the system
The RML bundle in frontend is added to VC for ease of developing. This is not recommended and should be added to .gitignore. This is the reason it says this repo is 99.5% JS
Styling in frontend is largely in-line, feel free to redo
Fonts and other real-time retrieved assets will not work on Intranet. To fix, include assets in project