Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
308e05f
Update Python interface for ROS 2
SuperJappie08 Oct 4, 2024
5c0656e
FIrst working version, still need one fix in roslibjs
mklomp Oct 31, 2024
e4e5f56
Fix config location + some comments
ArendJan Jan 6, 2025
89616f4
Merge pull request #41 from SuperJappie08/ros2-dev
ArendJan Jan 6, 2025
7cabb28
Fixed color sensor block accepting numbers
mklomp Feb 13, 2025
fb06940
Fixed color sensor block accepting numbers
mklomp Feb 13, 2025
a70ebe2
Sensors working
mklomp Mar 17, 2025
4bbbf23
Added working actuators
mklomp Mar 17, 2025
4243eff
Fix for inf distance sensor
mklomp Mar 17, 2025
824c19b
Working Blockly
mklomp Mar 17, 2025
0f8d424
Interacting with Xterm working, and remove the linetrace route
mklomp Mar 19, 2025
31c4906
Settings also working
mklomp Mar 19, 2025
cc90f5d
Merge pull request #70 from mklomp/ros2
mklomp Mar 19, 2025
9993e66
Fixed telemetrix conf upload location
mklomp Mar 20, 2025
e0714e3
Merge branch 'develop' of https://github.com/mirte-robot/mirte-web-in…
mklomp Mar 20, 2025
aad295e
Add roslib prebuilt for coalescing thing ??
ArendJan Mar 20, 2025
29d9126
test node 16
ArendJan Mar 20, 2025
681dd12
Fixed cmd_vel for new topic name
mklomp Mar 24, 2025
8cf9d48
Removed control tab from navbar
mklomp Mar 25, 2025
9e2d6fb
Merge branch 'ros2' into develop
mklomp Mar 25, 2025
82ce845
Merge branch 'develop' of https://github.com/mirte-robot/mirte-web-in…
mklomp Mar 25, 2025
fcbb7da
Fix for smaller blockly div when switching languages
mklomp Mar 25, 2025
42d77bb
Only reload telemetrix after params changed
mklomp Mar 25, 2025
e7798b2
Fix for adding hardware to settings
mklomp Mar 25, 2025
c36e5fd
Added text version of OLED
mklomp Mar 25, 2025
fe57ae3
OLED blockly text working
mklomp Mar 25, 2025
f02bdb8
Added (m) to distance sensor
mklomp Mar 26, 2025
22e3692
Fix for hsl color sensor
mklomp Mar 30, 2025
459c7bb
Fixed translations in toolbox not being updated after language change
mklomp Mar 31, 2025
3194ebd
Set default value to OLED
mklomp Mar 31, 2025
bb2e595
Merge pull request #71 from mirte-robot/main
ArendJan Apr 3, 2025
d013c60
Fix for switching between blockly and python
mklomp Apr 4, 2025
f706ffc
Fixed correct import and excute of mirte.py
mklomp Apr 4, 2025
f014201
Fixed the python imports and flow
mklomp Apr 30, 2025
c8cd8d1
Fix for blockly python switching
mklomp May 6, 2025
be44ec8
Disable backend run test
mklomp May 19, 2025
7160939
Updated README and modified license to comply with TUD OSS
mklomp May 30, 2025
e100cba
Fixed readme license notice
mklomp Jun 3, 2025
cddd8bf
Fix for tooltip issue
mklomp Jun 24, 2025
741d261
Merge pull request #74 from mklomp/tooltip
mklomp Jun 24, 2025
9a980f3
Using unmodified licence to comply with OSI
mklomp Jul 18, 2025
e994dc4
fix missing closing tag settings.vue
ArendJan Sep 17, 2025
9d3e8de
Merge pull request #78 from mklomp/pre-u-color-fix
ArendJan Feb 16, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .github/workflows/buildBackend.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Node.js Build

on:
push:
pull_request:

jobs:
build_backend:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '16'
check-latest: true

- name: Install dependencies
run: |
cd nodejs-backend
npm install
npm rebuild
# Disabled for now, we caan enable this one
# as soon as we have remove the login from
# back- and frondend (and tested its working
# with nginx)
# - name: Run build
# run: |
# cd nodejs-backend
# exit_status=0
# timeout 60 npm run backend || exit_status=$?
#
# if [[ $exit_status -eq 124 ]]; then
# echo "Backend ran good!"
# else
# echo "Backend run failed!"
# exit 1
# fi

# - name: Run tests
# run: npm test
31 changes: 31 additions & 0 deletions .github/workflows/buildFrontend.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Node.js Build

on:
push:
pull_request:

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 'current'
check-latest: true

- name: Install dependencies
run: |
cd vue-frontend
npm install
- name: Run build
run: |
cd vue-frontend
npm run build

