agenticros 0.5.6 → 0.5.8

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.
@@ -4,6 +4,8 @@
4
4
  *
5
5
  * Subscribes to CMD_VEL_TOPIC for gaze (left/right turns). Optionally publishes
6
6
  * the same topic from invisible WASD keyboard teleop (disabled with --no-teleop).
7
+ * Plays procedural R2D2 chirps (idle) and excited bursts on active cmd_vel
8
+ * (disabled with --no-sound).
7
9
  *
8
10
  * Env (set by `agenticros eyes` from ~/.agenticros/config.json):
9
11
  * CMD_VEL_TOPIC, MAX_LINEAR_VELOCITY, MAX_ANGULAR_VELOCITY, PORT, …
@@ -16,6 +18,12 @@ import { fileURLToPath } from "url";
16
18
  import { spawn, execFileSync } from "child_process";
17
19
  import { WebSocketServer } from "ws";
18
20
 
21
+ import {
22
+ exciteFromTwist,
23
+ startSoundLoop,
24
+ stopSoundLoop,
25
+ } from "../lib/sounds.js";
26
+
19
27
  const require = createRequire(import.meta.url);
20
28
  let rclnodejs;
21
29
  try {
@@ -41,6 +49,9 @@ const NO_BROWSER = process.argv.includes("--no-browser");
41
49
  const NO_TELEOP =
42
50
  process.argv.includes("--no-teleop") ||
43
51
  process.env.AGENTICROS_EYES_NO_TELEOP === "1";
52
+ const NO_SOUND =
53
+ process.argv.includes("--no-sound") ||
54
+ process.env.AGENTICROS_EYES_NO_SOUND === "1";
44
55
 
45
56
  const MAX_LINEAR = Number(process.env.MAX_LINEAR_VELOCITY || 1.0);
46
57
  const MAX_ANGULAR = Number(process.env.MAX_ANGULAR_VELOCITY || 1.5);
@@ -348,6 +359,9 @@ async function main() {
348
359
  gazeX: state.gazeX,
349
360
  driving: state.driving,
350
361
  });
362
+ if (!NO_SOUND) {
363
+ exciteFromTwist(msg, ANGULAR_DEADZONE);
364
+ }
351
365
  });
352
366
 
353
367
  setInterval(() => {
@@ -377,6 +391,11 @@ async function main() {
377
391
  `(base linear=${TELOP_LINEAR}, angular=${TELOP_ANGULAR})`,
378
392
  );
379
393
  }
394
+ if (NO_SOUND) {
395
+ console.log("R2D2 sounds disabled (--no-sound)");
396
+ } else {
397
+ startSoundLoop();
398
+ }
380
399
  if (!NO_BROWSER) {
381
400
  launchKiosk(url);
382
401
  } else {
@@ -389,6 +408,7 @@ async function main() {
389
408
  const shutdown = async () => {
390
409
  console.log("\nShutting down…");
391
410
  try {
411
+ await stopSoundLoop();
392
412
  publishStop();
393
413
  wss.close();
394
414
  server.close();