@robotical/webapp-types 3.25.2 → 3.25.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-types/package.json +1 -1
- package/dist-types/src/application/RAFTs/Marty/PublishedDataAnalyser.js +2 -8
- package/dist-types/src/application/RAFTs/RAFT.d.ts +1 -0
- package/dist-types/src/application/RAFTs/RAFT.js +2 -0
- package/dist-types/src/components/oneoffs/calibration-screens/ColourSensorCalibration/messages.d.ts +59 -0
- package/dist-types/src/components/oneoffs/calibration-screens/ColourSensorCalibration/messages.js +59 -0
- package/dist-types/src/i18n.js +2 -0
- package/dist-types/src/screens/configuration/marty/Diagnostics/ColourSensorDiagnostics/messages.d.ts +1 -0
- package/dist-types/src/screens/configuration/marty/Diagnostics/ColourSensorDiagnostics/messages.js +1 -0
- package/dist-types/src/utils/marty-colour-policy.json +11 -0
- package/package.json +1 -1
package/dist-types/package.json
CHANGED
|
@@ -14,6 +14,7 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
14
14
|
};
|
|
15
15
|
})();
|
|
16
16
|
import EventEmitter from "events";
|
|
17
|
+
import colourPolicy from "../../../utils/marty-colour-policy.json";
|
|
17
18
|
import { createRaftPubSubscriptionHelper } from "../raft-subscription-helpers";
|
|
18
19
|
import { getColourSensor, getLightSensor, getObjectSensor, getNoiseSensor, getRGBFromColourSensorVals, getHueChroma, getLightSenseValues, getObjectIsTouchingFromVals, getNoiseSenseValue, } from "./published-data-helpers";
|
|
19
20
|
var PublishedDataAnalyser = /** @class */ (function (_super) {
|
|
@@ -118,14 +119,7 @@ var PublishedDataAnalyser = /** @class */ (function (_super) {
|
|
|
118
119
|
}(EventEmitter));
|
|
119
120
|
var ColourSensedDetection = /** @class */ (function () {
|
|
120
121
|
function ColourSensedDetection() {
|
|
121
|
-
this.thresholds =
|
|
122
|
-
{ hue: [0, 10], chroma: [50, 200], clear: [40, 150], name: "red" },
|
|
123
|
-
{ hue: [20, 50], chroma: [40, 300], clear: [100, 255], name: "yellow" },
|
|
124
|
-
{ hue: [85, 160], chroma: [5, 100], clear: [25, 150], name: "green" },
|
|
125
|
-
{ hue: [180, 220], chroma: [40, 230], clear: [55, 255], name: "blue" },
|
|
126
|
-
{ hue: [200, 320], chroma: [0, 40], clear: [25, 150], name: "purple" },
|
|
127
|
-
{ hue: [345, 361], chroma: [50, 200], clear: [40, 150], name: "red" },
|
|
128
|
-
];
|
|
122
|
+
this.thresholds = colourPolicy.boundaries;
|
|
129
123
|
}
|
|
130
124
|
ColourSensedDetection.prototype.detectColourSensed = function (_a, analyser) {
|
|
131
125
|
var r = _a.r, g = _a.g, b = _a.b, clear = _a.clear, air = _a.air;
|
|
@@ -18,6 +18,7 @@ export default class RAFT implements RICInterface {
|
|
|
18
18
|
systemInfo: RaftSystemInfo | null;
|
|
19
19
|
raftStateInfo: RICStateInfo | SimplifiedCogStateInfo | null;
|
|
20
20
|
isVerified: boolean;
|
|
21
|
+
readonly connectionInstanceId: string;
|
|
21
22
|
/**
|
|
22
23
|
* Transport metadata belongs to the host RAFT entity so every embedded
|
|
23
24
|
* platform sees the same connection, regardless of how it was established.
|
|
@@ -91,6 +91,8 @@ var RAFT = /** @class */ (function () {
|
|
|
91
91
|
// RAFT State Info
|
|
92
92
|
this.raftStateInfo = null;
|
|
93
93
|
this.isVerified = false;
|
|
94
|
+
// A new host entity is created after each browser connection or native selection.
|
|
95
|
+
this.connectionInstanceId = randomHashGenerator(24);
|
|
94
96
|
/**
|
|
95
97
|
* Transport metadata belongs to the host RAFT entity so every embedded
|
|
96
98
|
* platform sees the same connection, regardless of how it was established.
|
package/dist-types/src/components/oneoffs/calibration-screens/ColourSensorCalibration/messages.d.ts
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
declare const english: {
|
|
2
|
+
readonly title: "Colour sensor calibration";
|
|
3
|
+
readonly introduction: "Keep Marty connected to USB power. We will collect {{count}} readings each for air and white. If you have a purple colour card, you can also use it for an optional step. Keep the lighting the same throughout.";
|
|
4
|
+
readonly sensor: "Colour sensor";
|
|
5
|
+
readonly selectSensor: "Select a colour sensor";
|
|
6
|
+
readonly step: "Step {{number}} of 2";
|
|
7
|
+
readonly optionalStep: "Optional step: purple colour card";
|
|
8
|
+
readonly air: "Lift Marty about 30 cm above the surface with both feet clear. Hold it steady and capture the air readings.";
|
|
9
|
+
readonly white: "Place the foot with the selected colour sensor flat on a matt white surface, with the sensor fully over it. Hold Marty steady and capture the white readings.";
|
|
10
|
+
readonly purple: "If you have a purple colour card, place the foot with the selected sensor flat on it and capture the readings. This helps the sensor tell a dark card from air. This step is optional: choose Skip and save calibration to finish using your air and white readings and keep the current ground threshold.";
|
|
11
|
+
readonly duration: "Each capture takes about 3–4 seconds once sampling starts. Preparing or restoring sensor settings can take a few extra seconds.";
|
|
12
|
+
readonly preparing: "Preparing the sensor…";
|
|
13
|
+
readonly warmingUp: "Waking the colour sensor…";
|
|
14
|
+
readonly sensorPowerFailed: "The colour sensor did not wake up. Check its connection, reconnect Marty and try again.";
|
|
15
|
+
readonly settling: "Hold Marty steady. Sampling starts in 1 second…";
|
|
16
|
+
readonly sampling: "Hold Marty steady. Reading {{count}} of {{total}}…";
|
|
17
|
+
readonly saving: "Saving and verifying the calibration…";
|
|
18
|
+
readonly restoring: "Restoring the previous settings…";
|
|
19
|
+
readonly working: "Please wait…";
|
|
20
|
+
readonly captureAir: "Capture air readings";
|
|
21
|
+
readonly captureWhite: "Capture white readings";
|
|
22
|
+
readonly capturePurple: "Capture purple and save calibration";
|
|
23
|
+
readonly skipPurple: "Skip and save calibration";
|
|
24
|
+
readonly startAgain: "Start again";
|
|
25
|
+
readonly saved: "Calibration saved on Marty: {{count}} readings for each position. This sensor's ground threshold is {{threshold}}.";
|
|
26
|
+
readonly savedWithoutPurple: "Calibration saved on Marty: {{count}} readings each for air and white. Purple was skipped, so the current ground threshold was kept.";
|
|
27
|
+
readonly reconnectStep: "Final step: reconnect Marty";
|
|
28
|
+
readonly reconnect: "Disconnect Marty below, then use Connect Marty to connect the same robot again. Your calibration is saved. Colour diagnostics will unlock once Marty has loaded the new sensor settings.";
|
|
29
|
+
readonly disconnectToFinish: "Disconnect Marty to finish calibration";
|
|
30
|
+
readonly disconnecting: "Disconnecting Marty…";
|
|
31
|
+
readonly loadingCalibration: "Marty has reconnected. Waiting for the new sensor settings and fresh readings…";
|
|
32
|
+
readonly calibrationReloadFailed: "The saved calibration could not be confirmed for this sensor. Keep the same sensor attached, disconnect Marty and reconnect it again.";
|
|
33
|
+
readonly reconnected: "Calibration complete. Marty has reconnected and loaded the saved sensor settings. Use Settings → Diagnostics to check all five cards and air.";
|
|
34
|
+
readonly download: "Download calibration results";
|
|
35
|
+
readonly back: "Back to calibration";
|
|
36
|
+
readonly usbRequired: "Connect Marty to USB power and keep it connected until calibration finishes.";
|
|
37
|
+
readonly notInAir: "Lift Marty so both feet are clear of the surface, then try again.";
|
|
38
|
+
readonly sensorDisconnected: "Connect and verify Marty, with its colour sensor attached, to continue.";
|
|
39
|
+
readonly unsupported: "This sensor or app connection does not support the new calibration yet. Update the app and reconnect Marty. Supported colour sensor firmware: type 97 / 1.3.1 and type 98 / 1.4.0–1.4.1.";
|
|
40
|
+
readonly readFailed: "A sensor reading could not be collected. Keep Marty connected and try this step again.";
|
|
41
|
+
readonly unstable: "The readings varied too much. Keep Marty steady and the lighting constant, then capture this position again.";
|
|
42
|
+
readonly saturated: "The air or purple reference reached the sensor's reporting limit of 255. Check Marty's placement for this step and retry. No new calibration was saved.";
|
|
43
|
+
readonly weakWhite: "The white reading is too weak. Use a matt white surface with the sensor close to it, then start again.";
|
|
44
|
+
readonly overlap: "Air and purple readings are too close to choose a reliable ground threshold. Check the sensor position and lighting, then start again. No new calibration was saved.";
|
|
45
|
+
readonly settingsChanged: "The sensor settings changed during calibration. Start again to collect a consistent set of readings.";
|
|
46
|
+
readonly writeFailed: "The new calibration could not be saved and verified. The previous settings were restored. Try again.";
|
|
47
|
+
readonly verificationFailed: "The sensor did not return the expected reading after calibration. The previous settings were restored. Keep Marty steady and try again.";
|
|
48
|
+
readonly restoreFailed: "The previous sensor settings could not be restored. Keep Marty on USB power, reconnect it and complete calibration again before using colour detection.";
|
|
49
|
+
readonly storageUnavailable: "The app could not back up the current sensor settings. Allow storage for this app or free some space, then try again. No new calibration was saved.";
|
|
50
|
+
readonly busy: "A previous calibration is still finishing or restoring settings. Wait a few seconds, then try again.";
|
|
51
|
+
readonly sampleTimeout: "Collecting the readings took too long. Keep Marty connected and try this step again.";
|
|
52
|
+
readonly sensorAsleep: "The colour sensor is asleep. Reconnect Marty and try again.";
|
|
53
|
+
readonly sensorOffline: "The colour sensor is offline. Check its connection and try again.";
|
|
54
|
+
readonly staleReading: "Sensor readings stopped updating. Reconnect Marty and try again.";
|
|
55
|
+
readonly backgrounded: "Calibration stopped when the app left the foreground. Keep this screen open and try again.";
|
|
56
|
+
readonly cancelled: "Calibration was cancelled. Start again when Marty is ready.";
|
|
57
|
+
readonly failed: "Calibration could not finish. Keep Marty connected and try again.";
|
|
58
|
+
};
|
|
59
|
+
export default english;
|
package/dist-types/src/components/oneoffs/calibration-screens/ColourSensorCalibration/messages.js
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
var english = {
|
|
2
|
+
title: "Colour sensor calibration",
|
|
3
|
+
introduction: "Keep Marty connected to USB power. We will collect {{count}} readings each for air and white. If you have a purple colour card, you can also use it for an optional step. Keep the lighting the same throughout.",
|
|
4
|
+
sensor: "Colour sensor",
|
|
5
|
+
selectSensor: "Select a colour sensor",
|
|
6
|
+
step: "Step {{number}} of 2",
|
|
7
|
+
optionalStep: "Optional step: purple colour card",
|
|
8
|
+
air: "Lift Marty about 30 cm above the surface with both feet clear. Hold it steady and capture the air readings.",
|
|
9
|
+
white: "Place the foot with the selected colour sensor flat on a matt white surface, with the sensor fully over it. Hold Marty steady and capture the white readings.",
|
|
10
|
+
purple: "If you have a purple colour card, place the foot with the selected sensor flat on it and capture the readings. This helps the sensor tell a dark card from air. This step is optional: choose Skip and save calibration to finish using your air and white readings and keep the current ground threshold.",
|
|
11
|
+
duration: "Each capture takes about 3–4 seconds once sampling starts. Preparing or restoring sensor settings can take a few extra seconds.",
|
|
12
|
+
preparing: "Preparing the sensor…",
|
|
13
|
+
warmingUp: "Waking the colour sensor…",
|
|
14
|
+
sensorPowerFailed: "The colour sensor did not wake up. Check its connection, reconnect Marty and try again.",
|
|
15
|
+
settling: "Hold Marty steady. Sampling starts in 1 second…",
|
|
16
|
+
sampling: "Hold Marty steady. Reading {{count}} of {{total}}…",
|
|
17
|
+
saving: "Saving and verifying the calibration…",
|
|
18
|
+
restoring: "Restoring the previous settings…",
|
|
19
|
+
working: "Please wait…",
|
|
20
|
+
captureAir: "Capture air readings",
|
|
21
|
+
captureWhite: "Capture white readings",
|
|
22
|
+
capturePurple: "Capture purple and save calibration",
|
|
23
|
+
skipPurple: "Skip and save calibration",
|
|
24
|
+
startAgain: "Start again",
|
|
25
|
+
saved: "Calibration saved on Marty: {{count}} readings for each position. This sensor's ground threshold is {{threshold}}.",
|
|
26
|
+
savedWithoutPurple: "Calibration saved on Marty: {{count}} readings each for air and white. Purple was skipped, so the current ground threshold was kept.",
|
|
27
|
+
reconnectStep: "Final step: reconnect Marty",
|
|
28
|
+
reconnect: "Disconnect Marty below, then use Connect Marty to connect the same robot again. Your calibration is saved. Colour diagnostics will unlock once Marty has loaded the new sensor settings.",
|
|
29
|
+
disconnectToFinish: "Disconnect Marty to finish calibration",
|
|
30
|
+
disconnecting: "Disconnecting Marty…",
|
|
31
|
+
loadingCalibration: "Marty has reconnected. Waiting for the new sensor settings and fresh readings…",
|
|
32
|
+
calibrationReloadFailed: "The saved calibration could not be confirmed for this sensor. Keep the same sensor attached, disconnect Marty and reconnect it again.",
|
|
33
|
+
reconnected: "Calibration complete. Marty has reconnected and loaded the saved sensor settings. Use Settings → Diagnostics to check all five cards and air.",
|
|
34
|
+
download: "Download calibration results",
|
|
35
|
+
back: "Back to calibration",
|
|
36
|
+
usbRequired: "Connect Marty to USB power and keep it connected until calibration finishes.",
|
|
37
|
+
notInAir: "Lift Marty so both feet are clear of the surface, then try again.",
|
|
38
|
+
sensorDisconnected: "Connect and verify Marty, with its colour sensor attached, to continue.",
|
|
39
|
+
unsupported: "This sensor or app connection does not support the new calibration yet. Update the app and reconnect Marty. Supported colour sensor firmware: type 97 / 1.3.1 and type 98 / 1.4.0–1.4.1.",
|
|
40
|
+
readFailed: "A sensor reading could not be collected. Keep Marty connected and try this step again.",
|
|
41
|
+
unstable: "The readings varied too much. Keep Marty steady and the lighting constant, then capture this position again.",
|
|
42
|
+
saturated: "The air or purple reference reached the sensor's reporting limit of 255. Check Marty's placement for this step and retry. No new calibration was saved.",
|
|
43
|
+
weakWhite: "The white reading is too weak. Use a matt white surface with the sensor close to it, then start again.",
|
|
44
|
+
overlap: "Air and purple readings are too close to choose a reliable ground threshold. Check the sensor position and lighting, then start again. No new calibration was saved.",
|
|
45
|
+
settingsChanged: "The sensor settings changed during calibration. Start again to collect a consistent set of readings.",
|
|
46
|
+
writeFailed: "The new calibration could not be saved and verified. The previous settings were restored. Try again.",
|
|
47
|
+
verificationFailed: "The sensor did not return the expected reading after calibration. The previous settings were restored. Keep Marty steady and try again.",
|
|
48
|
+
restoreFailed: "The previous sensor settings could not be restored. Keep Marty on USB power, reconnect it and complete calibration again before using colour detection.",
|
|
49
|
+
storageUnavailable: "The app could not back up the current sensor settings. Allow storage for this app or free some space, then try again. No new calibration was saved.",
|
|
50
|
+
busy: "A previous calibration is still finishing or restoring settings. Wait a few seconds, then try again.",
|
|
51
|
+
sampleTimeout: "Collecting the readings took too long. Keep Marty connected and try this step again.",
|
|
52
|
+
sensorAsleep: "The colour sensor is asleep. Reconnect Marty and try again.",
|
|
53
|
+
sensorOffline: "The colour sensor is offline. Check its connection and try again.",
|
|
54
|
+
staleReading: "Sensor readings stopped updating. Reconnect Marty and try again.",
|
|
55
|
+
backgrounded: "Calibration stopped when the app left the foreground. Keep this screen open and try again.",
|
|
56
|
+
cancelled: "Calibration was cancelled. Start again when Marty is ready.",
|
|
57
|
+
failed: "Calibration could not finish. Keep Marty connected and try again.",
|
|
58
|
+
};
|
|
59
|
+
export default english;
|
package/dist-types/src/i18n.js
CHANGED
|
@@ -11,12 +11,14 @@ import i18n from 'i18next';
|
|
|
11
11
|
import { initReactI18next } from 'react-i18next';
|
|
12
12
|
import Logger from './services/logger/Logger';
|
|
13
13
|
import colourDiagnosticsEnglish from './screens/configuration/marty/Diagnostics/ColourSensorDiagnostics/messages';
|
|
14
|
+
import colourCalibrationEnglish from './components/oneoffs/calibration-screens/ColourSensorCalibration/messages';
|
|
14
15
|
var SHOW_LOGS = true;
|
|
15
16
|
var TAG = "i18n";
|
|
16
17
|
var resources = {
|
|
17
18
|
"en": {
|
|
18
19
|
"translation": {
|
|
19
20
|
"colour_diagnostics": colourDiagnosticsEnglish,
|
|
21
|
+
"colour_calibration": colourCalibrationEnglish,
|
|
20
22
|
"activities": {
|
|
21
23
|
"adventure_story_subtitle": "We'll make an interactive narrative adventure!",
|
|
22
24
|
"adventure_story_title": "13. Adventure Story",
|
package/dist-types/src/screens/configuration/marty/Diagnostics/ColourSensorDiagnostics/messages.js
CHANGED
|
@@ -28,6 +28,7 @@ var colourDiagnosticsEnglish = {
|
|
|
28
28
|
storageWarning: "This browser cannot keep a local backup. Download the data before closing this page.",
|
|
29
29
|
sensorDisconnected: "The selected sensor disconnected. Reconnect Marty and select the sensor again.",
|
|
30
30
|
sensorInitialising: "Marty is still loading the sensor settings. Wait a few seconds and try again.",
|
|
31
|
+
calibrationReconnectRequired: "Reconnect Marty to finish calibration before taking more colour snapshots.",
|
|
31
32
|
sensorAsleep: "Marty's sensor power is asleep. Taking a snapshot wakes the sensors before collecting readings.",
|
|
32
33
|
sensorOffline: "The colour sensor is offline. Take a snapshot to wake it. If it stays offline, check the sensor connection.",
|
|
33
34
|
sensorPowerFailed: "Marty's colour sensor did not wake up. No snapshot was saved. Check that Marty is powered on and the sensor is connected, then try again.",
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"source": "Marty web app colour boundaries v3",
|
|
3
|
+
"boundaries": [
|
|
4
|
+
{ "hue": [0, 15], "chroma": [50, 200], "clear": [40, 150], "name": "red" },
|
|
5
|
+
{ "hue": [20, 65], "chroma": [40, 300], "clear": [100, 255], "name": "yellow" },
|
|
6
|
+
{ "hue": [85, 160], "chroma": [5, 100], "clear": [25, 150], "name": "green" },
|
|
7
|
+
{ "hue": [180, 240], "chroma": [40, 230], "clear": [55, 255], "name": "blue" },
|
|
8
|
+
{ "hue": [240, 320], "chroma": [5, 100], "clear": [10, 150], "name": "purple" },
|
|
9
|
+
{ "hue": [345, 361], "chroma": [50, 200], "clear": [40, 150], "name": "red" }
|
|
10
|
+
]
|
|
11
|
+
}
|