# - name: Run tests
# run: npm test
7 changes: 7 additions & 0 deletions NOTICE
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
This software is licensed under GNU General Public License v3.
See the LICENSE file for details.

Technische Universiteit Delft hereby disclaims all copyright interest
in the software of "MIRTE robot" (an educational robot) written by the
Author(s).
prof. dr. ir. Fred van Keulen, Dean of Mechanical Engineering
46 changes: 26 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,47 +1,53 @@
# mirte-web-interface

This repository contains both the backend (NodeJS) and frontend (Vue) of the robot.
This repository contains both the backend (NodeJS) and frontend (Vue) of
the [MIRTE robot](https://mirte.org). Please read the [MIRTE documentation](https://docs.mirte.org/)
on how this can be used.

## Preparations
## Build preparations

In order to build and run both the frontend and backend one needs an installation of NodeJS. We
prefer using nodeenv.

```
```sh
sudo apt install -y python3-pip python3-setuptools python3-wheel
sudo -H pip install nodeenv
nodeenv --node=16.2.0 node_env
source node_env/bin/activate
```

## Build and run the frontend
## Build

```
cd vue-frontend
npm install .
npm run build
```
- backend:

This will build a dist folder which will be served by the backend.
```sh
cd nodejs-backend
npm install .
npm run backend
```

- frontend:

## Build and run the backend
```sh
cd vue-frontend
npm install .
npm run build
```
This will build a dist folder which will be served by the backend.

```
cd nodejs-backend
npm install .
npm run backend
```

## Develop for the frontend
## Build locally, and deploy on robot

The orange pi might not have enough power to build the backend. In order to develop on your own machine
you could also serve the frontend on your local machine (without the backend).
The SBC of the robot might not have sufficient RAM to actually build the
frontend. You can also build the frontend locally, and then deploy it
to the robot:

```
cd vue-frontend
npm install .
npm run serve
rm -rf dist && npm run build && scp -R dist mirte@<mirte-ip>:/usr/local/src/mirte/mirte-web-interface/vue-frontend/
```

## License

This work is licensed under a GPL-3.0 OSS license.
10 changes: 2 additions & 8 deletions nodejs-backend/reload_params.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
#!/bin/bash

source /opt/ros/noetic/setup.bash
source /home/mirte/mirte_ws/devel/setup.bash
rosnode kill /mirte_telemetrix_mirte
rosparam delete /mirte
rosparam load /home/mirte/mirte_ws/src/mirte-ros-packages/mirte_telemetrix/config/mirte_user_config.yaml mirte
rosrun mirte_telemetrix ROS_telemetrix_api.py __name:=mirte_telemetrix_mirte


# Killing telelmetrix node, which ROS will restart automtically (with the new params)
pkill -f /opt/ros/humble/lib/mirte_telemetrix_cpp/mirte_telemetrix_cpp_node
14 changes: 8 additions & 6 deletions nodejs-backend/services.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ var flash=require("connect-flash");
const { createProxyMiddleware } = require('http-proxy-middleware');
fs = require('fs')

// FIXME: This needs to change to the correct config location. Doesn't work nicely with pre-compiled packages.
const mirte_user_config_file = '/home/mirte/mirte_ws/src/mirte-ros-packages/mirte_bringup/telemetrix_config/mirte_user_config.yaml';


// TODO: Currently the local-ip package is not working
function getLocalIP(){
var address,os = require('os'),ifaces = os.networkInterfaces();
Expand Down Expand Up @@ -67,9 +71,7 @@ server.once('listening', function() {

server.listen(4000);

// Setup passportJS
//
//
// TODO: just remove this, security is done by nginx.
const authMiddleware = (req, res, next) => {
if (req.isAuthenticated() || getLocalIP() == "192.168.42.1" || getLocalIP() == "192.168.43.1" || getLocalIP() == "192.168.44.1") {
return next()
Expand Down Expand Up @@ -239,21 +241,21 @@ app.post('/api/settings', (req, res) => {
var source = req.body

const fs = require('fs');
fs.writeFile("/home/mirte/mirte_ws/src/mirte-ros-packages/mirte_telemetrix/config/mirte_user_config.yaml", source, (err) => {
fs.writeFile(mirte_user_config_file, source, (err) => {
if(err) {
console.log(err);
res.end("something went wrong writing the file");
}
const exec = require('child_process').execFile;
const stdout = exec("/usr/local/src/mirte/mirte-web-interface/nodejs-backend/reload_params.sh");
const stdout = exec(`${__dirname}/reload_params.sh`);
res.end("done");
});
});


// catch robot settings (ROS params) from the web interface and save them
app.get('/api/settings', (req, res) => {
res.download("/home/mirte/mirte_ws/src/mirte-ros-packages/mirte_telemetrix/config/mirte_user_settings.yaml");
res.download(mirte_user_config_file);
/*
const fs = require('fs');
fs.readFile("/home/mirte/mirte_ws/src/mirte_ros_package/config/mirte_user_settings.yaml", function read(err, data) {
Expand Down
6 changes: 6 additions & 0 deletions vue-frontend/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
plugins: [
['@babel/plugin-proposal-nullish-coalescing-operator'],
['@babel/plugin-proposal-optional-chaining']
]
}
18 changes: 14 additions & 4 deletions vue-frontend/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"upload": "upload",
"upload_confirm": "Are you sure you want to upload to the microcontroller?",
"save": "save",
"save_confirm": "Are you sure you want to update the hardware settings?",
"save_confirm": "Are you sure you want to update the hardware settings? The changes will be visible after 10 seconds.",
"name": "name",
"pin": "pin",
"add": "add",
Expand Down Expand Up @@ -53,7 +53,7 @@
"open": "open"
},
"peripherals": {
"ultrasonic_sensor": "Distance sensor",
"ultrasonic_sensor": "Distance sensor (m)",
"ir_sensor": "IR sensor",
"color_sensor": "Color sensor",
"keypad_sensor": "Keypad",
Expand Down Expand Up @@ -100,10 +100,20 @@
"SET_MOTOR_CONTROL": "%1 motor control",
"STOP_MOTOR": "stop motor %1",
"SET_SERVO_ANGLE": "set servo %1 to angle %2",
"SET_OLED": "show the %2 %3 on screen %1",
"SET_OLED": "show %2 on screen %1",
"GET_ANALOG_PIN_VALUE": "analog value of pin %1",
"GET_DIGITAL_PIN_VALUE": "digital value of pin %1",
"WAIT": "wait %1 second(s)",
"WAIT_UNTIL": "wait until %1"
"WAIT_UNTIL": "wait until %1",
"COLOR_SENSOR_TB": "Color sensor",
"ULTRASONIC_SENSOR_TB": "Distance sensor (m)",
"IR_SENSOR_TB": "IR sensor",
"KEYPAD_SENSOR_TB": "Keypad",
"WHEEL_ENCODER_TB": "Wheel encoder",
"PP_MOTOR_TB": "Motor (pp)",
"DP_MOTOR_TB": "Motor (dp)",
"DDP_MOTOR_TB": "Motor (ddp)",
"SERVO_TB": "Servo",
"OLED_TB": "OLED Screen"
}
}
18 changes: 14 additions & 4 deletions vue-frontend/locales/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"wiring": "Bekabeling",
"microcontroller": "Microcontroller",
"upload": "upload",
"upload_confirm": "Weet je zeker dat je de microcontroller wilt uploaden?",
"upload_confirm": "Weet je zeker dat je de microcontroller wilt uploaden? Na ongeveer 10 seconden zal de verandering zichtbaar zijn.",
"save": "opslaan",
"save_confirm": "Weet je zeker dat je de hardware instellingen wilt opslaan?",
"name": "naam",
Expand Down Expand Up @@ -53,7 +53,7 @@
"open": "openen"
},
"peripherals": {
"ultrasonic_sensor": "Afstand sensor",
"ultrasonic_sensor": "Afstand sensor (m)",
"ir_sensor": "IR sensor",
"color_sensor": "Kleuren sensor",
"keypad_sensor": "Toetsen",
Expand Down Expand Up @@ -100,10 +100,20 @@
"SET_MOTOR_CONTROL": "%1 motor control",
"STOP_MOTOR": "stop motor %1",
"SET_SERVO_ANGLE": "zet servo %1 op hoek %2",
"SET_OLED": "laat de %2 %3 op scherm %1 zien",
"SET_OLED": "laat %2 op scherm %1 zien",
"GET_ANALOG_PIN_VALUE": "analoge waarde van pin %1",
"GET_DIGITAL_PIN_VALUE": "digitale waarde van pin %1",
"WAIT": "wacht %1 seconde(n)",
"WAIT_UNTIL": "wacht totdat %1"
"WAIT_UNTIL": "wacht totdat %1",
"COLOR_SENSOR_TB": "Kleuren sensor",
"ULTRASONIC_SENSOR_TB": "Afstand sensor (m)",
"IR_SENSOR_TB": "IR sensor",
"KEYPAD_SENSOR_TB": "Toetsen",
"WHEEL_ENCODER_TB": "Encoder",
"PP_MOTOR_TB": "Motor (pp)",
"DP_MOTOR_TB": "Motor (dp)",
"DDP_MOTOR_TB": "Motor (ddp)",
"SERVO_TB": "Servo",
"OLED_TB": "OLED Scherm"
}
}
Loading