Compare commits

..
984 Commits
Author SHA1 Message Date
legop3 4003379dfb update title 2026-05-03 22:03:33 -04:00
legop3 837701eee8 deeper pass 2026-05-02 17:12:38 -04:00
legop3 2f570d92d7 hud stuff 2026-05-02 17:00:06 -04:00
legop3 ba4b6cfc78 pass 1 (broken) 2026-05-02 15:39:38 -04:00
legop3 53cf39e7fb webui optimization 2026-05-02 15:25:01 -04:00
legop3 e8f6fb9654 pverseer rambling at 430am 2026-05-02 04:35:20 -04:00
legop3 0f97382f42 prompand 2026-05-01 23:40:47 -04:00
legop3 03cd8c00dd lidar adjustmints 2026-05-01 23:19:22 -04:00
legop3 df7b933f41 joecraft 2026-05-01 19:52:53 -04:00
legop3 9c287f068a requet fix and ui change 2026-05-01 19:48:04 -04:00
legop3 6280724f6e nvl 2026-05-01 19:38:53 -04:00
legop3 4890b4e5c6 kjf 2026-05-01 19:37:38 -04:00
legop3 6de19c69df gah 2026-05-01 19:35:18 -04:00
legop3 76fc1c02d5 elidarea 2026-05-01 19:32:15 -04:00
legop3 b76405ed46 gh 2026-05-01 18:56:11 -04:00
legop3 2833175fca gah 2026-05-01 18:47:23 -04:00
legop3 fa981ef298 be webel 2026-05-01 18:41:10 -04:00
legop3 7180d3352d guh 2026-05-01 18:37:18 -04:00
legop3 458199ad11 lidar reasons 2026-05-01 18:26:16 -04:00
legop3 3bb16c140e too ocmplicatd 2026-05-01 18:17:56 -04:00
legop3 8550c85106 gah 2026-05-01 18:12:22 -04:00
legop3 244ff572c4 bolobob 2026-05-01 18:05:42 -04:00
legop3 aa530ef67d neatofix 2026-05-01 17:56:27 -04:00
legop3 e92d670f80 brainslug logfile 2026-05-01 17:45:41 -04:00
legop3 c37a7965ff scan after scan after scan 2026-05-01 17:34:48 -04:00
legop3 c01456409d uifix 2026-05-01 17:32:56 -04:00
legop3 b8bcd49473 stupid machine... 2026-05-01 17:29:49 -04:00
legop3 a8dd71193a lidar adjustmentses 2026-05-01 17:25:45 -04:00
legop3 53723e2f1e lidar fixar 2026-05-01 17:17:15 -04:00
legop3 e3e563feee neato lidara 2026-05-01 17:10:00 -04:00
legop3 6523ea7417 betterneato 2026-05-01 02:35:58 -04:00
legop3 02d5d6ca13 trying to 2026-05-01 01:50:35 -04:00
legop3 7e7eb97ff6 whue 2026-05-01 01:32:02 -04:00
legop3 b491d91ec5 community goal? never jnew her 2026-05-01 01:18:21 -04:00
legop3 eefe434607 disable chat_recent 2026-05-01 00:03:21 -04:00
legop3 b2a2296d98 fixes, changes, no more periodic sync. since theres enough activity at this point... 2026-04-30 13:18:19 -04:00
legop3 962d2ae61e oops forgot build 2026-04-30 04:54:55 -04:00
legop3 ff877f04cc making noise 2026-04-30 04:53:42 -04:00
legop3 963499fa8e risk of fling 2 2026-04-30 02:53:22 -04:00
legop3 0ae60ef4f9 discord unregressions 2026-04-30 01:53:11 -04:00
legop3 a3067a06d9 block lift ui during movement 2026-04-30 00:57:20 -04:00
legop3 09c7a0c813 idle and docked make button show 2026-04-29 23:48:17 -04:00
legop3 d7057289ab better improve 2026-04-29 22:47:55 -04:00
legop3 5654702e51 uhufgj 2026-04-29 19:59:59 -04:00
legop3 90e3c9873b gahhf 2026-04-29 19:53:05 -04:00
legop3 da56086b21 jfhdskljh 2026-04-29 19:48:22 -04:00
legop3 40e625793e loggings 2026-04-29 19:44:52 -04:00
legop3 97196ef202 loging 2026-04-29 19:38:33 -04:00
legop3 c31fffec20 glogar 2026-04-29 19:31:51 -04:00
legop3 9e24ed2ddf thelift 2026-04-29 19:25:31 -04:00
legop3 91a3272780 ohyeah 2026-04-29 19:22:21 -04:00
legop3 943fa11f7e the lift.... 2026-04-29 19:13:12 -04:00
legop3 9bf449ca19 awaa 2026-04-29 18:45:41 -04:00
legop3 01a8d044e7 regressing rn 2026-04-29 18:31:02 -04:00
legop3 fed0cab0b8 glorp 2026-04-29 15:54:55 -04:00
legop3 ef5c6fab89 i hate weather 2026-04-29 15:15:15 -04:00
legop3 fcfcdc907a var liberal 2026-04-29 14:55:42 -04:00
legop3 810c465040 stupid 2026-04-29 14:50:18 -04:00
legop3 9be91c22bd snaofhdskljfs 2026-04-29 14:47:17 -04:00
legop3 88acba5e1a ieuyryehj 2026-04-29 14:38:13 -04:00
legop3 d8a01f9b60 khdslfjyufe 2026-04-29 14:30:24 -04:00
legop3 f26735b9e5 flhj 2026-04-29 14:25:28 -04:00
legop3 2e140d1bd5 etkjrh 2026-04-29 14:22:44 -04:00
legop3 b716e40f53 logging 2026-04-29 14:16:38 -04:00
legop3 9b80b0d248 rover sapshot 2026-04-29 14:09:19 -04:00
legop3 5ebf5fa580 frame 2026-04-29 14:03:56 -04:00
legop3 0003338ecd room camera and rover snapshots 2026-04-29 13:58:04 -04:00
legop3 40e55240e4 chatservice 2026-04-29 13:45:19 -04:00
legop3 d7f34af66f replay beroke 2026-04-29 13:35:24 -04:00
legop3 9b9fa13eaf ugh 2026-04-29 13:23:23 -04:00
legop3 bc6770f407 replay 2026-04-29 13:21:44 -04:00
legop3 e2bd29e2c2 splite 2026-04-29 13:12:04 -04:00
legop3 2eafcce95b rah 2026-04-29 13:07:42 -04:00
legop3 c20c22eafc discord bot 2026-04-29 13:01:21 -04:00
legop3 ea3c030a21 homessis 2026-04-28 21:46:00 -04:00
legop3 a4400655c8 praccess 2026-04-28 21:40:05 -04:00
legop3 5036bbfa07 policy 2026-04-28 21:35:31 -04:00
legop3 85db918085 buttonbox 2026-04-28 21:12:16 -04:00
legop3 dba714cc42 af 2026-04-28 21:08:04 -04:00
legop3 ccd502c0f9 audio forward 2026-04-28 21:03:08 -04:00
legop3 d47face038 llm 2026-04-28 20:55:31 -04:00
legop3 b0f62e1cad commentary 2026-04-28 20:49:07 -04:00
legop3 053dfc6396 fixe 2026-04-28 20:39:45 -04:00
legop3 4a3ace007e rmanager 2026-04-28 20:32:15 -04:00
legop3 019147a6ce stupid 2026-04-28 20:12:39 -04:00
legop3 fc229fcf62 data fix 2026-04-28 20:05:56 -04:00
legop3 50f6569b22 mover ranager 2026-04-28 20:03:00 -04:00
legop3 8deee70d4a fixe 2026-04-28 19:58:12 -04:00
legop3 49f801330f gahew 2026-04-28 19:53:10 -04:00
legop3 f13b85109e comments and descriptions 2026-04-28 19:39:13 -04:00
legop3 07ad9ab253 goop converter 2026-04-28 19:31:02 -04:00
legop3 86eb7e628e mappings 2026-04-28 19:17:23 -04:00
legop3 c31408611e mobeil controls 2026-04-28 14:55:12 -04:00
legop3 bff79b5f8c gamepag mapping 2026-04-28 14:49:22 -04:00
legop3 3d809fd91c drivedock 2026-04-28 14:43:34 -04:00
legop3 7b0f7cbc56 admin panel 2026-04-28 14:38:10 -04:00
legop3 7e13d44458 vip audio card 2026-04-28 14:33:39 -04:00
legop3 4dc930f64b videotile 2026-04-28 14:24:58 -04:00
legop3 3a2b8b3557 videotile 2026-04-28 14:22:13 -04:00
legop3 1d6bc24067 spectatro 2026-04-28 14:17:36 -04:00
legop3 13e9ebc909 it begins 2026-04-28 14:02:14 -04:00
legop3 9b59718a37 refactor planning 2026-04-28 13:48:26 -04:00
legop3 1607968cee oips 2026-04-28 13:19:03 -04:00
legop3 b0cd29c075 optional sidebar 2026-04-28 13:13:42 -04:00
legop3 928c1112a1 woah 2026-04-28 04:52:05 -04:00
legop3 83d9cd51de fix wrap 2026-04-28 04:48:20 -04:00
legop3 aaeb173cea titlet 2026-04-28 04:45:07 -04:00
legop3 850b271154 7 2026-04-28 04:42:05 -04:00
legop3 b054b93c96 chatboxe 2026-04-28 04:36:22 -04:00
legop3 630e112733 prevchat 2026-04-28 04:31:21 -04:00
legop3 2439d5df19 gwah 2026-04-28 04:22:44 -04:00
legop3 4bd3094351 chart 2026-04-28 04:15:49 -04:00
legop3 0eb43738cb sidebar 2026-04-28 04:10:39 -04:00
legop3 a0ef334c8c ereplay 2026-04-28 03:56:18 -04:00
legop3 bef54d0f2e ereplay 2026-04-28 03:34:08 -04:00
legop3 c4a80202fc awa 2026-04-28 02:48:49 -04:00
legop3 16ae430090 ugh 2026-04-28 02:43:41 -04:00
legop3 ae24793057 slkfj 2026-04-28 02:38:01 -04:00
legop3 32faa5866d fkjhds 2026-04-28 02:31:52 -04:00
legop3 0e91f38f1e locationong 2026-04-28 02:22:48 -04:00
legop3 1ea5929f79 repalay 2026-04-28 02:17:25 -04:00
legop3 76e966abec wawaw 2026-04-28 02:08:32 -04:00
legop3 07b1e8bd86 gomer 2026-04-28 02:00:14 -04:00
legop3 bdbf3c0138 reapaltle 2026-04-28 01:52:25 -04:00
legop3 286012809f overseer changes 2026-04-27 20:39:53 -04:00
legop3 f743f767a9 awa 2026-04-26 23:45:08 -04:00
legop3 92fde05847 vip tab restyling 2026-04-26 23:23:52 -04:00
legop3 b92034ecab volkswagen 2026-04-26 23:01:36 -04:00
legop3 aa1a115203 neao 2026-04-26 22:57:05 -04:00
legop3 a5705ede2b button arrangement 2026-04-26 22:53:05 -04:00
legop3 ae6d2df0a2 new fefault tilt speed 2026-04-26 21:22:05 -04:00
legop3 7847f5e79c remove status line stuff 2026-04-26 21:17:59 -04:00
legop3 f565d886a8 oopsie 2026-04-26 21:11:25 -04:00
legop3 304c984423 neatp 2026-04-26 21:09:11 -04:00
legop3 c28cb4bb20 guhw 2026-04-26 21:02:30 -04:00
legop3 374d1448ac month 2026-04-26 20:58:05 -04:00
legop3 de3e32e0f0 neat 2026-04-26 20:43:46 -04:00
legop3 47dc4e06af neatoing 2026-04-26 20:40:02 -04:00
legop3 286cc1c62a neeato 2026-04-26 20:32:29 -04:00
legop3 e63eddc314 overcurrent fix? 2026-04-26 13:11:13 -04:00
legop3 ed22c5c393 swap promp 2026-04-26 12:51:14 -04:00
legop3 863c7daafb guh 2026-04-25 20:55:33 -04:00
legop3 3a5c14412d hydraulic brakes 2026-04-25 20:45:54 -04:00
legop3 41bbd7bd98 night vision fix 2026-04-25 20:35:53 -04:00
legop3 1359c701bb smol changess 2026-04-25 20:21:38 -04:00
legop3 e54b8e34ab deter 2026-04-24 21:44:26 -04:00
legop3 f23a0e15c3 npm run build 2026-04-24 20:37:40 -04:00
legop3 0c93aacdf6 button reward updates 2026-04-24 13:19:56 -04:00
legop3 d3f263c216 promp 2026-04-22 14:22:37 -04:00
legop3 9b732429a4 promp 2026-04-22 14:21:18 -04:00
legop3 ff3c5321df promp 2026-04-19 23:04:52 -04:00
legop3 8fd435b3b4 home assistant white light buttons 2026-04-19 21:34:55 -04:00
legop3 73524990af promp 2026-04-19 18:51:59 -04:00
legop3 b46108a750 promp 2026-04-19 16:36:18 -04:00
legop3 adb13fc69c event tweaking 2026-04-19 16:16:20 -04:00
legop3 aee4f61976 promp 2026-04-19 11:50:00 -04:00
legop3 5438873846 event popup!! 2026-04-19 02:56:13 -04:00
legop3 52352bd692 update some reward numbrs 2026-04-19 01:56:13 -04:00
legop3 e974f4f90f update darkness reward 2026-04-19 01:34:04 -04:00
legop3 1bdae74ee5 prmop 2026-04-19 00:43:17 -04:00
legop3 3baf928402 promp 2026-04-19 00:38:40 -04:00
legop3 ee08408ccd promp 2026-04-18 23:54:01 -04:00
legop3 3534c8ef14 fix 2026-04-18 23:30:11 -04:00
legop3 f4182073ee waui 2026-04-18 22:55:16 -04:00
legop3 cd70258a21 goals were toooo smalls 2026-04-18 19:42:12 -04:00
legop3 a4e4921931 no duplicate reward slots 2026-04-18 19:28:40 -04:00
legop3 b76c5010b4 upped the spams 2026-04-18 19:23:27 -04:00
legop3 e5e8e9ed0f ui tweaks 2026-04-18 19:16:46 -04:00
legop3 3513a11068 buttonboxrewardses 2026-04-18 19:11:26 -04:00
legop3 fe8d3df421 prebubtotn 2026-04-18 18:22:42 -04:00
legop3 388efd1f47 promp and buttonbox beginnings 2026-04-18 02:31:30 -04:00
legop3 71e2e18c13 new new new 2026-04-09 19:30:42 -04:00
legop3 6e764f70bc add mode buttons 2026-04-09 18:14:25 -04:00
legop3 214eb47d96 simplifications 2026-04-09 17:47:06 -04:00
legop3 49a50a97ed loggings 2026-04-09 16:57:42 -04:00
legop3 33900e79f6 switch to button 2026-04-09 16:43:46 -04:00
legop3 7aa648240c guh 2026-04-09 16:36:07 -04:00
legop3 353efeeffd add button support 2026-04-09 16:25:48 -04:00
legop3 8ed617305d switch human alert to button 2026-04-09 14:02:54 -04:00
legop3 5e428b278a gordon 2026-04-06 01:17:25 -04:00
legop3 985e63bab2 guhb 2026-04-06 01:01:49 -04:00
legop3 9a83433f08 installer fix 2026-04-06 00:16:30 -04:00
legop3 1e9a6b2e19 opencv 2026-04-06 00:12:00 -04:00
legop3 f72a1628aa gruh 2026-03-27 16:16:56 -04:00
legop3 85fcaedc6a roerd 2026-03-27 16:15:08 -04:00
legop3 c220eb4022 roverquesting 2026-03-27 16:08:04 -04:00
legop3 998933f4c2 ui block fix 2026-03-25 21:56:23 -04:00
legop3 904f28eeef option to disable bumpoff 2026-03-25 21:43:28 -04:00
legop3 d74879caa9 plam 2026-03-25 21:40:24 -04:00
legop3 b0a11541bd gahw 2026-03-25 20:46:51 -04:00
legop3 24d0242364 video invert optional 2026-03-25 16:23:28 -04:00
legop3 af7782a233 Merge pull request #4 from legop3/privaterover
Merge private rover stuff into main
2026-03-25 15:12:18 -04:00
legop3 b32cc7ef8f promp 2026-03-25 12:39:24 -04:00
legop3 766f7130e0 promp 2026-03-25 12:29:37 -04:00
legop3 3127e02f8c promp 2026-03-25 12:27:19 -04:00
legop3 895960867c promp 2026-03-25 01:08:58 -04:00
legop3 3af21846c8 the 2026-03-24 02:48:16 -04:00
legop3 e0167939d7 plam 2026-03-23 23:27:31 -04:00
legop3 ebb400adc4 warae 2026-03-23 03:55:13 -04:00
legop3 463bd89dd8 oips 2026-03-23 03:53:59 -04:00
legop3 e311e67fc9 rewreaer 2026-03-23 03:50:23 -04:00
legop3 20227cd0f8 colorcoding 2026-03-23 03:39:36 -04:00
legop3 ad1b6b48f8 always there fullscreen button 2026-03-23 02:31:59 -04:00
legop3 626b48f777 mobile swappy controls 2026-03-23 02:04:21 -04:00
legop3 f112f74db0 todoing 2026-03-21 01:56:30 -04:00
legop3 cc1e887705 wawea 2026-03-21 01:10:15 -04:00
legop3 81b0638d6f clipfix 2026-03-21 00:56:20 -04:00
legop3 aeb4b29b88 weaw 2026-03-21 00:52:20 -04:00
legop3 54f8684169 yippee!!! 2026-03-21 00:11:27 -04:00
legop3 36a6c07f95 wooo!!!! 2026-03-21 00:06:22 -04:00
legop3 d6da071fde yayy!!! 2026-03-20 23:56:47 -04:00
legop3 9b1251c16d yay! 2026-03-20 23:41:50 -04:00
legop3 e3b428f9ab whipwhep 2026-03-20 23:35:34 -04:00
legop3 cb97e73987 whipwhep 2026-03-20 23:12:09 -04:00
legop3 1b7885e74b whipwhep 2026-03-20 22:52:39 -04:00
legop3 4542c9e6ae whipwhep 2026-03-20 22:52:35 -04:00
legop3 a58685fa91 the removal... 2026-03-20 22:42:59 -04:00
legop3 140ebb5996 todoing 2026-03-20 22:32:23 -04:00
legop3 76c17abdb6 whipwhep 2026-03-20 22:29:54 -04:00
legop3 f364e6ac60 whipwhep 2026-03-20 22:09:59 -04:00
legop3 57532f53d0 whipwhep 2026-03-20 02:25:43 -04:00
legop3 38b76559f4 whipwhep 2026-03-20 02:07:38 -04:00
legop3 1eb1a33e88 whipwhep 2026-03-20 02:06:03 -04:00
legop3 ab9d388392 whipwhep 2026-03-20 02:03:25 -04:00
legop3 cc6e1fde56 whipwhep 2026-03-20 02:00:17 -04:00
legop3 e2d9a1759b whipwhep 2026-03-20 01:56:15 -04:00
legop3 dbfab6aa26 whipwhep 2026-03-20 01:52:45 -04:00
legop3 c729631104 whipwhep 2026-03-20 01:50:29 -04:00
legop3 7ad3dc7015 whipwhep 2026-03-20 01:43:06 -04:00
legop3 5b8704ccb3 gwah 2026-03-17 19:54:53 -04:00
legop3 73ef6261ed ound 2026-03-17 19:46:53 -04:00
legop3 93204ec1f1 wewa 2026-03-17 19:35:36 -04:00
legop3 618fd3e4de remove duration limits 2026-03-17 19:14:13 -04:00
legop3 f5d7d2d82c ui 2026-03-17 19:07:59 -04:00
legop3 7934e1faf5 fix socket size limit 2026-03-17 18:59:39 -04:00
legop3 f63db3fdd7 oddeo 2026-03-17 18:54:31 -04:00
legop3 0e4954fadf audioo 2026-03-17 18:33:27 -04:00
legop3 c44632ed4d error handler 2026-03-17 16:35:53 -04:00
legop3 9f1efc6b91 fix 2026-03-17 03:31:53 -04:00
legop3 ad664f2d32 fix 2026-03-17 03:22:47 -04:00
legop3 fec9782e3b fix 2026-03-17 03:18:02 -04:00
legop3 84eaab3c9c guh 2026-03-17 03:11:04 -04:00
legop3 aaa93847e1 audio 2026-03-16 21:30:56 -04:00
legop3 4aa53e8f80 promp 2026-03-16 01:07:31 -04:00
legop3 74a758ab7c promp 2026-03-15 23:59:23 -04:00
legop3 182a49903f ploo 2026-03-15 23:14:43 -04:00
legop3 941b9889c9 pifix 2026-03-15 23:11:00 -04:00
legop3 6d40ec070e guh 2026-03-15 23:08:05 -04:00
legop3 169ccdbcf8 guh 2026-03-15 23:05:30 -04:00
legop3 a2098f4dfc fix thing 2026-03-15 23:02:17 -04:00
legop3 3070153052 fix thing 2026-03-15 22:57:15 -04:00
legop3 167582b9b0 fix 2026-03-15 22:46:27 -04:00
legop3 95972af558 things 2026-03-15 22:43:05 -04:00
legop3 2ea222355f audioplan 2026-03-13 17:58:28 -04:00
legop3 529ae62ad0 fix ldadmins not getting vip 2026-03-05 03:14:45 -05:00
legop3 3c6de7c040 verifiction 2026-03-05 03:10:26 -05:00
legop3 3007bab54d todoing 2026-03-04 02:55:37 -05:00
legop3 38e23b0adf todoing 2026-03-04 01:21:55 -05:00
legop3 181fe436ff fix keybindingses 2026-03-04 01:21:37 -05:00
legop3 b7f5967c9f todoing 2026-03-04 00:59:49 -05:00
legop3 e53fb5cb92 newtodo 2026-03-03 17:44:49 -05:00
legop3 325fdc05ea Merge branch 'main' of https://github.com/legop3/MultiRoombaRover 2026-03-03 14:28:49 -05:00
legop3 c4532f5825 plannings 2026-03-03 14:26:47 -05:00
legop3 d952b7ad90 Revise tone and output rules in commentary system
Updated tone description and removed redundant rules.
2026-03-02 01:19:39 -05:00
legop3 13da673495 promp 2026-02-28 12:17:27 -05:00
legop3 30d0f0c686 skpi count 2026-02-28 11:56:25 -05:00
legop3 7a21a53ea7 promt 2026-02-28 11:45:19 -05:00
legop3 4fd7f15292 promt 2026-02-28 11:43:00 -05:00
legop3 1350d7c395 promt 2026-02-28 02:13:21 -05:00
legop3 632d474e61 remove goal 2026-02-28 01:16:08 -05:00
legop3 84a0b02c18 promp 2026-02-28 00:56:30 -05:00
legop3 a44d4aed03 SKIP 2026-02-28 00:48:50 -05:00
legop3 fafe167571 promp 2026-02-28 00:44:52 -05:00
legop3 e73b094c21 promp 2026-02-28 00:35:29 -05:00
legop3 23825d51d2 promp 2026-02-27 23:54:53 -05:00
legop3 3cf3228b6f titanfall 2026-02-27 23:39:23 -05:00
legop3 99b10f7310 promp 2026-02-27 23:22:32 -05:00
legop3 ae52dc8335 promp 2026-02-27 22:11:35 -05:00
legop3 7942e61a40 tempchange 2026-02-27 20:05:43 -05:00
legop3 82fe62b835 no blah 2026-02-27 19:14:38 -05:00
legop3 12ce7c1344 add community goal 2026-02-27 19:05:52 -05:00
legop3 469c52cf7f temp reduction 2026-02-27 09:56:52 -05:00
legop3 1ac6c17a8e promp 2026-02-27 02:53:00 -05:00
legop3 231245a9fd promp 2026-02-27 02:41:54 -05:00
legop3 e30f7272cd promp 2026-02-27 02:21:53 -05:00
legop3 08fc278494 promp 2026-02-27 01:33:56 -05:00
legop3 32f5cc29d8 prompt 2026-02-27 01:30:26 -05:00
legop3 985a2f966a cliff improvements 2026-02-27 00:43:45 -05:00
legop3 e9e75b65ef melodrama 2026-02-26 21:06:08 -05:00
legop3 bbd088f9e1 new stuf 2026-02-26 18:57:50 -05:00
legop3 4284014578 soup 2026-02-26 18:06:50 -05:00
legop3 d34c107b1a gwuh 2026-02-26 03:32:31 -05:00
legop3 5a575aeab4 newstufff 2026-02-26 02:58:45 -05:00
legop3 4d953f3cad promt 2026-02-26 02:38:23 -05:00
legop3 09c7da715e loosenmaybe 2026-02-26 02:05:46 -05:00
legop3 9d58983f59 failmodeling 2026-02-26 01:21:42 -05:00
legop3 7afc79add0 promp 2026-02-26 01:08:58 -05:00
legop3 5d3652468f prommpt 2026-02-26 00:46:15 -05:00
legop3 04bedc7e5c remove length limit 2026-02-26 00:25:35 -05:00
legop3 a687d191c1 promptong 2026-02-25 23:04:02 -05:00
legop3 0d3b3b0995 prompt 2026-02-25 17:59:40 -05:00
legop3 65094ea5dc prompt 2026-02-25 17:49:55 -05:00
legop3 643557afc6 promp 2026-02-25 17:43:38 -05:00
legop3 5a7ce8ae69 stat pills for llm status 2026-02-25 17:28:18 -05:00
legop3 7e233e48b2 promptings 2026-02-25 15:50:20 -05:00
legop3 0a65c43eb0 new indicators in web ui for llm stuff 2026-02-25 15:21:54 -05:00
legop3 30671332af newstuf 2026-02-25 13:33:03 -05:00
legop3 20e89839fe new chat style minotiring 2026-02-25 12:57:06 -05:00
legop3 18c0d0fc8d fix log spam 2026-02-25 12:49:33 -05:00
legop3 b22ba216db new system for chat and stuff 2026-02-25 12:47:17 -05:00
legop3 ad31749813 set frequency to 0 (instant skipped or not) 2026-02-25 05:19:42 -05:00
legop3 9e3bce6ec3 tweakes 2026-02-25 05:11:21 -05:00
legop3 6c3ae17aeb prompt 2026-02-25 04:46:51 -05:00
legop3 965a27f3f2 prompt 2026-02-25 04:35:51 -05:00
legop3 2198c64e00 prompt 2026-02-25 04:28:16 -05:00
legop3 1b871a9ad1 adjustment 2026-02-25 04:25:26 -05:00
legop3 27e36206c2 primpr 2026-02-25 04:02:57 -05:00
legop3 6312f19e3c prompt and wheel drops 2026-02-25 03:55:08 -05:00
legop3 112391cbd1 tell it to watch chat 2026-02-25 03:40:18 -05:00
legop3 1f05a7b79c fix formatting 2026-02-25 03:30:36 -05:00
legop3 c5907d8487 prompt 2026-02-25 03:29:54 -05:00
legop3 47f3e7e654 change rover bot to the overseer 2026-02-25 03:23:58 -05:00
legop3 679e901ec6 remove battery stuffs 2026-02-25 02:23:10 -05:00
legop3 4af0deb1dd prompt 2026-02-25 02:13:06 -05:00
legop3 d38503d19c remove prior bot messages from the info 2026-02-25 02:01:34 -05:00
legop3 f7170c6b49 prompt 2026-02-25 00:57:44 -05:00
legop3 62994d07cd prompt 2026-02-25 00:41:13 -05:00
legop3 0af84084c9 tell it to look at chat... 2026-02-25 00:12:30 -05:00
legop3 8c24c84e59 better temps and prompting 2026-02-25 00:08:58 -05:00
legop3 9647a71d49 wara 2026-02-24 23:59:12 -05:00
legop3 315ce61ef7 tweak 2026-02-24 23:44:54 -05:00
legop3 0f31a662ee tiny prompt 2026-02-24 23:42:32 -05:00
legop3 e44d0f7b93 modufy prompt 2026-02-24 23:33:02 -05:00
legop3 49fc19f044 some tweaks 2026-02-24 23:15:31 -05:00
legop3 bb55e90464 remove mentions of skip 2026-02-24 20:16:46 -05:00
legop3 93971f37fe add llm status panel 2026-02-24 20:13:19 -05:00
legop3 46de9b71f3 switch to ollama library 2026-02-24 19:37:38 -05:00
legop3 1d97756aef fixes nameses 2026-02-24 19:31:00 -05:00
legop3 42c885af28 local ollama commentary 2026-02-24 19:03:20 -05:00
legop3 da79a62db6 change some settings defaults 2026-02-21 19:05:13 -05:00
legop3 d3b35506d9 duck fade 2026-02-21 18:59:00 -05:00
legop3 12a787b7c6 guhw 2026-02-21 18:49:31 -05:00
legop3 bf7d54c4f9 brush ducking only ig 2026-02-21 18:45:59 -05:00
legop3 abd337f723 kjfdalshf 2026-02-21 18:20:02 -05:00
legop3 d3a17608af gologle 2026-02-21 18:15:37 -05:00
legop3 ed93bbf4d6 guh 2026-02-21 18:05:19 -05:00
legop3 d2904f067c ploo 2026-02-21 17:52:52 -05:00
legop3 a76062b873 gug 2026-02-21 17:32:16 -05:00
legop3 32ec8e1aa3 ploo 2026-02-21 17:22:38 -05:00
legop3 657189e979 wuh 2026-02-21 13:40:02 -05:00
legop3 cc92174d79 wa 2026-02-21 13:35:28 -05:00
legop3 eefe6f01bb gawa 2026-02-21 13:30:46 -05:00
legop3 4ccc7dfae6 audio debug 2026-02-21 13:21:44 -05:00
legop3 8313f5da66 chrome fix maybe? 2026-02-21 13:14:27 -05:00
legop3 d5978c5e3e agressive compressive 2026-02-18 22:21:41 -05:00
legop3 f1c6ab44ce maybe finally fix double audio 2026-02-18 22:02:32 -05:00
legop3 d165f69b6f fixes 2026-02-18 21:54:16 -05:00
legop3 438fff0902 volume stuff 2026-02-18 21:39:34 -05:00
legop3 7e772ab607 server reboot too 2026-02-18 15:13:38 -05:00
legop3 40e21d4ac5 add reboot command 2026-02-18 15:09:36 -05:00
legop3 eb52c8c6ac oopeies 2026-02-11 17:16:36 -05:00
legop3 1e1a6b6b01 new battery bars!!! 2026-02-11 17:05:30 -05:00
legop3 dcf7208c08 docs stub 2026-02-11 02:32:38 -05:00
legop3 0c3b3aa711 update colors of social buttons 2026-02-10 20:26:17 -05:00
legop3 42c99410f4 new socials buttons and stuffses 2026-02-10 20:02:55 -05:00
legop3 1ac46f4a03 switch back to css anim 2026-02-10 13:42:23 -05:00
legop3 8ea0f7be70 better side brush animation 2026-02-10 13:36:47 -05:00
legop3 0c992e2457 auto sidebrush 2026-02-10 13:18:29 -05:00
legop3 1842177a6d longer bumpening 2026-02-08 17:02:55 -05:00
legop3 c9a19d46f7 drive macro dock bumpoff 2026-02-08 16:59:25 -05:00
legop3 cf0c12cff7 map hud adjustment for mobile 2026-02-02 11:20:53 -05:00
legop3 b4c122d914 dock drive action and joystick tweaks 2026-01-31 22:00:09 -05:00
legop3 3cfb2683ef a few tweaks to dock drive action 2026-01-31 21:44:01 -05:00
legop3 cb5e5ae755 helpp 2026-01-31 21:26:09 -05:00
legop3 d3852dd86b longer horn allowance 2026-01-31 21:20:19 -05:00
legop3 7c1b290df3 swap stuff around because of how stupid safari is i hate apple i hate apple i hate apple 2026-01-31 21:01:23 -05:00
legop3 133b433255 more organized backend and better mobile control columns 2026-01-31 20:49:14 -05:00
legop3 d64e99b674 more adjustment 2026-01-31 16:30:50 -05:00
legop3 79da247dbe short tap fix 2026-01-31 16:29:36 -05:00
legop3 01cad4515f adjustmet 2026-01-31 16:25:59 -05:00
legop3 dc92785f19 gahwah 2026-01-31 16:22:45 -05:00
legop3 00d1edd11b horn cooldown adjustments 2026-01-31 16:16:26 -05:00
legop3 c24ae71e63 horn limits and such 2026-01-31 16:11:24 -05:00
legop3 92c9ae4834 sine and saw volumes 2026-01-31 15:45:36 -05:00
legop3 5916520b1a horn button light up 2026-01-31 15:37:46 -05:00
legop3 7eeb9d13e4 ui 2026-01-31 15:34:38 -05:00
legop3 3fdb1c05e5 ui improvements 2026-01-31 15:32:08 -05:00
legop3 090d9d6982 horn updates 2026-01-31 15:18:25 -05:00
legop3 b7d636c70a horn pass 2026-01-31 13:44:35 -05:00
legop3 92ab763b27 sawtooth wave 2026-01-31 12:30:21 -05:00
legop3 43dc3df901 hornn testingg 2026-01-31 12:23:53 -05:00
legop3 3997127e5e resize batt in sbs 2026-01-30 23:30:47 -05:00
legop3 c60cae75a4 poosh 2026-01-30 23:01:04 -05:00
legop3 4f6530badf just show em all, all the time 2026-01-30 22:58:10 -05:00
legop3 fd06f23de4 feex 2026-01-30 22:37:39 -05:00
legop3 ca3d95319d mini video prewarm :3 2026-01-30 22:31:40 -05:00
legop3 bdb4f41e93 local spectators get real video maybe if it works 2026-01-30 21:53:02 -05:00
legop3 a5f33c0a92 updated /mini again.. 2026-01-30 21:32:17 -05:00
legop3 a4d6f55576 remove updatedAt from UI 2026-01-29 13:25:58 -05:00
legop3 7216d9ba51 admin reason!! 2026-01-29 13:24:07 -05:00
legop3 be4c6260ae /mini simplifications (was too big) 2026-01-29 12:58:58 -05:00
legop3 5e94fc7283 /mini new (again) 2026-01-28 21:52:41 -05:00
legop3 bf05d07092 gamepad rate lmiit 2026-01-28 17:00:19 -05:00
legop3 c5ae78dcab finally... button.. 2026-01-28 14:36:47 -05:00
legop3 33d329e2de moving things 2026-01-28 14:32:09 -05:00
legop3 690f38972f even more betterer button 2026-01-28 14:28:52 -05:00
legop3 77b5484381 betterer button 2026-01-28 14:25:33 -05:00
legop3 ccf0eeb1aa better button 2026-01-28 14:22:29 -05:00
legop3 d87ec55802 gwuh 2026-01-28 14:16:06 -05:00
legop3 2cc0ce962f spam fix 2026-01-28 14:11:44 -05:00
legop3 d2722e40cc ui fixes 2026-01-28 14:09:09 -05:00
legop3 ae81f8914f ugh 2026-01-28 13:59:29 -05:00
legop3 7e850dab22 stateful night vision rework 2026-01-28 13:45:01 -05:00
legop3 f3cc73f178 light panel adjustments 2026-01-27 20:08:04 -05:00
legop3 eea1774549 color light support in HA panel 2026-01-27 19:29:06 -05:00
legop3 7dbb657dcd 5s autocharge to match ui... 2026-01-27 17:19:07 -05:00
legop3 48e4ddd090 ug 2026-01-26 19:53:19 -05:00
legop3 f7677a443a carphone 2026-01-26 19:49:45 -05:00
legop3 482e7c1e6b camera servo speed limit 2026-01-26 19:45:14 -05:00
legop3 b275d5a08c chat on spectator page 2026-01-26 14:10:13 -05:00
legop3 2062b4888c wawa 2026-01-26 01:03:09 -05:00
legop3 2671247347 tts passthrough for all in queue 2026-01-25 23:45:18 -05:00
legop3 3f34196418 better dockdrive info labels 2026-01-25 20:44:50 -05:00
legop3 689d914b4e gamepad ripout 2026-01-25 17:15:57 -05:00
legop3 b6b1bee1dd more tweakings 2026-01-25 03:18:50 -05:00
legop3 522ec335bf bar fit screen 2026-01-25 03:03:16 -05:00
legop3 b730c98704 taller bar, move user list 2026-01-25 03:01:16 -05:00
legop3 d7833dbba9 spectator tweakings 2026-01-25 02:59:16 -05:00
legop3 536e4fe32e new /mini stuff 2026-01-24 23:54:52 -05:00
legop3 2494f6e276 lockdown fixes 2026-01-24 23:40:22 -05:00
legop3 2dda137855 centered hud for your brain 2026-01-24 03:06:29 -05:00
legop3 8341328b51 round. . . ? 2026-01-24 02:58:36 -05:00
legop3 b718de1e88 better DRD (dead rover detection) 2026-01-23 16:46:09 -05:00
legop3 ec4e969340 disconnected reboot timer for pi 2026-01-23 16:42:13 -05:00
legop3 dd55514cb4 ws keepalive (brownout mitigation) 2026-01-23 16:32:20 -05:00
legop3 ba4cf80f41 admin logs for IP stuff 2026-01-23 02:59:25 -05:00
legop3 622cd2875c no more ips in session data 2026-01-23 02:16:37 -05:00
legop3 98ca2e0626 ip list (testing) 2026-01-22 22:48:31 -05:00
legop3 dbc5111c53 chat typing and classic typing beeps 2026-01-22 04:18:55 -05:00
legop3 c30325afc0 adjustmentos 2026-01-22 01:10:09 -05:00
legop3 12512b8856 new discord bot stuff 2026-01-21 23:19:46 -05:00
legop3 bb3197ca67 gsw 2026-01-21 14:47:00 -05:00
legop3 0b1551cabf wg 2026-01-21 14:43:47 -05:00
legop3 69198a5556 guh 2026-01-21 14:41:42 -05:00
legop3 f3a5e7bf77 bar fix 2026-01-21 14:35:46 -05:00
legop3 d2acd9f19a gwah 2026-01-21 14:31:12 -05:00
legop3 94c3939671 stupid 2026-01-21 14:27:29 -05:00
legop3 f7de6d52be wawa 2026-01-21 14:24:51 -05:00
legop3 fff07ffbe6 garbage 2026-01-21 14:16:41 -05:00
legop3 9c046cc3b1 wah 2026-01-21 14:11:12 -05:00
legop3 c465c03e34 useless 2026-01-21 14:08:42 -05:00
legop3 99a1c5418d gah 2026-01-21 14:04:14 -05:00
legop3 2fc9becc88 wag 2026-01-21 13:52:27 -05:00
legop3 fe94c38963 let song commands through 2026-01-21 13:47:29 -05:00
legop3 55c72e0d9b wawa 2026-01-21 13:44:10 -05:00
legop3 a237d32d58 gah 2026-01-21 13:40:07 -05:00
legop3 213630cb68 this better work 2026-01-21 13:36:01 -05:00
legop3 eb85b85b8f ugh 2026-01-21 13:28:51 -05:00
legop3 0600b8552c ugh 2026-01-21 13:18:32 -05:00
legop3 662efb300b wawa 2026-01-21 13:15:07 -05:00
legop3 e2f94720ec arrg 2026-01-21 13:13:08 -05:00
legop3 bcfb2946cf wawah 2026-01-21 13:06:32 -05:00
legop3 02603aa664 waw awa.. 2026-01-21 13:03:39 -05:00
legop3 c67c3dc761 oops 2026-01-21 12:58:01 -05:00
legop3 26d7335c9a ocl in hud 2026-01-21 12:53:07 -05:00
legop3 a99e6e5286 very fast recovery? 2026-01-21 12:40:38 -05:00
legop3 d93d78cb2b tuning 2026-01-21 12:38:38 -05:00
legop3 e01878dd4e ignoore 2026-01-21 12:27:09 -05:00
legop3 598f353fe5 now with Obscenity 2026-01-21 12:25:31 -05:00
legop3 7249621ebe ?ploooooo 2026-01-21 03:15:24 -05:00
legop3 6009056edd ?plooooo 2026-01-21 03:08:37 -05:00
legop3 fd7b858395 ?ploooo 2026-01-21 03:03:00 -05:00
legop3 1fd0de5b1e ?plooo 2026-01-21 03:01:29 -05:00
legop3 720a010973 ?ploo 2026-01-21 02:58:04 -05:00
legop3 2564a451b5 different maths 2026-01-21 02:53:18 -05:00
legop3 8326898403 output rate limit and override gating 2026-01-21 02:38:37 -05:00
legop3 e0edbcfb28 tweaking times 2026-01-21 02:25:28 -05:00
legop3 4f60248bc6 pairs 2026-01-21 02:23:43 -05:00
legop3 629d979b67 timing adjustments 2026-01-21 02:16:24 -05:00
legop3 59c19f1da9 overcurrent limiter testing 2026-01-21 02:12:54 -05:00
legop3 b9a007bd48 big ui sweep. combined queue and roster. 2026-01-20 14:25:48 -05:00
legop3 850ac3ec15 remove bad from telemetry panel 2026-01-20 01:26:32 -05:00
legop3 87dd9a24a0 moving things around 2026-01-20 01:18:13 -05:00
legop3 bdcb488988 the dreaded control gate... 2026-01-19 10:21:54 -05:00
legop3 9e6053d5c0 oops, camera slider 2026-01-19 03:05:17 -05:00
legop3 4d699e1c4c 4:3 UI switchover 2026-01-19 03:00:47 -05:00
legop3 5e7581c82d 640x480 2026-01-19 00:13:08 -05:00
legop3 f7e4269959 hardcode 1296:972 2026-01-18 23:43:56 -05:00
legop3 f3f1db1398 no more video env garbage 2026-01-18 23:08:17 -05:00
legop3 133c061ee9 update video publisher 2026-01-18 22:59:35 -05:00
legop3 6859a6c048 smaller alert scale 2026-01-18 16:19:43 -05:00
legop3 465bddb9dd larger labels 2026-01-18 16:17:25 -05:00
legop3 c7a639a568 /mini and chat improvements 2026-01-18 16:15:41 -05:00
legop3 df952b27e0 gouo 2026-01-18 13:05:32 -05:00
legop3 36f28a9708 add discord button to turns waiting HUD 2026-01-18 12:34:00 -05:00
legop3 2975d394b6 image size averages 2026-01-17 18:35:04 -05:00
legop3 befcf7ad5a ignore!! 2026-01-16 16:05:06 -05:00
legop3 27ae3bcd1e ugh 2026-01-16 16:04:48 -05:00
legop3 90fd0262c7 community goal system 2026-01-16 16:02:56 -05:00
legop3 64a9dd3583 removing chat filters 2026-01-16 02:52:54 -05:00
legop3 972942e497 no more double YOU 2026-01-15 18:56:35 -05:00
legop3 e34d838d41 better big button 2026-01-15 18:43:46 -05:00
legop3 705b38ea7b big loud turn indicators 2026-01-15 18:25:33 -05:00
legop3 f129449d5a tiny toasts! 2026-01-15 17:44:26 -05:00
legop3 d4ce6e9092 random food word nicknames! 2026-01-15 17:26:31 -05:00
legop3 2252527d89 tts fix for chat in hud 2026-01-15 14:47:32 -05:00
legop3 d184590bf2 new chat layout and stuff 2026-01-15 14:43:55 -05:00
legop3 5b9167ab2a give up for now 2026-01-15 12:23:03 -05:00
legop3 655fed4326 ugh 2026-01-15 12:15:51 -05:00
legop3 6c01087738 pigpiod is only on ipv6? 2026-01-15 12:06:22 -05:00
legop3 d272a33dc2 roverd race fix 2026-01-15 12:01:45 -05:00
legop3 8212a14ea8 websocket / polling toggle 2026-01-15 11:35:14 -05:00
legop3 9622129c73 conn status in admin panel 2026-01-15 03:02:55 -05:00
legop3 37927d82af chat history, better turn queue updates 2026-01-15 02:55:46 -05:00
legop3 23fe03ca54 camera 0 to drive macro 2026-01-14 20:15:20 -05:00
legop3 899e647a9d socket log in admin panel 2026-01-13 20:35:45 -05:00
legop3 cab4dc716d replay feedback 2026-01-13 20:28:33 -05:00
legop3 5caf26bb2d update ui layout 2026-01-13 20:24:00 -05:00
legop3 e666b4c195 health service and panel 2026-01-13 20:16:11 -05:00
legop3 c2ca951fe8 better camera snapshot service 2026-01-13 19:57:29 -05:00
legop3 399c077c7a replay panel tweaking 2026-01-13 19:24:25 -05:00
legop3 b8a4a18455 overwrite 2026-01-13 19:15:19 -05:00
legop3 3aedaa26c8 log 2026-01-13 19:12:18 -05:00
legop3 a6e7e683ba wawa 2026-01-13 19:08:51 -05:00
legop3 27c46b44b2 wuh 2026-01-13 19:01:25 -05:00
legop3 5fdcb233f8 rover snapshots in server 2026-01-13 18:54:30 -05:00
legop3 b7a79b03c9 ugh 2026-01-13 18:37:27 -05:00
legop3 fb00467106 g 2026-01-13 18:34:46 -05:00
legop3 32f9a2befc ugh 2026-01-13 18:24:43 -05:00
legop3 e10e2f9a0b update 2026-01-13 17:56:01 -05:00
legop3 8b0928f428 update room cam 2026-01-13 17:43:56 -05:00
legop3 f3e13f6ab7 lets see . . . 2026-01-13 17:21:32 -05:00
legop3 4ab6bad1b8 wah! 2026-01-13 02:16:22 -05:00
legop3 b4754b1c54 wwah 2026-01-13 02:10:21 -05:00
legop3 9aad7ff775 srt read bypass 2026-01-13 02:06:19 -05:00
legop3 c3a9ea7281 ugh 2026-01-13 02:03:57 -05:00
legop3 ba652005f5 auth bypass for local srt 2026-01-13 01:58:10 -05:00
legop3 a49a090026 change snapshot dir 2026-01-13 01:52:19 -05:00
legop3 c265121335 low quality preview for non-drivers 2026-01-13 01:45:15 -05:00
legop3 56b89b5dff rainbet 2026-01-12 19:22:49 -05:00
legop3 00f97c8005 update ignore 2026-01-12 01:22:34 -05:00
legop3 d8ce85be60 oops 2026-01-12 01:21:44 -05:00
legop3 3b67e81451 use webhooks 2026-01-12 01:19:58 -05:00
legop3 870fdc63be update chat message component 2026-01-12 00:26:40 -05:00
legop3 5ae0b0ca79 better discord chat bridging 2026-01-11 17:44:02 -05:00
legop3 778543dd5c autodock is useful after all 2026-01-09 15:16:00 -05:00
legop3 29154c56e6 idle autodock, alerts on spectator and mini pages 2026-01-09 15:06:44 -05:00
legop3 50d3977814 keyboard light controls 2026-01-08 23:44:36 -05:00
legop3 acebcd7307 new alert service colors 2026-01-08 22:44:31 -05:00
legop3 55782dabf0 dock bump protection improvements 2026-01-08 22:18:29 -05:00
legop3 79c118bc88 faster backup 2026-01-08 21:38:14 -05:00
legop3 173d6fffa7 dock bump prevention 2026-01-08 21:35:47 -05:00
legop3 cf072ef0e0 oooops... 2026-01-08 21:13:25 -05:00
legop3 30ebd05a97 topdownmod 2026-01-08 21:12:30 -05:00
legop3 d3f2f15370 updated mobile page 2026-01-08 20:32:47 -05:00
legop3 008cf96c7e dont fix it 2026-01-08 19:54:47 -05:00
legop3 981262a0ae ts alone only 2026-01-08 19:25:01 -05:00
legop3 b884f23b13 ts command :3 2026-01-07 23:06:55 -05:00
legop3 dc9f93ca60 made mobile HUD smaller 2026-01-07 22:46:17 -05:00
legop3 4005ced6f9 tweaks and padding fix 2026-01-07 21:57:57 -05:00
legop3 f7dd4f7b89 remove queue mentions from embed service 2026-01-07 21:50:53 -05:00
legop3 4b7c26a7b4 change to roomba rover 2026-01-07 21:32:46 -05:00
legop3 7335cefffb dynamic http embeds, kofi button, etc 2026-01-07 21:28:21 -05:00
legop3 aba01161c9 remove type badge from light controls 2026-01-06 20:56:27 -05:00
legop3 b4edf72c9a fix ffmpeg error 2026-01-04 13:14:32 -05:00
legop3 066f976cf4 replay overhaul 2026-01-04 13:08:23 -05:00
legop3 2f726035c9 video was too bigs 2026-01-03 23:26:47 -05:00
legop3 5b8fb30e71 adjust timings 2026-01-03 22:05:37 -05:00
legop3 eb4e1621c0 tpms 2026-01-03 21:58:08 -05:00
legop3 6d55073bfb replay in web UI 2026-01-03 21:38:19 -05:00
legop3 242fe461d9 replay use mp4 instead of gif 2026-01-03 21:19:07 -05:00
legop3 fcc71426ee oops 2026-01-03 21:11:27 -05:00
legop3 4e30eb1d52 pallete gen ffmpeg 2026-01-03 21:01:21 -05:00
legop3 e0cadb493f replay capture ? 2026-01-03 20:53:38 -05:00
legop3 bbb4014f61 everyone can status! 2026-01-03 20:02:49 -05:00
legop3 3c1c75a2ec change to ma 2026-01-03 15:15:45 -05:00
legop3 c4dda507e2 add server mode to bot status 2026-01-03 15:13:39 -05:00
legop3 56ed528412 rs status shortcut 2026-01-03 15:00:27 -05:00
legop3 258f244194 more bot stuff 2026-01-03 12:39:26 -05:00
legop3 ec0e1564d7 changed discord bot stuff 2026-01-03 12:29:47 -05:00
legop3 4f2907a105 monch 2025-12-30 13:13:56 -05:00
legop3 5829cd370c web ui fixes and tweaks 2025-12-29 18:27:15 -05:00
legop3 5ef6b640c6 turn up cam quality 2025-12-29 17:41:14 -05:00
legop3 ff638d84d2 the old fashioned bars are back 2025-12-28 00:47:18 -05:00
legop3 061d4d4689 bumping bumpers :3 2025-12-28 00:22:44 -05:00
legop3 3cc12b76b9 new top down stuff 2025-12-28 00:06:24 -05:00
legop3 1241c867a5 oops 2025-12-27 04:45:34 -05:00
legop3 8b3806bcd5 no more hud! (keep the telem stuff tho) 2025-12-27 04:45:22 -05:00
legop3 eeb4e65df7 tweak 2025-12-27 04:43:05 -05:00
legop3 b714bd0fed tweak 2025-12-27 04:41:02 -05:00
legop3 a989f2029a tweak 2025-12-27 04:39:07 -05:00
legop3 ca1f7ef54a tweak 2025-12-27 04:37:15 -05:00
legop3 87db66ac1f tweak 2025-12-27 04:27:14 -05:00
legop3 8da2196ee0 tweak 2025-12-27 04:20:26 -05:00
legop3 49d822d468 tweak 2025-12-27 04:14:33 -05:00
legop3 fd765ec1da tweak 2025-12-27 04:12:02 -05:00
legop3 086d3cdee2 tweak 2025-12-27 04:09:12 -05:00
legop3 83f6f7eac1 tweak 2025-12-27 04:05:44 -05:00
legop3 3df303bc09 tweak 2025-12-27 04:02:51 -05:00
legop3 94a779581b tweak 2025-12-27 03:52:42 -05:00
legop3 c87767d3ee tweak 2025-12-27 03:50:33 -05:00
legop3 6ca30adcaf tweak 2025-12-27 03:47:31 -05:00
legop3 588305184e tweak 2025-12-27 03:35:52 -05:00
legop3 293b73dc20 tweak 2025-12-27 03:26:56 -05:00
legop3 d4440a4f05 tweak 2025-12-27 03:24:16 -05:00
legop3 3349120c0d tweak 2025-12-26 23:27:37 -05:00
legop3 bd862bf3f2 tweak 2025-12-26 23:19:55 -05:00
legop3 1a6ca5ce73 tweak 2025-12-26 23:09:40 -05:00
legop3 9ea29f8e36 dock assist HUD 2025-12-26 23:05:25 -05:00
legop3 b9d7a62b0e new dock / drive / docking buttons and dialog 2025-12-26 20:04:21 -05:00
legop3 6301058f87 persist tts settings 2025-12-25 21:27:19 -05:00
legop3 8e1de78cc7 seek dock when disconnected for 1 minute 2025-12-24 17:06:27 -05:00
legop3 0b564c7ee7 battery manager fix and stop rovers when we should 2025-12-24 16:58:06 -05:00
legop3 195ecb7d61 spectator reconnects and stuff 2025-12-23 22:27:35 -05:00
legop3 108de883a0 hopefully fix battery locking 2025-12-22 20:14:03 -05:00
legop3 01df853592 fix audio player stuff 2025-12-22 19:47:48 -05:00
legop3 020ddfea07 keyboard camerea tilt slider 2025-12-22 18:55:19 -05:00
legop3 b4a5633bd4 wug 2025-12-22 01:03:37 -05:00
legop3 f579516d64 box my letter my 2025-12-22 01:01:41 -05:00
legop3 6f887b00f1 letter my box MORE 2025-12-22 00:56:16 -05:00
legop3 0ce6c05e05 letter my box 2025-12-22 00:50:51 -05:00
legop3 fe9f1c13e2 route for mini 2025-12-22 00:39:39 -05:00
legop3 e3874b6237 mini viewer!! 2025-12-22 00:37:47 -05:00
legop3 e0a64e828e plane 2025-12-21 23:51:46 -05:00
legop3 a8fb23287c maked it betters 2025-12-21 16:13:22 -05:00
legop3 ed9bb3216c top-down in spectator 2025-12-21 16:08:34 -05:00
legop3 1b013ed91b thing in HUD 2025-12-21 15:42:01 -05:00
legop3 8e01dcaabd git pull 2025-12-21 14:50:33 -05:00
legop3 0836afc0c0 wagh 2025-12-21 14:40:06 -05:00
legop3 8296278e1c giihlkjsadf 2025-12-21 14:31:57 -05:00
legop3 6028e275da leave me alone 2025-12-21 14:21:32 -05:00
legop3 314b88b146 leave me alone 2025-12-21 14:20:56 -05:00
legop3 de4295caf1 wuh 2025-12-21 14:08:09 -05:00
legop3 c5e66b3ec5 guh 2025-12-21 14:07:34 -05:00
legop3 aba5efcf40 adjust labels 2025-12-21 14:03:34 -05:00
legop3 e69fd18256 moveing stuffs arounds 2025-12-21 13:47:13 -05:00
legop3 0be105e9dd spin 2025-12-21 06:01:22 -05:00
legop3 a1fef27a59 ugh 2025-12-21 05:52:35 -05:00
legop3 77ec19a4d6 spinfix?urhfk 2025-12-21 05:48:43 -05:00
legop3 d4d6f0674d satureate my oiter 2025-12-21 05:33:21 -05:00
legop3 e334246cef 100 2025-12-21 05:29:58 -05:00
legop3 81a8c35873 hue my oiter 2025-12-21 05:28:00 -05:00
legop3 9c3dbfebcb top-down roomba view!!! finally!! 2025-12-21 05:20:46 -05:00
legop3 cd9e82938b faster sensors 2025-12-21 03:55:55 -05:00
legop3 0fb6ea49b3 no more room controls tab 2025-12-21 02:54:58 -05:00
legop3 a3dae83bf7 NO MORE PURPLEE 2025-12-21 02:38:21 -05:00
legop3 1bd486a6c0 no asterisks allowed in nicknames 2025-12-20 23:56:03 -05:00
legop3 b965f7b561 blueberries 2025-12-20 00:20:11 -05:00
legop3 45aef7339e let everyone on a rover use tts 2025-12-18 15:01:40 -05:00
legop3 fb7ecec17e puddle 2025-12-17 01:33:31 -05:00
legop3 7b29d741b0 ugh.. 2025-12-17 01:13:38 -05:00
legop3 67f4f014c4 ugh 2025-12-17 01:06:09 -05:00
legop3 c42d314cc9 woah 2025-12-17 00:53:55 -05:00
legop3 102192c631 fast 2025-12-17 00:19:23 -05:00
legop3 cfe9055cb7 tweaking sensor recovery 2025-12-16 22:31:21 -05:00
legop3 501bc234ee better sensor recovery 2025-12-12 22:50:04 -05:00
legop3 c07e5971f5 auto sensor restart 2025-12-12 22:45:19 -05:00
legop3 bbdecc324a stop people from switching to locked rovers... 2025-12-08 18:09:27 -05:00
legop3 8b59d021d3 slow down beeping 2025-12-08 14:20:47 -05:00
legop3 3221dbe877 hopefully fix mobile chat UI a little 2025-12-08 14:10:05 -05:00
legop3 57d4b5a415 shorter beeps 2025-12-08 14:03:38 -05:00
legop3 6580de08d4 set default tab to help. add beep keys. 2025-12-08 13:57:27 -05:00
legop3 161929e280 allow everyone to switch rovers conditionally 2025-12-08 03:50:36 -05:00
legop3 e9fd5f55a8 more 2025-12-08 03:22:34 -05:00
legop3 ae1c92a0ce more 2025-12-08 02:35:09 -05:00
legop3 127eb446ed volume down 2025-12-08 02:26:06 -05:00
legop3 66824240d8 TURN IT DOWN 2025-12-08 01:25:10 -05:00
legop3 115ecad9a6 log on invert 2025-12-07 20:50:49 -05:00
legop3 d857668109 invert servo option 2025-12-07 20:41:15 -05:00
legop3 b72c58452e keyboard speed controls 2025-12-06 01:07:01 -05:00
legop3 2b1122dce9 fix "dont show again" 2025-12-05 00:08:40 -05:00
legop3 9f0bb8bd24 new help system!! 2025-12-04 23:50:44 -05:00
legop3 edeac5e6ff new help planning 2025-12-04 03:12:13 -05:00
legop3 e0312c3fbb gahwa 2025-12-03 00:48:25 -05:00
legop3 e94a52d7fd increase mic volume MORE!!! 2025-12-02 15:10:36 -05:00
legop3 ace39d5a70 gowuh 2025-12-02 14:43:56 -05:00
legop3 9bc5d2d06d night vision toggle LED 2025-12-02 14:24:17 -05:00
legop3 57575f7199 slower room cams. . . 2025-12-02 12:42:46 -05:00
legop3 2ad71a51c7 mooore lowerr 2025-12-02 12:40:40 -05:00
legop3 9dd17929df push? 2025-12-02 12:33:23 -05:00
legop3 543c2b452e lower even more 2025-12-02 12:32:15 -05:00
legop3 a65e80c82a lower jpeg quality 2025-12-02 12:29:19 -05:00
legop3 185a826387 Merge pull request #3 from legop3/jpeg-roomcam
Jpeg roomcam
2025-12-02 00:49:13 -05:00
legop3 40d6ca9bf0 okayy.. 2025-12-02 00:32:52 -05:00
legop3 c129f38e6b okay, ws AND polling... 2025-12-02 00:30:33 -05:00
legop3 0da5d72d91 try websockets only... 2025-12-02 00:29:31 -05:00
legop3 1c4b9b8c3d bleehhh 2025-12-02 00:25:00 -05:00
legop3 c94abeca07 2fps 2025-12-01 23:51:10 -05:00
legop3 f14aea2070 oh no 2025-12-01 23:48:48 -05:00
legop3 1d664cbe4c wuh 2025-12-01 23:45:44 -05:00
legop3 2b2b6cbb60 the great simplification 2025-12-01 23:28:12 -05:00
legop3 c7b16d6ddd salt detected 2025-12-01 23:06:02 -05:00
legop3 d068f07c4b this is how it should have been... 2025-12-01 23:02:59 -05:00
legop3 d9d8d44013 auh 2025-12-01 23:01:07 -05:00
legop3 335fa4e21d AAAHHHJ RATE LIMITTT 2025-12-01 22:56:06 -05:00
legop3 29bb16ba1a wuh 2025-12-01 22:46:50 -05:00
legop3 4d57e679bf add optional bayerer 2025-12-01 22:28:33 -05:00
legop3 7a36d988ba uuhpdate 2025-12-01 22:15:42 -05:00
legop3 56eba166f7 new room cam service 2025-12-01 22:13:56 -05:00
legop3 7f84a5eadf ogger 2025-12-01 22:03:14 -05:00
legop3 d8c3d8bb02 build webui. . . 2025-12-01 22:00:29 -05:00
legop3 62ab8539c6 jpeg roomcams first pass 2025-12-01 21:57:16 -05:00
legop3 42533bf63c room cam rework planning 2025-12-01 21:35:49 -05:00
legop3 e6009c2d92 volummeee!! 2025-12-01 21:26:31 -05:00
legop3 fb76ecd512 change default brc pin 2025-12-01 21:19:47 -05:00
legop3 9be4a4e180 newlnes for bobis 2025-11-30 03:42:53 -05:00
legop3 d7b42acced bild 2025-11-30 03:28:48 -05:00
legop3 1003101976 move stuff round 2025-11-30 03:27:03 -05:00
legop3 c29d076f26 visceral... 2025-11-30 03:15:27 -05:00
legop3 757684f383 planning 2025-11-30 02:55:59 -05:00
legop3 4321e15323 turn it up more..., 2025-11-29 23:25:12 -05:00
legop3 7389a98f8b remove old audio stuff and turn up mic 2025-11-29 23:20:09 -05:00
legop3 447b00c3cd nope 2025-11-29 23:13:13 -05:00
legop3 305becec38 wuh 2025-11-29 23:06:57 -05:00
legop3 12ba219773 remove logging 2025-11-29 22:52:08 -05:00
legop3 063afff53b ahh!! 2025-11-29 22:51:29 -05:00
legop3 0093c97873 ugh 2025-11-29 22:27:59 -05:00
legop3 a29753ef86 low voltage anode... 2025-11-29 22:24:57 -05:00
legop3 02b72cbce7 high voltage anode 2025-11-29 22:20:37 -05:00
legop3 e6e6327165 not gonna fix it but okay 2025-11-29 22:17:49 -05:00
legop3 a343c5d1e2 simplification 2025-11-29 22:12:26 -05:00
legop3 44d1920e2b guhw 2025-11-29 21:40:59 -05:00
legop3 5ad75aa465 wuhg 2025-11-29 21:34:31 -05:00
legop3 b5e44100a2 add logging 2025-11-29 21:29:11 -05:00
legop3 f6a57b788a here goes nothin 2025-11-29 21:24:18 -05:00
legop3 d00b2cf160 good old video publisher (hopefully) 2025-11-29 20:53:43 -05:00
legop3 c7c6595942 separate audio stream 2025-11-29 20:48:34 -05:00
legop3 d715c4fa54 caklkf 2025-11-29 20:02:05 -05:00
legop3 1480fcc8c1 overrun 2025-11-29 19:30:18 -05:00
legop3 c22f04bdba puh 2025-11-29 19:26:37 -05:00
legop3 96fdd62821 fling duration 2025-11-29 18:59:46 -05:00
legop3 a7d42ba561 agjakdshuflk 2025-11-29 18:48:33 -05:00
legop3 5645bfdee3 giuhu 2025-11-29 03:31:31 -05:00
legop3 82b4e14194 stupid. 2025-11-29 03:25:50 -05:00
legop3 85a42c9611 noooo moooreee hw0,0 2025-11-29 03:21:19 -05:00
legop3 40a0409f7e git 2025-11-29 03:16:54 -05:00
legop3 4d02b6fcac rovermic??? fix??? 2025-11-29 03:10:21 -05:00
legop3 b551f76c9c the fray 2025-11-29 03:02:27 -05:00
legop3 4134cd4bb1 here we go again 2025-11-29 02:31:21 -05:00
legop3 32f0fe5f3d lower bitrates all around 2025-11-29 02:17:08 -05:00
legop3 d8c8b7f727 guh 2025-11-29 01:30:39 -05:00
legop3 620a01280a ugh 2025-11-28 05:58:16 -05:00
legop3 16bf8e880e uuhdgd 2025-11-28 05:54:48 -05:00
legop3 7a95aabb8d kjdsah 2025-11-28 05:46:16 -05:00
legop3 aec83de635 ugh 2025-11-28 05:43:38 -05:00
legop3 30ada80b0b uuuaghhhfj 2025-11-28 05:38:45 -05:00
legop3 6def1d8cfc beoke 2025-11-28 05:33:21 -05:00
legop3 24f7066f6d ugh 2025-11-28 05:31:56 -05:00
legop3 bbf0da86f2 puh 2025-11-28 05:27:06 -05:00
legop3 d70cf3d216 lets hope this works 2025-11-28 05:11:46 -05:00
legop3 eb27e9e620 wuuuhufd 2025-11-28 04:49:04 -05:00
legop3 29facb35f3 beoke 2025-11-28 04:39:04 -05:00
legop3 65975124f4 mhmm 2025-11-28 04:26:04 -05:00
legop3 d1dc3e470f ill try it 2025-11-28 04:21:29 -05:00
legop3 96428938b9 ugh 2025-11-28 04:09:16 -05:00
legop3 ddfe68699b nopeus 2025-11-28 04:05:29 -05:00
legop3 852af31e10 this isnt gonna work.. 2025-11-28 04:02:40 -05:00
legop3 b70c47a402 aac... 2025-11-28 03:37:14 -05:00
legop3 65b3bbdfd8 please.., 2025-11-28 03:15:46 -05:00
legop3 5dede62b0e fifofofi 2025-11-28 03:10:08 -05:00
legop3 b8a8c412ca build 2025-11-28 02:51:51 -05:00
legop3 0cfac796d8 big shot 2025-11-28 02:29:47 -05:00
legop3 5debdbed94 update battery manager 2025-11-28 02:16:00 -05:00
legop3 b3d6830814 uuhgjkf 2025-11-28 02:06:43 -05:00
legop3 cfdaf0e11f correct mic params? 2025-11-28 01:58:31 -05:00
legop3 2f969ff05d uihkgkfkj 2025-11-28 01:51:57 -05:00
legop3 8be04781a5 wuhguh 2025-11-28 01:48:32 -05:00
legop3 e0259fe20c guhw 2025-11-28 01:44:05 -05:00
legop3 8453660872 wuh 2025-11-28 01:37:47 -05:00
legop3 b0d343109b raw pcm hopefully?? 2025-11-28 01:33:26 -05:00
legop3 ab8d327d18 mu-law 2025-11-28 01:26:45 -05:00
legop3 1552bcca70 stop transcoding audio please 2025-11-28 01:19:17 -05:00
legop3 978e05e77f remove audio filter 2025-11-28 01:07:20 -05:00
legop3 f40ab91c54 ugh 2025-11-28 01:02:05 -05:00
legop3 627e948c59 creature 2025-11-28 00:58:41 -05:00
legop3 1daf5d7d03 good 2025-11-28 00:51:36 -05:00
legop3 9e089b6e4d trying a new method 2025-11-28 00:37:54 -05:00
legop3 52a5b9bab4 plan... ., 2025-11-27 23:53:05 -05:00
legop3 08988962c1 smaller default video bitrate 2025-11-27 23:20:33 -05:00
legop3 5f5591ca42 remove everything related to rover mic while keeping tts 2025-11-27 23:15:21 -05:00
legop3 509dbd870a gh 2025-11-27 23:02:39 -05:00
legop3 f0732a2a12 iuysug 2025-11-27 22:58:23 -05:00
legop3 fb7b0be305 auuuughh 2025-11-27 22:56:02 -05:00
legop3 f9b95c078a debug doesnt exist 2025-11-27 22:52:21 -05:00
legop3 afa2a8a7e5 oh oops 2025-11-27 22:47:23 -05:00
legop3 5a1ff61bc0 lighter audio encoding 2025-11-27 22:27:51 -05:00
legop3 c141fd151a uhg 2025-11-27 22:22:05 -05:00
legop3 97c7098e14 ooooopuusss 2025-11-27 20:58:01 -05:00
legop3 a73c6dfd6b opus!! 2025-11-27 20:49:18 -05:00
legop3 1b1c9d1699 raaah 2025-11-27 20:22:13 -05:00
legop3 6d6bfaaa7f forgot to build again 2025-11-27 20:16:44 -05:00
legop3 d57bd74132 aac encodings 2025-11-27 20:16:33 -05:00
legop3 365d059b0c kjkjdsa 2025-11-27 20:12:14 -05:00
legop3 d5c6b6157c uhfd 2025-11-27 20:00:59 -05:00
legop3 7253e8af2e kjhfiuy 2025-11-27 19:58:07 -05:00
legop3 0067a50cb0 are you suuure 2025-11-27 19:54:24 -05:00
legop3 8f53faec56 forgot to pi build 2025-11-27 19:49:39 -05:00
legop3 a14062909b ugh 2025-11-27 19:49:10 -05:00
legop3 acec70a69c uuuaahhg 2025-11-27 19:42:18 -05:00
legop3 470d1f930d fine 2025-11-27 19:35:07 -05:00
legop3 63f788c16e guh..,ugh 2025-11-27 19:21:25 -05:00
legop3 6eac64beab raaahhh 2025-11-27 19:06:36 -05:00
legop3 37d5841d1c ACTUALLY replace the video env file 2025-11-27 19:01:47 -05:00
legop3 1ec37a43f6 target the hat instead of 0,0 2025-11-27 18:47:03 -05:00
legop3 022249950e make sure input device is actually 0,0 2025-11-27 18:38:09 -05:00
legop3 8cb42dee36 set default to 0,0 2025-11-27 18:16:54 -05:00
legop3 a588df0f0d forgot to pi-build 2025-11-27 17:58:00 -05:00
legop3 99cf12c2b5 ohhhhh..duh 2025-11-27 17:57:37 -05:00
legop3 6d607e697d guh 2025-11-27 17:40:01 -05:00
legop3 bc0aa86381 ugh 2025-11-27 17:31:15 -05:00
legop3 e2a4d2f3e5 make sure the mic is the default hopefully 2025-11-27 16:51:19 -05:00
legop3 9289fb3467 first pass of tts and audio stuff 2025-11-27 16:26:21 -05:00
legop3 871e04a8ba planning audio on pi 2025-11-27 15:21:10 -05:00
legop3 63871ccd17 fix discord bot pings and some of the session spam 2025-11-27 02:01:31 -05:00
legop3 6c43bcbf8d trying to fix spectator page chat 2025-11-27 00:09:07 -05:00
legop3 959812300b don't announce first mode change 2025-11-26 23:35:58 -05:00
legop3 23858b1b6a unlock on waiting and ping on unlock 2025-11-26 23:29:24 -05:00
legop3 0e391ef26d swtich to skipping only once at the beginning 2025-11-25 02:23:54 -05:00
legop3 4364c0eb07 turn idle skipses 2025-11-25 02:15:19 -05:00
legop3 22c4c7110d let them chat! (spectators) 2025-11-25 02:04:25 -05:00
legop3 c7380e30fd make sensors even slower 2025-11-24 18:32:06 -05:00
legop3 c2968a7a33 room camera service for ps3 eye on a pi 3 2025-11-24 17:59:48 -05:00
legop3 3423718ac1 walls doors and airlocks 2025-11-24 13:58:27 -05:00
legop3 ad41a99d10 room camera service for server 2025-11-24 13:51:54 -05:00
legop3 65160e8c14 finally fix 2025-11-24 12:44:34 -05:00
legop3 d2e05f84b2 even smaller sidebar 2025-11-24 12:38:48 -05:00
legop3 f7ce5cefd5 smaller spectator sidebar 2025-11-24 12:37:01 -05:00
legop3 6b017f917e 2 column rover grid 2025-11-24 12:34:56 -05:00
legop3 ba99d41972 new spectator layout 2025-11-24 12:33:10 -05:00
legop3 126d8fbab9 make the spectator videos a little bigger 2025-11-24 04:21:11 -05:00
legop3 0e14445685 finally fixed the scrolling issues! 2025-11-24 04:11:34 -05:00
legop3 4a3b91eeab uuihiufgkkjf 2025-11-24 03:58:55 -05:00
legop3 76200dcd1f janky... but if it works? 2025-11-24 03:56:53 -05:00
legop3 448c2e0239 oops 2025-11-24 03:45:22 -05:00
legop3 a595d793d6 forgot to edit max h 2025-11-24 03:44:14 -05:00
legop3 82f1b71c26 finally? 2025-11-24 03:43:36 -05:00
legop3 e6fec6d9bf iuhgfh 2025-11-24 03:35:30 -05:00
legop3 7893814d03 kjfehkds 2025-11-24 03:31:48 -05:00
legop3 c11ffc750d aaahghg 2025-11-24 03:29:21 -05:00
legop3 2f9349fb40 h48 2025-11-24 03:27:35 -05:00
legop3 7bbb039da1 wuhg 2025-11-24 03:23:22 -05:00
legop3 f80d2445b0 wuhw 2025-11-24 03:20:06 -05:00
legop3 a4a3016c05 give up lol 2025-11-24 03:11:23 -05:00
legop3 9f2b1e423f stupid 2025-11-24 03:09:21 -05:00
legop3 627ca21a56 stupid 2025-11-24 03:07:18 -05:00
legop3 1e788be509 wuhm 2025-11-24 03:04:34 -05:00
legop3 00f31efc3d uhmm.. 2025-11-24 03:00:28 -05:00
legop3 0e80bda371 fix max heights and stuff 2025-11-24 02:57:08 -05:00
legop3 03ef441f1b fix chat getting toooo talll 2025-11-24 02:50:17 -05:00
legop3 59021281e9 fix spectator page, add discord ping filtering 2025-11-24 02:47:21 -05:00
legop3 be1b345fbb oopsie 2025-11-24 00:57:01 -05:00
legop3 9ba7f8fd7a spectator updates 2025-11-24 00:40:11 -05:00
legop3 c1c78585ba spectator UI rebuild 2025-11-24 00:33:36 -05:00
legop3 f5f183e7ce Update video-publisher.sh AWB settings
Changed AWB setting from 'greyworld' to 'custom' with specific gains.
2025-11-23 03:39:29 -05:00
legop3 df175f7198 Add AWB option to video publisher script 2025-11-23 03:35:42 -05:00
legop3 48ac39336c guh 2025-11-22 22:56:41 -05:00
legop3 724df8c59e guh 2025-11-22 22:54:50 -05:00
legop3 60a19494de ugh 2025-11-22 22:53:01 -05:00
legop3 6c4e2b4fdb try different flag flip flag 2025-11-22 22:49:36 -05:00
legop3 74bbd19d85 try different flip flags 2025-11-22 22:43:32 -05:00
legop3 81ada96450 try something ELSE? 2025-11-22 22:40:11 -05:00
legop3 0e44f1ac08 try a different way..? 2025-11-22 22:33:23 -05:00
legop3 4ff6e8c6cd flip camera 2025-11-22 22:29:14 -05:00
legop3 56dede2679 spectator page planning 2025-11-22 20:39:11 -05:00
legop3 a9f2d62d30 add turn alerts client-side 2025-11-22 20:26:21 -05:00
legop3 988554dc5f fix tap and holding buttons 2025-11-22 20:18:01 -05:00
legop3 86b4c9a18c update favicon and such 2025-11-22 20:01:40 -05:00
legop3 fd4f96899a add fullscreen prompt and STUPID apple pwa stuff. 2025-11-22 19:38:42 -05:00
legop3 930f411549 fixing up mobile layouts 2025-11-22 19:10:50 -05:00
legop3 3be9e17ecc add discord invite button in UI 2025-11-22 15:38:44 -05:00
legop3 d1d5ad91bd add discord invite to session 2025-11-22 14:51:34 -05:00
legop3 2d07a3ca4c add turns queue to user list panel 2025-11-22 13:37:30 -05:00
legop3 ef8d1f021b oops 2025-11-22 13:15:33 -05:00
legop3 d222f022aa wuh 2025-11-22 04:03:47 -05:00
legop3 84905544a3 puh 2025-11-22 04:00:26 -05:00
legop3 751bf80338 switch auto lights on to drive macro 2025-11-22 03:58:28 -05:00
legop3 4c3569c001 granpa!! (auto lights on) 2025-11-22 03:54:31 -05:00
legop3 b582617535 update nickname on reconnect 2025-11-22 03:17:20 -05:00
legop3 7b017eb7f7 change discord bot prefix 2025-11-22 03:12:02 -05:00
legop3 3b56427552 fixupx 2025-11-22 03:06:52 -05:00
legop3 d95ba09e00 youe 2025-11-22 02:53:55 -05:00
legop3 a26772055a hopefully fixed discord dock / undock alerts? 2025-11-22 02:44:10 -05:00
legop3 042f653798 battery manager / discord bot fix. add discord tag in chat. 2025-11-22 02:30:51 -05:00
legop3 62075df80d discord bot 2025-11-22 02:05:49 -05:00
legop3 f2a0670861 discord bot planning 2025-11-21 23:20:53 -05:00
legop3 b0ca95807c move UI stuff around, add message sound 2025-11-21 04:55:30 -05:00
legop3 2baecc90ff build new chat frontend 2025-11-21 04:35:48 -05:00
legop3 7dde0d0599 chat, nicknames, user list. 2025-11-21 04:32:49 -05:00
legop3 3d5df5938d planning nicknames and chat and 2025-11-21 03:53:25 -05:00
legop3 746327553e planning nicknames system 2025-11-21 03:27:37 -05:00
legop3 fb748e78e8 try to block admins from home assistant 2025-11-21 03:14:25 -05:00
legop3 23e8c84fa3 change buttons 2025-11-21 02:00:43 -05:00
legop3 c52aa7d998 ignore package-lock... 2025-11-21 01:47:44 -05:00
legop3 6473b076d5 fix home assistant lights 2025-11-21 01:45:29 -05:00
legop3 e2a3d78bc0 home assistant lights and other tweaks 2025-11-21 01:38:53 -05:00
legop3 e514b1b9e1 unlock roomba only on waiting AND full 2025-11-20 22:26:14 -05:00
legop3 991645c957 fix up driver video component 2025-11-20 22:14:36 -05:00
legop3 ff094c2a2b lock on charge, not on dock 2025-11-20 22:00:51 -05:00
legop3 efdef8ff1c sensor rate limit on pi 2025-11-20 21:13:55 -05:00
legop3 aa048d7bdc adjust some styling. move the session snapshot to admin settings 2025-11-20 18:31:28 -05:00
legop3 ac22aa3f84 battery warning overlay 2025-11-20 17:06:08 -05:00
legop3 3b99ceecb2 minimization 2025-11-20 16:56:27 -05:00
legop3 3af8702d48 fix video auth stuff 2025-11-20 16:47:56 -05:00
legop3 ac634a4ab2 add room cameras to driver tab 2025-11-20 16:35:23 -05:00
legop3 da494043c8 unmute forever 2025-11-20 16:31:51 -05:00
legop3 220535e72a vertical room cameras 2025-11-20 16:21:18 -05:00
legop3 d816345560 fix reconnectings 2025-11-20 15:59:08 -05:00
legop3 e05f258fb3 room camera use its own video players 2025-11-20 15:57:00 -05:00
legop3 a92294dba8 forgot to build... 2025-11-20 15:28:34 -05:00
legop3 bb8540828e oops 2025-11-20 15:27:24 -05:00
legop3 ea59a196bb ugh 2025-11-20 15:21:13 -05:00
legop3 bfdfa33b62 sensor stream throttle and new roster panel 2025-11-20 14:55:59 -05:00
legop3 ff0bf30eac servo fix 2025-11-20 14:12:06 -05:00
legop3 400054ae58 AAAAH 2025-11-20 13:56:19 -05:00
legop3 233dd993e2 logger fix 2025-11-20 13:52:38 -05:00
legop3 d09c63ca7d battery manager progress 2025-11-20 13:48:26 -05:00
legop3 a4cc514b9a sync every 5 seconds 2025-11-19 17:03:46 -05:00
legop3 d49ec34f0a rover manager improvements and event bus 2025-11-19 16:49:53 -05:00
legop3 598c0404a2 planning 2025-11-19 16:23:15 -05:00
legop3 fc391a9d8b documentation 2025-11-19 14:30:40 -05:00
legop3 cf4e754aed local env var for dev 2025-11-19 13:55:04 -05:00
legop3 1da2729251 wuh 2025-11-18 22:28:30 -05:00
legop3 ed233c1cb6 guh 2025-11-18 22:24:30 -05:00
legop3 ed7804e0f3 oops 2025-11-18 20:56:51 -05:00
legop3 a1bd8eea96 guh 2025-11-18 20:54:58 -05:00
legop3 288309055a set default mode to admin 2025-11-18 20:39:27 -05:00
legop3 7515510880 guhbuh 2025-11-18 20:02:47 -05:00
legop3 1a38ed7b73 guh 2025-11-18 19:17:10 -05:00
legop3 b4171eddc1 update stun servers and stuff 2025-11-18 18:33:40 -05:00
legop3 bc3d216915 log 2025-11-18 17:11:05 -05:00
legop3 4cbcdef9c2 guh 2025-11-18 17:07:14 -05:00
legop3 978df8fb62 guh 2025-11-18 17:03:48 -05:00
legop3 d812a1fc6c guh 2025-11-18 16:56:55 -05:00
legop3 080c9c8fce guh 2025-11-18 16:47:37 -05:00
legop3 fb5b166a37 coloooors 2025-11-18 15:36:56 -05:00
legop3 457ad42565 guh 2025-11-18 14:22:47 -05:00
legop3 8ca1acb172 g 2025-11-18 14:15:27 -05:00
legop3 b1bd1513b5 guh 2025-11-18 14:14:23 -05:00
legop3 63d796dcd4 guh 2025-11-18 14:13:37 -05:00
legop3 8e520a6368 guhwuh 2025-11-18 14:13:06 -05:00
legop3 e037096914 guhwhu 2025-11-18 14:03:43 -05:00
legop3 543337ac8b guh 2025-11-18 13:57:39 -05:00
legop3 d60d765008 guh 2025-11-18 13:53:21 -05:00
legop3 f32c2549d7 hectare 2025-11-18 13:49:31 -05:00
legop3 ff808476a2 guhwuh 2025-11-18 13:41:36 -05:00
legop3 cc389acbb9 whayy 2025-11-18 13:38:27 -05:00
legop3 5fe68d6027 guhwhu 2025-11-18 13:01:57 -05:00
legop3 3151419b92 guh wuh 2025-11-18 04:33:04 -05:00
legop3 22c5858ab6 tabguhwuh 2025-11-18 04:29:09 -05:00
legop3 519d2e2836 guhguh 2025-11-18 04:10:55 -05:00
legop3 189eb4c309 guh 2025-11-18 03:50:30 -05:00
legop3 481c0e1bcd guhpad 2025-11-18 03:45:32 -05:00
legop3 6efa1b268f gumap 2025-11-18 03:32:18 -05:00
legop3 e7793c8ef2 guhpad 2025-11-18 03:21:13 -05:00
legop3 98b61a7845 guh 2025-11-18 03:15:30 -05:00
legop3 5c66bbd809 teraria 2025-11-18 00:09:48 -05:00
legop3 7390d5c1ac factorio 2025-11-18 00:00:14 -05:00
legop3 4c5dfa093c GONE. 2025-11-17 23:59:08 -05:00
legop3 ffa4189763 controls 2025-11-17 23:48:58 -05:00
legop3 d0ea99bc4c guhw 2025-11-17 23:40:54 -05:00
legop3 baf7e2ea44 guh 2025-11-17 23:28:22 -05:00
legop3 10e78757b9 uuuaaahhg 2025-11-17 23:24:49 -05:00
legop3 a038bf775a guh 2025-11-17 23:22:15 -05:00
legop3 f8d01a810c guh 2025-11-17 23:15:54 -05:00
legop3 9c45075cd1 guh wh 2025-11-17 22:58:02 -05:00
legop3 12b5e18f0a guh 2025-11-17 21:36:09 -05:00
legop3 dc6a4b3c3a guh 2025-11-17 21:18:43 -05:00
legop3 2303fd3c7b guh 2025-11-17 20:42:15 -05:00
legop3 3836bd3cc1 guh 2025-11-17 20:23:56 -05:00
legop3 8c40c08b57 guhwuh 2025-11-17 19:40:50 -05:00
legop3 0c83df7933 pi guh 2025-11-17 19:32:26 -05:00
legop3 c3ea5f02e2 guh 2025-11-17 19:25:28 -05:00
legop3 9a6c54ce7c ugh 2025-11-17 19:24:11 -05:00
legop3 ae619b8faf guh 2025-11-17 19:22:06 -05:00
legop3 88161468e8 guh 2025-11-17 19:14:10 -05:00
legop3 a580563be5 guh 2025-11-17 19:13:02 -05:00
legop3 95cfe4557c guh server 2025-11-17 19:06:35 -05:00
legop3 5ac94f7110 guh 2025-11-17 18:59:55 -05:00
legop3 090fffe356 guh 2025-11-17 18:48:01 -05:00
legop3 2a942ff55c guh 2025-11-17 18:39:21 -05:00
legop3 9b552fb857 pi side servo stuff 2025-11-17 18:18:46 -05:00
legop3 ab15ce7e17 are you having a stroke 2025-11-17 17:12:49 -05:00
legop3 4bd9e25fc4 beginnings of the servo 2025-11-17 17:02:09 -05:00
legop3 3bd723202c Merge pull request #2 from legop3/rpi-zero
Rpi zero
2025-11-17 16:26:05 -05:00
436 changed files with 38006 additions and 4950 deletions
+6
View File
@@ -11,3 +11,9 @@ config.h
robots.json
roverd-dummy
server/config.yaml
server/package-lock.json
package-lock.json
server/data/discord-guilds.json
server/data/global-objective.json
server/data/admin-reason.json
server/data
+4 -84
View File
@@ -1,87 +1,7 @@
# Multi Roomba Rover
A system for controlling create 2 compatible roombas through a webpage.
a remake of my RoombaRover project with a decentralized and embedded approach
supports multiple roombas
Docs coming "soon"
on each roomba:
- a raspberry pi zero 2 w
- a raspberry pi camera
- roomba's serial port hooked up to the built in serial port on the raspberry pi
pi provisioning:
- enable serial port
- disable wifi powersave
- disable bluetooth
## Repo layout
- `pi/roverd`: tiny Go daemon that bridges the Create 2 serial port, BRC pin, and the control server via WebSockets.
- `server`: Node.js process that terminates rover sockets, relays commands to/from the Socket.IO UI, and serves `public/`.
- `pi/bin` / `pi/systemd`: helper scripts + systemd units for the rover (roverd itself plus the SRT video publisher that streams camera feeds to the server).
- `docs/pi-deployment.md`: per-rover build + install instructions (cross-compiling on Fedora 43, deploying roverd + mediaMTX).
## Quick start
```bash
# build the Pi agent (armv7)
cd pi/roverd
mkdir -p ../../dist
make pi-build
# start the server + UI
cd ../../server
npm install
npm run start
```
Need a fake rover or multi-rover testing without hardware? Use the dummy build:
```bash
cd pi/roverd
mkdir -p ../../dist
make dummy
./../../dist/roverd-dummy -config ./roverd.sample.yaml
```
The dummy binary connects to the Node server, emits simulated sensor frames, and logs every command it receives, so you can spin up as many virtual rovers as youd like on your dev machine.
## Admin config & authentication
Before running the Node server, copy `server/config.example.yaml` to `server/config.yaml` and customize the admin records (password hashes, Discord IDs, lockdown permission). Those credentials are used by the driver UIs login panel—only admins can toggle locks/modes, and lockdown admins retain access when the system enters lockdown mode. The spectator page (future) can set `role:set` to `spectator`, and the server enforces all permissions server-side so client tweaks cant grant extra control.
Deploy a rover by copying the repo + `dist/roverd` to the Pi and running the helper (it installs roverd plus the SRT video publisher service):
```bash
cd ~/MultiRoombaRover
sudo ./pi/install_roverd.sh
```
Then point each rover's `/etc/roverd.yaml` at `ws://<server>:8080/rover`, set `name` to the rovers ID, and (optionally) override `media.publishUrl` if your control server isnt `192.168.0.86`. The video publisher service (`video-publisher.service`) captures the Pi camera with `rpicam-vid`/`libcamera-vid`, pipes the raw H264 into the stock FFmpeg binary, and publishes via SRT to the servers mediaMTX instance at `srt://<server>:9000?streamid=#!::r=<name>,m=publish`. The installer now just pulls `libcamera-apps` + `ffmpeg` from apt (no custom build). Use the “Restart Camera” button if you enable media management so roverd can bounce the publisher service remotely.
Heads-up: the BRC pulser now uses libgpiod; make sure the `roverd` service account is in the `gpio` group (or otherwise allowed to access `/dev/gpiochip*`) and set `brc.gpioChip` if your hardware exposes a different chip name.
## Fedora server deployment
Run the installer from inside the `server/` directory after cloning the repo onto your Fedora 43 Server box:
```bash
cd ~/MultiRoombaRover/server
sudo ./install_server.sh
```
The script must be executed via `sudo` from the user that owns the repo. It will:
- install Node.js/npm plus curl/tar
- run `npm install --production`
- copy `config.example.yaml` to `config.yaml` if needed (edit the file afterwards for admins + `media.whepBaseUrl`)
- download mediaMTX v1.15.3 and drop it into `/usr/local/bin`
- write `/etc/mediamtx/mediamtx.yml` from `server/mediamtx/mediamtx.yml` (SRT ingest on :9000, open ingest, viewer auth webhook at `/mediamtx/auth`)
- create + enable `mediamtx.service` and `multirover.service`, both running as your repo user and pointing at the clone directly
Publishing rovers lives on a trusted network, so the shipped config (tracked at `server/mediamtx/mediamtx.yml`) skips HTTP auth for SRT ingest and whitelists any path that matches `rover-*`. The installer overwrites `/etc/mediamtx/mediamtx.yml` every time you run it—if you need to tweak ports or add TURN servers, edit the template in the repo and rerun `install_server.sh` so every box stays in sync automatically.
Once finished, update `server/config.yaml` with your admin passwords and `media.whepBaseUrl` (`http://192.168.0.86:8889`). The client automatically requests `http://<base>/<rover-id>/whep`, so you never have to embed IDs or path templates. Restart `multirover.service` whenever you edit the config. To pull updates later, just `git pull`, re-run `npm install --production` inside `server/`, and restart the service—no need to rerun the installer.
### Video handshake + diagnostics
- Every `video:request` returns `{ url, token }`. The browser posts the SDP offer to `url` and includes `Authorization: Basic base64(token:token)`. mediaMTX forwards the username (`token`) to `/mediamtx/auth`, which checks the sockets permissions (driver assignment, admin/spectator role, lockdown state) and either returns 200 or 401—no query parameters are involved anymore.
- To see what mediaMTX is ingesting from the Pis, run `npm run check:media` (or `node scripts/checkMedia.js`). It hits `/v3/paths/list` and prints each rovers `ready` state and byte counters so you can instantly spot publish issues.
## Basic installation
-
-33
View File
@@ -1,33 +0,0 @@
# access control modes:
- open
- open to the public
- users are randomly assigned a rover to drive, with priority on the rover with the least amount of drivers
- if there are multiple people on one rover, those people will all be controlling that rover at the same time
- turns
- open to the public
- users are randomly assigned to a rover same as open mode
- if there are multiple people on one rover, they will each have one minute at a time to drive.
- the turn queue loops
- the rover will stop moving and stop all aux. motors if the turn switches to a different person
- admin
- admin authentication is required to access the driver page at all
- lockdown
- ONLY lockdown admins can access the driver page
- the future spectator page is DISABLED (not even a way to log into it)
# roles in the access control system:
- user
- default, for normal people who visit the site
- admin
- authentication needed
- can drive and view any rover when not on lockdown, no matter who is controlling it
- can switch modes (including switching to lockdown mode)
- lockdown admin
- authentication needed
- only works if said admin has lockdown: enabled in config
- can ALWAYS access and control EVERYTHING that there is to do on the site
# other things to keep in mind:
- in the future, there will be a Discord bot for community alerts and a few admin controls
- wherever the admin list is configured, there has to be a spot for their discord ID
- admin's discord IDs are linked to their admin name server-side
+6
View File
@@ -0,0 +1,6 @@
.pio
.vscode/.browse.c_cpp.db*
.vscode/c_cpp_properties.json
.vscode/launch.json
.vscode/ipch
config.h
+37
View File
@@ -0,0 +1,37 @@
This directory is intended for project header files.
A header file is a file containing C declarations and macro definitions
to be shared between several project source files. You request the use of a
header file in your project source file (C, C++, etc) located in `src` folder
by including it, with the C preprocessing directive `#include'.
```src/main.c
#include "header.h"
int main (void)
{
...
}
```
Including a header file produces the same results as copying the header file
into each source file that needs it. Such copying would be time-consuming
and error-prone. With a header file, the related declarations appear
in only one place. If they need to be changed, they can be changed in one
place, and programs that include the header file will automatically use the
new version when next recompiled. The header file eliminates the labor of
finding and changing all the copies as well as the risk that a failure to
find one copy will result in inconsistencies within a program.
In C, the convention is to give header files names that end with `.h'.
Read more about using header files in official GCC documentation:
* Include Syntax
* Include Operation
* Once-Only Headers
* Computed Includes
https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html
+46
View File
@@ -0,0 +1,46 @@
This directory is intended for project specific (private) libraries.
PlatformIO will compile them to static libraries and link into the executable file.
The source code of each library should be placed in a separate directory
("lib/your_library_name/[Code]").
For example, see the structure of the following example libraries `Foo` and `Bar`:
|--lib
| |
| |--Bar
| | |--docs
| | |--examples
| | |--src
| | |- Bar.c
| | |- Bar.h
| | |- library.json (optional. for custom build options, etc) https://docs.platformio.org/page/librarymanager/config.html
| |
| |--Foo
| | |- Foo.c
| | |- Foo.h
| |
| |- README --> THIS FILE
|
|- platformio.ini
|--src
|- main.c
Example contents of `src/main.c` using Foo and Bar:
```
#include <Foo.h>
#include <Bar.h>
int main (void)
{
...
}
```
The PlatformIO Library Dependency Finder will find automatically dependent
libraries by scanning project source files.
More information about PlatformIO Library Dependency Finder
- https://docs.platformio.org/page/librarymanager/ldf.html
+15
View File
@@ -0,0 +1,15 @@
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[env:seeed_xiao_esp32s3]
platform = espressif32
board = esp32-s3-devkitc-1
framework = arduino
monitor_speed = 115200
+3
View File
@@ -0,0 +1,3 @@
#define WIFI_SSID "wifissid"
#define WIFI_PASSWORD "wifipassword"
#define SERVER_URL "http://192.168.0.86:8080/buttonbox/press"
+110
View File
@@ -0,0 +1,110 @@
#include <Arduino.h>
#include <WiFi.h>
#include <HTTPClient.h>
#include <config.h>
// button pin defs
const int buttonPins[] = {15, 16, 17, 18};
const int buttonCount = sizeof(buttonPins) / sizeof(buttonPins[0]);
const int beeperPin = 13;
// Using INPUT_PULLUP means idle = HIGH, pressed = LOW (button to GND).
const int buttonPressedState = LOW;
const unsigned long debounceMs = 40;
const int toneDurationMs = 90;
// One tone per button (1-4).
const int buttonTonesHz[buttonCount] = {262, 330, 392, 523};
int lastStableState[buttonCount];
int lastReading[buttonCount];
unsigned long lastDebounceTime[buttonCount];
void PlayButtonTone(int buttonNumber) {
if (buttonNumber < 1 || buttonNumber > buttonCount) {
return;
}
int frequencyHz = buttonTonesHz[buttonNumber - 1];
tone(beeperPin, frequencyHz, toneDurationMs);
}
// button request function
bool SendButtonPressRequest(int buttonNumber) {
Serial.println("attempting to send button press");
bool success = false;
if (WiFi.status() == WL_CONNECTED) {
HTTPClient http;
http.begin(SERVER_URL);
http.addHeader("Content-Type", "text/plain");
int httpResponseCode = http.POST(String(buttonNumber));
if (httpResponseCode > 0) {
Serial.println("http response code: ");
Serial.print(httpResponseCode);
Serial.println(http.getString());
success = true;
} else {
Serial.println("HTTP ERROR!!! ");
Serial.print(httpResponseCode);
success = false;
}
http.end();
} else {
Serial.println("Not ocnnectec to wifi! cant send request!");
}
return success;
}
void setup() {
Serial.begin(115200);
WiFi.begin(WIFI_SSID, WIFI_PASSWORD);
while (WiFi.status() != WL_CONNECTED) {
delay(100);
Serial.print("wifi connecting... ");
}
Serial.println("WIFI CONNENCTED !!!! :3");
for (int i = 0; i < buttonCount; i++) {
pinMode(buttonPins[i], INPUT_PULLUP);
int initial = digitalRead(buttonPins[i]);
lastStableState[i] = initial;
lastReading[i] = initial;
lastDebounceTime[i] = 0;
}
pinMode(beeperPin, OUTPUT);
noTone(beeperPin);
}
void loop() {
unsigned long now = millis();
for (int i = 0; i < buttonCount; i++) {
int reading = digitalRead(buttonPins[i]);
if (reading != lastReading[i]) {
lastDebounceTime[i] = now;
}
if ((now - lastDebounceTime[i]) > debounceMs) {
if (reading != lastStableState[i]) {
lastStableState[i] = reading;
// Trigger once on press edge.
if (reading == buttonPressedState) {
if (SendButtonPressRequest(i + 1)) {
PlayButtonTone(i + 1);
}
}
}
}
lastReading[i] = reading;
}
delay(5);
}
+11
View File
@@ -0,0 +1,11 @@
This directory is intended for PlatformIO Test Runner and project tests.
Unit Testing is a software testing method by which individual units of
source code, sets of one or more MCU program modules together with associated
control data, usage procedures, and operating procedures, are tested to
determine whether they are fit for use. Unit testing finds problems early
in the development cycle.
More information about PlatformIO Unit Testing:
- https://docs.platformio.org/en/latest/advanced/unit-testing/index.html
+3 -1
View File
@@ -1,6 +1,6 @@
#configuration for roverd
name: dummy1
serverUrl: ws://192.168.0.84:8080/rover
serverUrl: ws://127.0.0.1:8080/rover
serial:
device: /dev/ttyS0
baud: 115200
@@ -18,3 +18,5 @@ media:
service: mediamtx.service
healthUrl: http://127.0.0.1:9997/v3/paths/list
healthInterval: 30s
nightVision:
enabled: false
+3 -1
View File
@@ -1,6 +1,6 @@
#configuration for roverd
name: dummy2
serverUrl: ws://192.168.0.84:8080/rover
serverUrl: ws://127.0.0.1:8080/rover
serial:
device: /dev/ttyS0
baud: 115200
@@ -18,3 +18,5 @@ media:
service: mediamtx.service
healthUrl: http://127.0.0.1:9997/v3/paths/list
healthInterval: 30s
nightVision:
enabled: false
+22
View File
@@ -0,0 +1,22 @@
#configuration for roverd
name: dummy3
serverUrl: ws://127.0.0.1:8080/rover
serial:
device: /dev/ttyS0
baud: 115200
brc:
gpioPin: 25
pulseEvery: 1m
pulseWidth: 1s
battery:
full: 2068
warn: 1700
urgent: 1650
maxWheelSpeed: 350
media:
manage: false
service: mediamtx.service
healthUrl: http://127.0.0.1:9997/v3/paths/list
healthInterval: 30s
nightVision:
enabled: false
Vendored Executable
BIN
View File
Binary file not shown.
Vendored
BIN
View File
Binary file not shown.
Vendored Executable
BIN
View File
Binary file not shown.
-112
View File
@@ -1,112 +0,0 @@
# Pi Deployment Guide
## Tooling
Fedora 43:
```bash
sudo dnf install golang libgpiod
```
Cross-compiling roverd for Pi Zero 2 W (ARMv7):
```bash
cd pi/roverd
mkdir -p ../../dist
make pi-build
```
The binary is placed in `dist/roverd` (relative to the repo root).
### Dummy rover build (for local testing)
If you need extra “virtual” rovers on your laptop/CI box, build the dummy binary:
```bash
cd pi/roverd
mkdir -p ../../dist
make dummy
```
Run the resulting `dist/roverd-dummy` on any machine; it will connect to the server, stream fake Group 100 sensor data, and log drive commands so you can test multi-rover features without additional hardware.
## Automated installation (recommended)
Install the Raspberry Pi camera helpers (Bookworm ships them):
```bash
sudo apt update
sudo apt install libcamera-apps
```
Once the binary (and repo) are on the Pi, run the helper script from the repo root:
```bash
cd ~/MultiRoombaRover
sudo ./pi/install_roverd.sh
```
What the script does:
- creates the `roverd` service account (dialout/gpio/video groups) if missing and installs `/usr/local/bin/roverd`
- copies `pi/roverd/roverd.sample.yaml` to `/etc/roverd.yaml` if the file is absent (existing configs are left untouched)
- installs/enables the `roverd.service` systemd unit, restarting it automatically when a config already exists
- installs `/usr/local/bin/video-publisher`, drops `video-publisher.service`, and enables it so video is published automatically on boot
Flags:
| Flag | Purpose |
|------|---------|
| `-b PATH` | use a different roverd binary (defaults to `dist/roverd`) |
| `-c PATH` | seed `/etc/roverd.yaml` from another template |
If the script installs the sample config, it will remind you to edit `/etc/roverd.yaml` before manually restarting the service: set `name`, `serverUrl`, serial device, BRC pin, battery thresholds, and optionally override `media.publishUrl`. When left blank, roverd automatically publishes to `srt://<server-host>:9000?streamid=#!::r=<name>,m=publish…` (the host comes from `serverUrl`).
Re-run `pi/install_roverd.sh` any time you pull updates—the script overwrites the roverd + video-publisher binaries and drops the latest systemd units so the only configuration you ever touch manually is `/etc/roverd.yaml`. `roverd` rewrites `/var/lib/roverd/video.env` on startup, so no other files need editing.
## Manual installation
1. Copy the binary and config:
```bash
sudo useradd -r -s /usr/sbin/nologin roverd || true
sudo install -o roverd -g roverd -m 0755 dist/roverd /usr/local/bin/roverd
sudo install -o roverd -g roverd -m 0640 pi/roverd/roverd.sample.yaml /etc/roverd.yaml
```
Adjust `/etc/roverd.yaml` for each rover: `name`, `serverUrl` (e.g. `ws://control-server:8080/rover`), serial port path, battery thresholds, GPIO pin for BRC, and (if needed) the media `publishUrl` override. Otherwise, roverd derives `srt://<server-host>:9000?streamid=#!::r=<name>,m=publish&latency=20&mode=caller&transtype=live&pkt_size=1316` based on the `serverUrl`.
2. Install the systemd unit:
```bash
sudo install -m 0644 pi/systemd/roverd.service /etc/systemd/system/roverd.service
sudo systemctl daemon-reload
sudo systemctl enable --now roverd.service
```
`roverd` requires access to `/dev/ttyAMA0` and `/dev/gpiochip*`; keeping it under its own user ensures the rest of the system stays isolated—just make sure the account belongs to the `dialout` and `gpio` groups so it can reach the UART and libgpiod.
The video publisher needs read access to the camera devices (`/dev/media*`, `/dev/video*`), so the install script adds the `roverd` service account to the `video` group; if you created the user manually, make sure it belongs to `video`.
**BRC note:** configure `brc.gpioPin` (and `brc.gpioChip` if youre not using `gpiochip0`) and ensure the `roverd` user has permission to toggle that line—no root privileges are required anymore.
If you set `media.manage: true` in `/etc/roverd.yaml`, make sure the `roverd` service account can invoke `systemctl <action> <media.service>` (the installer wires `video-publisher.service` to run as `roverd`, so no sudo tweaks are required unless you rename it).
## Video publisher details
The `video-publisher.service` unit runs `/usr/local/bin/video-publisher`, piping `rpicam-vid`/`libcamera-vid` straight into the stock FFmpeg package:
```bash
rpicam-vid (or libcamera-vid) --inline --timeout 0 --width=WIDTH --height=HEIGHT \
--framerate=FPS --bitrate=BITRATE --codec h264 --profile baseline --output - \
| ffmpeg -hide_banner -loglevel warning -fflags nobuffer \
-f h264 -i pipe:0 -c:v copy -an -flush_packets 1 -f mpegts $PUBLISH_URL
```
`/var/lib/roverd/video.env` carries all tunables (`PUBLISH_URL`, resolution, FPS, bitrate). `roverd` rewrites the file whenever you restart it or hit the “Restart Camera” button so the publisher always inherits the correct rover ID + bitrate knobs. Because we now use the distro FFmpeg build with SRT enabled, the installer is much faster—no custom compile steps.
Use `sudo systemctl status video-publisher` to watch logs; the unit auto-restarts whenever the connection drops or FFmpeg exits with an error.
## Server + UI
From the repo root:
```bash
cd server
npm install
npm run start
```
This launches the HTTP server (serving the barebones UI) and the rover WebSocket endpoint at `ws://<server>:8080/rover`. The UI expects `roverd` instances to send `hello` frames so it can populate the rover list. Use the mode buttons to emit Start/Safe/Full/Passive/Dock commands (they send the raw OI opcode bytes), tap the sensor toggle to request Group 100 streaming, and use WASD for drive testing; the UI emits Drive Direct commands ~8 times per second, so the rover sees them immediately.
-36
View File
@@ -1,36 +0,0 @@
# Video flow (SRT ingest, WHEP playback)
1. **Raspberry Pi Zero 2 W**
- `pi/bin/video-publisher.sh` captures the CSI camera with `rpicam-vid`/`libcamera-vid` using the onboard H.264 encoder (`--inline --profile baseline --bitrate …`).
- The Annex-B stream is piped into the stock FFmpeg package and pushed to the control server over SRT as MPEGTS: `ffmpeg -f h264 -i - -c copy -f mpegts "srt://<server>:9000?streamid=#!::r=rover-alpha,m=publish&latency=20&mode=caller&transtype=live&pkt_size=1316"`.
- Configuration lives in `/var/lib/roverd/video.env` (`PUBLISH_URL`, resolution, FPS, bitrate). `roverd` rewrites this file whenever the rover config changes, so onboarding a new rover is just flashing the SD card, setting its `name`, and plugging it into the trusted LAN—**no auth or per-rover server config is required on the Pi ⇄ server hop.**
2. **mediaMTX on the server**
- Single wildcard path handles every rover:
```yaml
paths:
"~^rover-(?P<id>[a-z0-9_-]+)$":
source: publisher
sourceOnDemand: no
sourceProtocol: srt
readBufferCount: 512
webrtcEnable: yes
webrtcMaxPlayoutDelay: 0
alwaysRemuxWhep: no
```
- Pis publish to `srt://<server>:9000` with the streamid above; mediaMTX auto-creates the path and fans it out over WHEP/WebRTC.
- Only playback is gated: mediaMTX calls the Node server to validate JWTs on `/whep/rover-<id>`, so “locking” a stream is as simple as refusing to mint viewer tokens for that rover. Ingest stays unauthenticated because it lives on a secure LAN.
3. **Web clients**
- Tiny helper (React hook or vanilla class) that:
1. Requests a viewer token for rover `<id>`.
2. Issues a `POST` to `<mediamtx-host>/<rover-id>/whep` with `Authorization: Basic base64(token:token)` (token issued by the server when the client calls `video:request`).
3. Maintains auto-reconnect timers on ICE failure so dashboard widgets can come/go without reloading the page.
- Operator dashboard mounts one player tied to the assigned rover. The spectator view instantiates one player per tile, muting + pausing hidden elements to keep CPU usage sane even when every rover is shown simultaneously.
# Deployment checklist
- `pi/install_roverd.sh` installs the `video-publisher` helper, drops `/var/lib/roverd/video.env`, and pulls in `libcamera-apps` + `ffmpeg` from apt. No custom FFmpeg, no WHIP builds, no extra config—Pis become plug-and-play.
- `roverd` derives `media.publishUrl` automatically from `serverUrl`: `srt://<server>:9000?streamid=#!::r=<name>,m=publish&latency=20&mode=caller&transtype=live&pkt_size=1316`. The media supervisor rewrites `video.env` and manages `video-publisher.service` whenever you hit “Restart Camera” or change `/etc/roverd.yaml`.
- The servers mediaMTX config switches to the wildcard block above, leaves SRT ingest open, and enforces JWTs only on WHEP viewers. Fan-out stays inside mediaMTX so every browser sees the same low-latency stream (≈250350ms glass-to-glass).
- Adding a rover = flash SD → set `/etc/roverd.yaml` (`name`, `serverUrl`, camera knobs if needed) → boot it. The server auto-discovers the new `rover-<id>` stream with zero manual edits.
-58
View File
@@ -1,58 +0,0 @@
## multi roomba rover
a website where people can control multiple irobot create 2 robots in real time 100% responsively
with a raspberry pi zero 2 W on each roomba, along with a raspberry pi camera
a central nodejs control server will tell the raspberry pis what to do with the roomba
## the pi side (roomba side)
- pi's onboard UART is hooked up to the roomba's serial port
- another GPIO pin connected to the roomba's BRC pin
- pull it low for one second every minute to keep the roomba awake
- streams the rpi camera over webRTC with mediamtx
- streams roomba sensor group 100 to the server
- sensor streaming is required and important, but is allowed to falter sometimes
- listens for roomba commands from the server
- commands NEED to happen
- roomba control program needs to be simple, lightweight, and 100% responsive
## pi -> server communication
- stateless
- streaming based
- on connection, the pi will send the following info:
- rover's name
- motor enable / disable
- vacuum
- main brush
- side brush
- battery full number
- battery warning number
- battery urgent number
## nodejs server
- KISS
- decode the sensor data from each roomba
- can support multiple roombas connected from the ground up
- keep it simple, worry about getting the pi comms right.
- but the server DOES have to exist for testing
- IS the web server, hosts an entire static folder for the web UI
## server -> web UI communication
- socket.io
- don't do anything fancy with the socket.io setup
- it works fine out of the box, we will optimize it later
## the web UI
- KISS
- plain old html. no styling even. just bare minimum for testing
- what it needs to do:
- allow user to select the roomba from a list
- make the selected roomba drive with WASD
- have buttons to set the OI mode, and tell the roomba to dock
- show a plain list of the sensor data from the selected roomba
### general javascript programming guidelines (applies to the web UI too)
- everything ES6
- one entrypoint file in the web UI
- everything modular
- everything easy to read, understand, and work on
- comment where you think is best to describe whats going on
+88
View File
@@ -0,0 +1,88 @@
# Use the Google Voice HAT soundcard as the primary device by name (card id is "sndrpigooglevoi")
options snd_rpi_googlevoicehat_soundcard index=0
# Mix multiple playback clients in software with a fixed low-cost format.
pcm.dmixer {
type dmix
ipc_key 1024
ipc_perm 0666
slave {
pcm "hw:0,0"
format S16_LE
rate 16000
channels 1
period_time 0
period_size 1024
buffer_size 4096
}
}
# TTS volume control (used by default playback path).
pcm.tts_softvol {
type softvol
slave.pcm "dmixer"
control {
name "TTSMaster"
card 0
}
min_dB -60.0
max_dB 12.0
}
# Horn volume control.
pcm.horn_softvol {
type softvol
slave.pcm "dmixer"
control {
name "HornMaster"
card 0
}
min_dB -60.0
max_dB 12.0
}
# Forwarded audio volume control.
pcm.forward_softvol {
type softvol
slave.pcm "dmixer"
control {
name "ForwardMaster"
card 0
}
min_dB -60.0
max_dB 12.0
}
# Per-source playback PCMs.
pcm.tts {
type plug
slave.pcm "tts_softvol"
}
pcm.horn {
type plug
slave.pcm "horn_softvol"
}
pcm.forward {
type plug
slave.pcm "forward_softvol"
}
# Capture alias used by rover config defaults.
pcm.rovermic {
type plug
slave.pcm "hw:0,0"
}
# Defaults: TTS direct playback + raw capture on the HAT.
pcm.!default {
type asym
playback.pcm "tts"
capture.pcm "rovermic"
}
ctl.!default {
type hw
card 0
}
+87
View File
@@ -0,0 +1,87 @@
#!/usr/bin/env bash
set -euo pipefail
set +H
ENV_FILE="${VIDEO_ENV_FILE:-/var/lib/roverd/video.env}"
if [[ ! -f "$ENV_FILE" ]]; then
echo "Environment file ${ENV_FILE} missing; cannot start audio forward listener" >&2
exit 1
fi
# shellcheck disable=SC1090
source "$ENV_FILE"
: "${AUDIO_FORWARD_URL:?AUDIO_FORWARD_URL not set in ${ENV_FILE}}"
PLAYBACK_DEVICE="${AUDIO_PLAYBACK_DEVICE:-forward}"
AUDIO_NORMALIZE_ENABLE="${AUDIO_NORMALIZE_ENABLE:-1}"
AUDIO_NORMALIZE_FILTER="${AUDIO_NORMALIZE_FILTER:-dynaudnorm=f=75:g=15:m=10:p=0.9,alimiter=limit=0.85:level=disabled}"
if [[ -n "${FFMPEG_BIN:-}" ]]; then
FFMPEG_BIN_PATH="$FFMPEG_BIN"
elif command -v ffmpeg >/dev/null 2>&1; then
FFMPEG_BIN_PATH="$(command -v ffmpeg)"
else
echo "ffmpeg not found; install it via apt install ffmpeg." >&2
exit 1
fi
if command -v aplay >/dev/null 2>&1; then
APLAY_BIN_PATH="$(command -v aplay)"
else
echo "aplay not found; install it via apt install alsa-utils." >&2
exit 1
fi
LAST_FFMPEG_STATUS="unknown"
LAST_APLAY_STATUS="unknown"
run_pipeline() {
set +e
local -a ffmpeg_args=(
-hide_banner
-loglevel warning
-fflags nobuffer
-flags low_delay
-analyzeduration 200k
-probesize 32k
-i "${AUDIO_FORWARD_URL}"
-vn
)
if [[ "${AUDIO_NORMALIZE_ENABLE}" -ne 0 ]]; then
ffmpeg_args+=(-af "${AUDIO_NORMALIZE_FILTER}")
fi
ffmpeg_args+=(
-ac 1
-ar 16000
-f s16le
pipe:1
)
"${FFMPEG_BIN_PATH}" "${ffmpeg_args[@]}" \
| "${APLAY_BIN_PATH}" \
-q \
-D "${PLAYBACK_DEVICE}" \
-t raw \
-f S16_LE \
-r 16000 \
-c 1
local rc=$?
local -a statuses=("${PIPESTATUS[@]}")
LAST_FFMPEG_STATUS="${statuses[0]:-unknown}"
LAST_APLAY_STATUS="${statuses[1]:-unknown}"
set -e
return "${rc}"
}
trap 'kill 0 2>/dev/null' EXIT INT TERM
while true; do
if run_pipeline; then
exit 0
fi
echo "Audio forward listener exited ffmpeg=${LAST_FFMPEG_STATUS:-unknown} aplay=${LAST_APLAY_STATUS:-unknown}, restarting in 2s..." >&2
sleep 2
done
+66
View File
@@ -0,0 +1,66 @@
#!/usr/bin/env bash
set -euo pipefail
set +H
ENV_FILE="${VIDEO_ENV_FILE:-/var/lib/roverd/video.env}"
if [[ ! -f "$ENV_FILE" ]]; then
echo "Environment file ${ENV_FILE} missing; cannot publish audio" >&2
exit 1
fi
# shellcheck disable=SC1090
source "$ENV_FILE"
AUDIO_ENABLE="${AUDIO_ENABLE:-0}"
if [[ "${AUDIO_ENABLE}" -ne 1 ]]; then
echo "Audio capture disabled; skipping audio-only publisher" >&2
exit 0
fi
: "${AUDIO_PUBLISH_URL:?AUDIO_PUBLISH_URL not set in ${ENV_FILE}}"
AUDIO_DEVICE="${AUDIO_DEVICE:-hw:0,0}"
AUDIO_RATE="${AUDIO_RATE:-48000}"
AUDIO_CHANNELS="${AUDIO_CHANNELS:-2}"
if [[ -n "${FFMPEG_BIN:-}" ]]; then
FFMPEG_BIN_PATH="$FFMPEG_BIN"
elif command -v ffmpeg >/dev/null 2>&1; then
FFMPEG_BIN_PATH="$(command -v ffmpeg)"
else
echo "ffmpeg not found; install it via apt install ffmpeg." >&2
exit 1
fi
run_pipeline() {
arecord -D "${AUDIO_DEVICE}" -f S32_LE -c "${AUDIO_CHANNELS}" -r "${AUDIO_RATE}" -B 65536 -F 2048 -q -t raw \
| "${FFMPEG_BIN_PATH}" \
-hide_banner \
-loglevel warning \
-fflags nobuffer \
-rtbufsize 0 \
-thread_queue_size 4096 \
-f s32le \
-ar "${AUDIO_RATE}" \
-ac "${AUDIO_CHANNELS}" \
-i pipe:0 \
-af "aresample=16000,pan=mono|c0=0.5*FL+0.5*FR,volume=25dB" \
-c:a libopus \
-b:a 24000 \
-ar:a 16000 \
-ac:a 1 \
-application lowdelay \
-frame_duration 20 \
-compression_level 0 \
-f mpegts \
"${AUDIO_PUBLISH_URL}"
}
trap 'kill 0 2>/dev/null' EXIT INT TERM
while true; do
if run_pipeline; then
exit 0
fi
echo "Audio-only publisher exited arecord=${PIPESTATUS[0]} ffmpeg=${PIPESTATUS[1]}, restarting in 2s..." >&2
sleep 2
done
+119 -45
View File
@@ -1,74 +1,148 @@
#!/usr/bin/env bash
set -euo pipefail
# Keep history expansion off so values containing "!" are safe.
set +H
ENV_FILE="${VIDEO_ENV_FILE:-/var/lib/roverd/video.env}"
if [[ ! -f "$ENV_FILE" ]]; then
echo "Environment file ${ENV_FILE} missing; cannot publish" >&2
exit 1
echo "Environment file ${ENV_FILE} missing; cannot publish" >&2
exit 1
fi
# shellcheck disable=SC1090
source "$ENV_FILE"
# Load KEY=VALUE pairs from ENV_FILE WITHOUT evaluating shell metacharacters.
# This makes URLs containing characters like '&' and '#!' safe without requiring quoting.
load_env_file() {
local content=""
if [[ -r "$ENV_FILE" ]]; then
content="$(cat "$ENV_FILE")"
elif command -v sudo >/dev/null 2>&1; then
# Try to read via sudo without prompting (useful when the service runs as an unprivileged user)
content="$(sudo -n cat "$ENV_FILE" 2>/dev/null || true)"
fi
if [[ -z "$content" ]]; then
echo "Cannot read ${ENV_FILE} (permission denied). Run as a user that can read it, or allow sudo -n for cat." >&2
exit 1
fi
local line key val
while IFS= read -r line || [[ -n "$line" ]]; do
# Skip blank lines and full-line comments.
[[ "$line" =~ ^[[:space:]]*$ ]] && continue
[[ "$line" =~ ^[[:space:]]*# ]] && continue
# Support optional leading 'export '
if [[ "$line" =~ ^[[:space:]]*export[[:space:]]+([A-Za-z_][A-Za-z0-9_]*)=(.*)$ ]]; then
key="${BASH_REMATCH[1]}"
val="${BASH_REMATCH[2]}"
elif [[ "$line" =~ ^[[:space:]]*([A-Za-z_][A-Za-z0-9_]*)=(.*)$ ]]; then
key="${BASH_REMATCH[1]}"
val="${BASH_REMATCH[2]}"
else
# Ignore anything that isn't a simple assignment.
continue
fi
# Trim leading/trailing whitespace in value.
val="${val#${val%%[![:space:]]*}}"
val="${val%${val##*[![:space:]]}}"
# If value is wrapped in matching single or double quotes, unwrap.
if [[ "$val" =~ ^\".*\"$ ]]; then
val="${val:1:${#val}-2}"
elif [[ "$val" =~ ^\'.*\'$ ]]; then
val="${val:1:${#val}-2}"
fi
# Assign without evaluation.
printf -v "$key" '%s' "$val"
export "$key"
done <<< "$content"
}
load_env_file
: "${PUBLISH_URL:?PUBLISH_URL not set in ${ENV_FILE}}"
VIDEO_WIDTH="${VIDEO_WIDTH:-1920}"
VIDEO_HEIGHT="${VIDEO_HEIGHT:-1080}"
VIDEO_FPS="${VIDEO_FPS:-30}"
# Defaults tuned for OV5647: use 4:3 output and force the common 2x2 binned full-FOV mode.
VIDEO_WIDTH="640"
VIDEO_HEIGHT="480"
VIDEO_FPS="30"
VIDEO_BITRATE="${VIDEO_BITRATE:-3000000}"
VIDEO_INVERT="${VIDEO_INVERT:-1}"
VIDEO_SENSOR_MODE="${VIDEO_SENSOR_MODE:-1296:972}"
# Flip the camera 180deg by default; allow upright camera mounts via VIDEO_INVERT=0.
FLIP_ARGS=()
if [[ "${VIDEO_INVERT}" -ne 0 ]]; then
FLIP_ARGS=(--rotation 180)
fi
MODE_ARGS=()
if [[ -n "${VIDEO_SENSOR_MODE}" ]]; then
MODE_ARGS=(--mode "${VIDEO_SENSOR_MODE}")
fi
if [[ -n "${LIBCAMERA_BIN:-}" ]]; then
LIBCAMERA_BIN_PATH="$LIBCAMERA_BIN"
LIBCAMERA_BIN_PATH="$LIBCAMERA_BIN"
elif command -v rpicam-vid >/dev/null 2>&1; then
LIBCAMERA_BIN_PATH="$(command -v rpicam-vid)"
LIBCAMERA_BIN_PATH="$(command -v rpicam-vid)"
elif command -v libcamera-vid >/dev/null 2>&1; then
LIBCAMERA_BIN_PATH="$(command -v libcamera-vid)"
LIBCAMERA_BIN_PATH="$(command -v libcamera-vid)"
else
echo "Neither rpicam-vid nor libcamera-vid found; install libcamera-apps." >&2
exit 1
echo "Neither rpicam-vid nor libcamera-vid found; install libcamera-apps." >&2
exit 1
fi
if [[ -n "${FFMPEG_BIN:-}" ]]; then
FFMPEG_BIN_PATH="$FFMPEG_BIN"
FFMPEG_BIN_PATH="$FFMPEG_BIN"
elif command -v ffmpeg >/dev/null 2>&1; then
FFMPEG_BIN_PATH="$(command -v ffmpeg)"
FFMPEG_BIN_PATH="$(command -v ffmpeg)"
else
echo "ffmpeg not found; install it via apt install ffmpeg." >&2
exit 1
echo "ffmpeg not found; install it via apt install ffmpeg." >&2
exit 1
fi
run_pipeline() {
"${LIBCAMERA_BIN_PATH}" \
--inline \
--timeout 0 \
--width "${VIDEO_WIDTH}" \
--height "${VIDEO_HEIGHT}" \
--framerate "${VIDEO_FPS}" \
--bitrate "${VIDEO_BITRATE}" \
--codec h264 \
--profile baseline \
--denoise cdn_off \
--nopreview \
--output - \
| "${FFMPEG_BIN_PATH}" \
-hide_banner \
-loglevel warning \
-fflags nobuffer \
-use_wallclock_as_timestamps 1 \
-f h264 \
-i pipe:0 \
-c:v copy \
-an \
-flush_packets 1 \
-f mpegts \
"${PUBLISH_URL}"
"${LIBCAMERA_BIN_PATH}" \
--inline \
--timeout 0 \
"${MODE_ARGS[@]}" \
--width "${VIDEO_WIDTH}" \
--height "${VIDEO_HEIGHT}" \
"${FLIP_ARGS[@]}" \
--framerate "${VIDEO_FPS}" \
--bitrate "${VIDEO_BITRATE}" \
--codec h264 \
--profile baseline \
--denoise auto \
--nopreview \
--metering centre \
--ev 0.1 \
--awb auto \
--saturation 0.6 \
--brightness 0 \
--output - \
| "${FFMPEG_BIN_PATH}" \
-hide_banner \
-loglevel warning \
-fflags nobuffer \
-use_wallclock_as_timestamps 1 \
-f h264 \
-i pipe:0 \
-c:v copy \
-an \
-flush_packets 1 \
-f mpegts \
"${PUBLISH_URL}"
}
while true; do
if run_pipeline; then
exit 0
fi
echo "Video publisher exited, restarting in 2s..." >&2
sleep 2
if run_pipeline; then
exit 0
fi
echo "Video publisher exited, restarting in 2s..." >&2
sleep 2
done
+134 -14
View File
@@ -20,8 +20,8 @@ Options:
The script must run from the repository root and as root (sudo). It will:
* create system users/groups if needed
* install /usr/local/bin/roverd and /etc/roverd.yaml
* install /usr/local/bin/video-publisher and its systemd unit
* enable roverd.service and video-publisher.service
* install /usr/local/bin/video/audio helpers and systemd units
* enable roverd.service and media publisher/listener services
USAGE
}
@@ -94,7 +94,39 @@ install_video_deps() {
apt-get install -y --no-install-recommends libcamera-apps ffmpeg
}
ensure_user roverd "dialout,gpio,video,render"
find_boot_config() {
if [[ -f /boot/firmware/config.txt ]]; then
printf "/boot/firmware/config.txt"
return 0
fi
if [[ -f /boot/config.txt ]]; then
printf "/boot/config.txt"
return 0
fi
return 1
}
ensure_pwm_overlay() {
local boot_config
if ! boot_config="$(find_boot_config)"; then
log "WARNING: unable to locate /boot config.txt; please ensure dtoverlay=pwm-2chan is added manually for servo support"
return
fi
if grep -Eq '^\s*dtoverlay=pwm(-2chan)?' "$boot_config"; then
log "PWM overlay already present in $boot_config"
return
fi
local backup="${boot_config}.roverd.$(date +%Y%m%d%H%M%S).bak"
cp "$boot_config" "$backup"
{
echo ""
echo "# Added by roverd installer to expose PWM hardware for camera servo control on GPIO12/13 (leaves GPIO18/19 free for I2S)"
echo "dtoverlay=pwm-2chan,pin=12,func=4,pin2=13,func2=4"
} >> "$boot_config"
log "Enabled dtoverlay=pwm-2chan on GPIO12/13 in $boot_config (backup at $backup). Reboot required for changes to apply."
}
ensure_user roverd "dialout,gpio,video,render,audio"
install -o roverd -g roverd -m 0755 "$BINARY_SRC" /usr/local/bin/roverd
log "Installed roverd binary"
@@ -112,33 +144,121 @@ install -m 0644 pi/systemd/roverd.service /etc/systemd/system/roverd.service
log "Installed roverd systemd unit"
install_video_deps
ensure_pwm_overlay
# Enable Google AIY v1 sound card, ALSA defaults, and TTS engines
install_audio_support() {
local boot_config
if ! boot_config="$(find_boot_config)"; then
log "WARNING: unable to locate /boot config.txt; please enable googlevoicehat-soundcard overlay manually"
else
# Ensure onboard audio is disabled (prevents card index flapping)
if grep -Eq '^\s*dtparam=audio=on\b' "$boot_config"; then
log "Disabling onboard audio (dtparam=audio=on -> off) in $boot_config"
sed -i 's/^\s*dtparam=audio=on\b/# roverd disabled onboard audio\ndtparam=audio=off/' "$boot_config"
fi
if ! grep -Eq '^\s*dtparam=audio=off\b' "$boot_config"; then
log "Adding dtparam=audio=off to $boot_config"
echo "dtparam=audio=off" >> "$boot_config"
fi
if ! grep -Eq '^\s*dtparam=i2s=on\b' "$boot_config"; then
log "Adding dtparam=i2s=on to $boot_config"
echo "dtparam=i2s=on" >> "$boot_config"
fi
if ! grep -Eq '^\s*dtoverlay=googlevoicehat-soundcard\b' "$boot_config"; then
local backup="${boot_config}.roverd.$(date +%Y%m%d%H%M%S).bak"
cp "$boot_config" "$backup"
{
echo ""
echo "# Added by roverd installer to enable Google AIY v1 sound card"
echo "dtoverlay=googlevoicehat-soundcard"
} >> "$boot_config"
log "Enabled googlevoicehat-soundcard overlay in $boot_config (backup at $backup). Reboot required."
else
log "googlevoicehat-soundcard overlay already present in $boot_config"
fi
fi
if [[ -f pi/asound.conf ]]; then
install -m 0644 pi/asound.conf /etc/asound.conf
log "Installed ALSA config to /etc/asound.conf"
alsa_reload_notice=1
else
log "WARNING: pi/asound.conf missing; skipping ALSA config install"
fi
if [[ "${alsa_reload_notice:-0}" -eq 1 ]]; then
log "ALSA config updated; reboot recommended for overlay + audio changes"
fi
log "Installing TTS/audio packages (flite, espeak)..."
# check for flite and espeak before installing, and then install them if either is missing
if command -v flite >/dev/null 2>&1 && command -v espeak >/dev/null 2>&1; then
log "TTS packages flite and espeak already installed; skipping apt install"
return
fi
apt-get update
apt-get install -y --no-install-recommends flite espeak
}
# Install video publisher assets
install -D -o root -g root -m 0755 pi/bin/video-publisher.sh /usr/local/bin/video-publisher
log "Installed video-publisher helper"
install -m 0644 pi/systemd/video-publisher.service /etc/systemd/system/video-publisher.service
log "Installed video-publisher systemd unit"
# Install audio-only publisher assets
install -D -o root -g root -m 0755 pi/bin/audio-only-publisher.sh /usr/local/bin/audio-only-publisher
install -m 0644 pi/systemd/audio-only-publisher.service /etc/systemd/system/audio-only-publisher.service
log "Installed audio-only publisher helper + systemd unit"
# Install audio-forward listener assets
install -D -o root -g root -m 0755 pi/bin/audio-forward-listener.sh /usr/local/bin/audio-forward-listener
install -m 0644 pi/systemd/audio-forward-listener.service /etc/systemd/system/audio-forward-listener.service
log "Installed audio-forward listener helper + systemd unit"
install -d -o roverd -g roverd /var/lib/roverd
if [[ ! -f /var/lib/roverd/video.env ]]; then
cat > /var/lib/roverd/video.env <<'ENV'
cat > /var/lib/roverd/video.env <<'ENV'
# Managed by roverd; placeholder values will be overwritten at runtime.
PUBLISH_URL=srt://192.168.0.86:9000?streamid=#!::r=CHANGE_ME,m=publish&latency=20&mode=caller&transtype=live&pkt_size=1316
VIDEO_WIDTH=1280
VIDEO_HEIGHT=720
VIDEO_FPS=30
VIDEO_BITRATE=3000000
PUBLISH_URL=srt://192.168.0.86:9000?streamid=#!::r=CHANGE_ME,m=publish&latency=10&mode=caller&transtype=live&pkt_size=1316
AUDIO_PUBLISH_URL=srt://192.168.0.86:9000?streamid=#!::r=CHANGE_ME-audio,m=publish&latency=10&mode=caller&transtype=live&pkt_size=1316
AUDIO_FORWARD_URL=srt://192.168.0.86:9000?streamid=#!::r=CHANGE_ME-fwd,m=request&latency=10&mode=caller&transtype=live&pkt_size=1316
VIDEO_BITRATE=2000000
AUDIO_ENABLE=0
AUDIO_DEVICE=hw:0,0
AUDIO_PLAYBACK_DEVICE=forward
AUDIO_RATE=48000
AUDIO_CHANNELS=2
ENV
chown roverd:roverd /var/lib/roverd/video.env
chmod 0640 /var/lib/roverd/video.env
chown roverd:roverd /var/lib/roverd/video.env
chmod 0640 /var/lib/roverd/video.env
# Create persistent audio FIFO for capture -> publisher
FIFO_PATH="/var/lib/roverd/audio.pcm"
if [[ -p "$FIFO_PATH" ]]; then
chown roverd:audio "$FIFO_PATH"
chmod 0660 "$FIFO_PATH"
else
rm -f "$FIFO_PATH"
mkfifo "$FIFO_PATH"
chown roverd:audio "$FIFO_PATH"
chmod 0660 "$FIFO_PATH"
fi
# Ensure ALSA config is in place for rovermic device
install -m 0644 pi/asound.conf /etc/asound.conf
log "Installed ALSA config (/etc/asound.conf)"
install_audio_support
systemctl daemon-reload
systemctl enable roverd.service
systemctl enable video-publisher.service
systemctl enable audio-only-publisher.service
systemctl enable audio-forward-listener.service
if [[ $CONFIG_EXISTS -eq 1 ]]; then
systemctl restart roverd.service
systemctl restart video-publisher.service
log "Restarted roverd + video publisher"
systemctl restart audio-only-publisher.service
systemctl restart audio-forward-listener.service
log "Restarted roverd + media publishers/listener"
else
log "Skipped auto-start because config is the sample; edit $CONFIG_DEST then run: sudo systemctl restart roverd video-publisher"
log "Skipped auto-start because config is the sample; edit $CONFIG_DEST then run: sudo systemctl restart roverd video-publisher audio-only-publisher audio-forward-listener"
fi
log "Install complete"
+3 -1
View File
@@ -10,9 +10,11 @@ build:
pi-build:
GOOS=$(GOOS) GOARCH=$(GOARCH) GOARM=$(GOARM) go build -trimpath -ldflags="-s -w" -o $(BIN_DIR)/roverd ./cmd/roverd
GOOS=$(GOOS) GOARCH=$(GOARCH) GOARM=$(GOARM) go build -trimpath -ldflags="-s -w" -o $(BIN_DIR)/servoverifier ./cmd/servoverifier
GOOS=$(GOOS) GOARCH=$(GOARCH) GOARM=$(GOARM) go build -trimpath -ldflags="-s -w" -o $(BIN_DIR)/hornverifier ./cmd/hornverifier
dummy:
GOOS=linux GOARCH=amd64 go build -tags dummy -o $(BIN_DIR)/roverd-dummy ./cmd/roverd
clean:
rm -f $(BIN_DIR)/roverd
rm -f $(BIN_DIR)/roverd $(BIN_DIR)/servoverifier $(BIN_DIR)/hornverifier
+117
View File
@@ -0,0 +1,117 @@
package roverd
import (
"fmt"
"math"
"os/exec"
)
type AudioLevels struct {
HornGain float64
TTSGain float64
ForwardGain float64
}
func clampAudioGain(v float64) float64 {
if v < 0 {
return 0
}
if v > 4 {
return 4
}
return v
}
func normalizeAudioLevels(v AudioLevels) AudioLevels {
v.HornGain = clampAudioGain(v.HornGain)
v.TTSGain = clampAudioGain(v.TTSGain)
v.ForwardGain = clampAudioGain(v.ForwardGain)
return v
}
func (c *WSClient) getAudioLevels() AudioLevels {
c.audioMu.RLock()
defer c.audioMu.RUnlock()
return c.audioLevels
}
func (c *WSClient) setAudioLevels(next AudioLevels) {
normalized := normalizeAudioLevels(next)
c.audioMu.Lock()
c.audioLevels = normalized
c.audioMu.Unlock()
c.applyAudioLevelsToMixer(normalized)
}
func (c *WSClient) handleAudioLevels(payload *audioLevelsPayload) error {
if payload == nil {
return nil
}
levels := c.getAudioLevels()
if payload.HornGain != nil {
levels.HornGain = clampAudioGain(*payload.HornGain)
}
if payload.TTSGain != nil {
levels.TTSGain = clampAudioGain(*payload.TTSGain)
}
if payload.ForwardGain != nil {
levels.ForwardGain = clampAudioGain(*payload.ForwardGain)
}
c.setAudioLevels(levels)
return nil
}
func (c *WSClient) applyAudioLevelsToMixer(levels AudioLevels) {
c.applyMixerGain("HornMaster", levels.HornGain)
c.applyMixerGain("TTSMaster", levels.TTSGain)
c.applyMixerGain("ForwardMaster", levels.ForwardGain)
}
func (c *WSClient) applyMixerGain(control string, gain float64) {
normalized := clampAudioGain(gain)
if normalized <= 0 {
if err := c.trySetMixerControl(control, "0%"); err != nil {
c.log.Printf("audio-levels: amixer mute %s failed: %v", control, err)
}
return
}
// Convert linear gain to dB, matching softvol max_dB=12.0 in /etc/asound.conf.
db := 20.0 * math.Log10(normalized)
if db > 12.0 {
db = 12.0
}
if db < -60.0 {
db = -60.0
}
// amixer treats a leading "-" value as an option; set via percent to avoid getopt ambiguity.
percent := int(math.Round((db + 60.0) / 72.0 * 100.0))
if percent < 0 {
percent = 0
}
if percent > 100 {
percent = 100
}
percentArg := fmt.Sprintf("%d%%", percent)
if err := c.trySetMixerControl(control, percentArg); err != nil {
c.log.Printf("audio-levels: amixer set %s=%s failed: %v", control, percentArg, err)
}
}
func (c *WSClient) trySetMixerControl(control, value string) error {
// Prefer the active ALSA default route; fall back to card index for compatibility.
candidates := [][]string{
{"-q", "-D", "default", "sset", control, value},
{"-q", "-c", "0", "sset", control, value},
}
var lastErr error
for _, args := range candidates {
out, err := exec.Command("amixer", args...).CombinedOutput()
if err == nil {
return nil
}
lastErr = fmt.Errorf("%w (%s)", err, string(out))
}
return lastErr
}
+1 -1
View File
@@ -7,7 +7,7 @@ import (
)
const (
autoChargeTimeout = 10 * time.Second
autoChargeTimeout = 5 * time.Second
autoChargeCooldown = 0 * time.Minute
sourceHomeBase = 1 << 1
)
+227
View File
@@ -0,0 +1,227 @@
//go:build !dummy
package roverd
import (
"fmt"
"log"
"math"
"sync"
"time"
rpio "github.com/stianeikeland/go-rpio/v4"
)
type CameraServo struct {
cfg CameraServoConfig
logger *log.Logger
pin rpio.Pin
mu sync.Mutex
currentAngle float64
desiredAngle float64
lastMove time.Time
moving bool
stopCh chan struct{}
closed bool
}
const maxServoDegPerSec = 60.0
const servoStepInterval = 20 * time.Millisecond
const servoAngleEpsilon = 0.01
func NewCameraServo(cfg CameraServoConfig, logger *log.Logger) (*CameraServo, error) {
if !cfg.Enabled {
return nil, fmt.Errorf("camera servo disabled")
}
if err := rpio.Open(); err != nil {
return nil, fmt.Errorf("open gpio: %w", err)
}
pin := rpio.Pin(cfg.Pin)
pin.Mode(rpio.Pwm)
targetClock := cfg.FreqHz * cfg.CycleLen
pin.Freq(targetClock)
servo := &CameraServo{
cfg: cfg,
logger: logger,
pin: pin,
stopCh: make(chan struct{}),
}
if err := servo.setAngleLocked(cfg.HomeAngle); err != nil {
rpio.Close()
return nil, err
}
logger.Printf("camera servo initialized on GPIO %d (%.1f..%.1f deg, %d..%d us, invert=%v)", cfg.Pin, cfg.MinAngle, cfg.MaxAngle, cfg.MinPulseUs, cfg.MaxPulseUs, cfg.Invert)
return servo, nil
}
func (s *CameraServo) Close() {
s.mu.Lock()
defer s.mu.Unlock()
if s.closed {
return
}
s.applyPulseLocked(s.angleToPulse(s.cfg.HomeAngle))
rpio.Close()
if s.stopCh != nil {
close(s.stopCh)
s.stopCh = nil
}
s.closed = true
}
func (s *CameraServo) SetAngle(angle float64) error {
s.mu.Lock()
defer s.mu.Unlock()
return s.setAngleLocked(angle)
}
func (s *CameraServo) setAngleLocked(angle float64) error {
if s.closed {
return fmt.Errorf("servo closed")
}
clamped := clampFloat(angle, s.cfg.MinAngle, s.cfg.MaxAngle)
s.desiredAngle = clamped
limited := s.rateLimitAngleLocked(clamped)
s.applyPulseLocked(s.angleToPulse(limited))
s.currentAngle = limited
if math.Abs(limited-s.desiredAngle) > servoAngleEpsilon {
s.startMoveLoopLocked()
}
return nil
}
func (s *CameraServo) Nudge(delta float64) error {
s.mu.Lock()
defer s.mu.Unlock()
if delta == 0 {
delta = s.cfg.NudgeDegrees
}
target := s.currentAngle + delta
return s.setAngleLocked(target)
}
func (s *CameraServo) SetPulseWidth(micros int) error {
s.mu.Lock()
defer s.mu.Unlock()
if s.closed {
return fmt.Errorf("servo closed")
}
if !s.cfg.AllowRawPulse {
return fmt.Errorf("raw pulse commands disabled")
}
if micros <= 0 {
return fmt.Errorf("pulse width must be > 0")
}
clampedPulse := clampInt(micros, s.cfg.MinPulseUs, s.cfg.MaxPulseUs)
targetAngle := s.pulseToAngle(clampedPulse)
s.desiredAngle = targetAngle
limited := s.rateLimitAngleLocked(targetAngle)
s.applyPulseLocked(s.angleToPulse(limited))
s.currentAngle = limited
if math.Abs(limited-s.desiredAngle) > servoAngleEpsilon {
s.startMoveLoopLocked()
}
return nil
}
func (s *CameraServo) CurrentAngle() float64 {
s.mu.Lock()
defer s.mu.Unlock()
return s.currentAngle
}
func (s *CameraServo) applyPulseLocked(micros int) {
micros = clampInt(micros, s.cfg.MinPulseUs, s.cfg.MaxPulseUs)
s.pin.DutyCycle(uint32(micros), uint32(s.cfg.CycleLen))
}
func (s *CameraServo) startMoveLoopLocked() {
if s.moving || s.stopCh == nil {
return
}
s.moving = true
go func() {
ticker := time.NewTicker(servoStepInterval)
defer ticker.Stop()
for {
select {
case <-ticker.C:
s.mu.Lock()
if s.closed {
s.moving = false
s.mu.Unlock()
return
}
if math.Abs(s.currentAngle-s.desiredAngle) <= servoAngleEpsilon {
s.moving = false
s.mu.Unlock()
return
}
limited := s.rateLimitAngleLocked(s.desiredAngle)
s.applyPulseLocked(s.angleToPulse(limited))
s.currentAngle = limited
s.mu.Unlock()
case <-s.stopCh:
return
}
}
}()
}
func (s *CameraServo) rateLimitAngleLocked(target float64) float64 {
now := time.Now()
if s.lastMove.IsZero() {
s.lastMove = now
}
elapsed := now.Sub(s.lastMove).Seconds()
if elapsed <= 0 {
s.lastMove = now
return s.currentAngle
}
maxElapsed := servoStepInterval.Seconds()
if elapsed > maxElapsed {
elapsed = maxElapsed
}
maxDelta := maxServoDegPerSec * elapsed
delta := target - s.currentAngle
if math.Abs(delta) <= maxDelta {
s.lastMove = now
return target
}
if delta > 0 {
target = s.currentAngle + maxDelta
} else {
target = s.currentAngle - maxDelta
}
s.lastMove = now
return target
}
func (s *CameraServo) angleToPulse(angle float64) int {
totalRange := s.cfg.MaxAngle - s.cfg.MinAngle
if totalRange == 0 {
return s.cfg.MinPulseUs
}
norm := (angle - s.cfg.MinAngle) / totalRange
norm = math.Max(0, math.Min(1, norm))
if s.cfg.Invert {
norm = 1 - norm
}
pulseRange := s.cfg.MaxPulseUs - s.cfg.MinPulseUs
return s.cfg.MinPulseUs + int(math.Round(norm*float64(pulseRange)))
}
func (s *CameraServo) pulseToAngle(pulse int) float64 {
pulseRange := s.cfg.MaxPulseUs - s.cfg.MinPulseUs
if pulseRange == 0 {
return s.cfg.MinAngle
}
norm := float64(pulse-s.cfg.MinPulseUs) / float64(pulseRange)
norm = math.Max(0, math.Min(1, norm))
if s.cfg.Invert {
norm = 1 - norm
}
return s.cfg.MinAngle + norm*(s.cfg.MaxAngle-s.cfg.MinAngle)
}
+32
View File
@@ -0,0 +1,32 @@
//go:build dummy
package roverd
import (
"fmt"
"log"
)
type CameraServo struct{}
func NewCameraServo(cfg CameraServoConfig, logger *log.Logger) (*CameraServo, error) {
return nil, fmt.Errorf("camera servo not supported in dummy build")
}
func (c *CameraServo) Close() {}
func (c *CameraServo) SetAngle(angle float64) error {
return fmt.Errorf("camera servo disabled")
}
func (c *CameraServo) Nudge(delta float64) error {
return fmt.Errorf("camera servo disabled")
}
func (c *CameraServo) SetPulseWidth(micros int) error {
return fmt.Errorf("camera servo disabled")
}
func (c *CameraServo) CurrentAngle() float64 {
return 0
}
+11
View File
@@ -0,0 +1,11 @@
package roverd
func clampInt(value, min, max int) int {
if value < min {
return min
}
if value > max {
return max
}
return value
}
+187
View File
@@ -0,0 +1,187 @@
package main
import (
"bufio"
"encoding/binary"
"flag"
"fmt"
"log"
"math"
"os/exec"
"strconv"
"strings"
"time"
)
const twoPi = 2 * math.Pi
func main() {
var (
device = flag.String("device", "", "ALSA device (empty = default)")
rate = flag.Int("rate", 48000, "Sample rate in Hz")
channels = flag.Int("channels", 1, "Number of audio channels")
duration = flag.Duration("duration", 2*time.Second, "Total horn duration")
freqsRaw = flag.String("freqs", "440,550,660", "Comma-separated frequencies in Hz")
volume = flag.Float64("volume", 0.25, "Output volume 0.0-1.0")
attack = flag.Duration("attack", 20*time.Millisecond, "Attack time")
release = flag.Duration("release", 60*time.Millisecond, "Release time")
)
flag.Parse()
if *rate <= 0 {
log.Fatalf("rate must be > 0 (got %d)", *rate)
}
if *channels <= 0 {
log.Fatalf("channels must be > 0 (got %d)", *channels)
}
if *duration <= 0 {
log.Fatalf("duration must be > 0 (got %s)", *duration)
}
if *volume <= 0 || *volume > 1.0 {
log.Fatalf("volume must be within (0,1] (got %.3f)", *volume)
}
if *attack < 0 || *release < 0 {
log.Fatalf("attack/release must be >= 0")
}
freqs, err := parseFreqs(*freqsRaw)
if err != nil {
log.Fatalf("parse freqs: %v", err)
}
if len(freqs) == 0 {
log.Fatal("no frequencies provided")
}
if *attack+*release > *duration {
log.Fatalf("attack+release must be <= duration (%s + %s > %s)", *attack, *release, *duration)
}
args := []string{"-q", "-f", "S16_LE", "-c", fmt.Sprintf("%d", *channels), "-r", fmt.Sprintf("%d", *rate), "-t", "raw"}
if *device != "" {
args = append(args, "-D", *device)
}
cmd := exec.Command("aplay", args...)
stdin, err := cmd.StdinPipe()
if err != nil {
log.Fatalf("aplay stdin: %v", err)
}
if err := cmd.Start(); err != nil {
log.Fatalf("start aplay: %v", err)
}
writer := bufio.NewWriterSize(stdin, 32*1024)
if err := synthChord(writer, freqs, *rate, *channels, *duration, *volume, *attack, *release); err != nil {
_ = stdin.Close()
_ = cmd.Wait()
log.Fatalf("synth: %v", err)
}
if err := writer.Flush(); err != nil {
_ = stdin.Close()
_ = cmd.Wait()
log.Fatalf("flush: %v", err)
}
if err := stdin.Close(); err != nil {
_ = cmd.Wait()
log.Fatalf("close stdin: %v", err)
}
if err := cmd.Wait(); err != nil {
log.Fatalf("aplay failed: %v", err)
}
log.Print("Horn verification complete")
}
func parseFreqs(raw string) ([]float64, error) {
trimmed := strings.TrimSpace(raw)
if trimmed == "" {
return nil, nil
}
parts := strings.Split(trimmed, ",")
freqs := make([]float64, 0, len(parts))
for _, part := range parts {
part = strings.TrimSpace(part)
if part == "" {
continue
}
value, err := strconv.ParseFloat(part, 64)
if err != nil {
return nil, fmt.Errorf("invalid freq %q", part)
}
if value <= 0 {
return nil, fmt.Errorf("freq must be > 0 (got %.3f)", value)
}
freqs = append(freqs, value)
}
return freqs, nil
}
func synthChord(writer *bufio.Writer, freqs []float64, rate, channels int, duration time.Duration, volume float64, attack, release time.Duration) error {
totalFrames := int(float64(rate) * duration.Seconds())
if totalFrames <= 0 {
return fmt.Errorf("duration too short")
}
phase := make([]float64, len(freqs))
increment := make([]float64, len(freqs))
for i, f := range freqs {
increment[i] = twoPi * f / float64(rate)
}
attackFrames := int(float64(rate) * attack.Seconds())
releaseFrames := int(float64(rate) * release.Seconds())
steadyFrames := totalFrames - attackFrames - releaseFrames
framesPerChunk := 512
buf := make([]byte, framesPerChunk*channels*2)
sampleIndex := 0
scale := volume / float64(len(freqs))
for framesLeft := totalFrames; framesLeft > 0; {
framesNow := framesPerChunk
if framesLeft < framesNow {
framesNow = framesLeft
}
for i := 0; i < framesNow; i++ {
env := envelope(sampleIndex, attackFrames, steadyFrames, releaseFrames)
sample := 0.0
for j := range freqs {
sample += sawFromPhase(phase[j])
phase[j] += increment[j]
if phase[j] > twoPi {
phase[j] -= twoPi
}
}
sample *= scale * env
if sample > 1.0 {
sample = 1.0
} else if sample < -1.0 {
sample = -1.0
}
intSample := int16(sample * math.MaxInt16)
offset := i * channels * 2
for ch := 0; ch < channels; ch++ {
binary.LittleEndian.PutUint16(buf[offset+ch*2:], uint16(intSample))
}
sampleIndex++
}
if _, err := writer.Write(buf[:framesNow*channels*2]); err != nil {
return err
}
framesLeft -= framesNow
}
return nil
}
func envelope(sampleIndex, attackFrames, steadyFrames, releaseFrames int) float64 {
if attackFrames > 0 && sampleIndex < attackFrames {
return float64(sampleIndex) / float64(attackFrames)
}
if releaseFrames > 0 && sampleIndex >= attackFrames+steadyFrames {
relIndex := sampleIndex - (attackFrames + steadyFrames)
return float64(releaseFrames-relIndex) / float64(releaseFrames)
}
return 1.0
}
func sawFromPhase(phase float64) float64 {
return 2.0*(phase/twoPi) - 1.0
}
+21 -3
View File
@@ -21,7 +21,7 @@ func main() {
if err != nil {
log.Fatalf("load config: %v", err)
}
if err := roverd.UpdatePublisherEnv(cfg.Media); err != nil {
if err := roverd.UpdatePublisherEnv(cfg.Media, cfg.Audio); err != nil {
log.Fatalf("prepare media env: %v", err)
}
@@ -55,15 +55,33 @@ func main() {
adapter := roverd.NewSerialAdapter(serialPort, logger)
mediaSupervisor := roverd.NewMediaSupervisor(cfg.Media, logger)
mediaSupervisor := roverd.NewMediaSupervisor(cfg.Media, cfg.Audio, logger)
if mediaSupervisor != nil {
mediaSupervisor.Start(ctx)
}
var cameraServo *roverd.CameraServo
if cfg.CameraServo.Enabled {
cameraServo, err = roverd.NewCameraServo(cfg.CameraServo, logger)
if err != nil {
logger.Fatalf("init camera servo: %v", err)
}
defer cameraServo.Close()
}
var nightVision *roverd.NightVisionLight
if cfg.NightVision.Enabled {
nightVision, err = roverd.NewNightVisionLight(cfg.NightVision, logger)
if err != nil {
logger.Fatalf("init night vision: %v", err)
}
defer nightVision.Close()
}
autoCharge := roverd.NewAutoChargeController(adapter, eventStream, logger)
go autoCharge.Run(ctx, sensorSamples)
client := roverd.NewWSClient(cfg, adapter, sensorFrames, eventStream, mediaSupervisor, logger)
client := roverd.NewWSClient(cfg, adapter, sensorFrames, eventStream, mediaSupervisor, cameraServo, nightVision, logger)
retryDelay := time.Second
for ctx.Err() == nil {
+95
View File
@@ -0,0 +1,95 @@
package main
import (
"flag"
"log"
"time"
rpio "github.com/stianeikeland/go-rpio/v4"
)
func main() {
var (
pinNum = flag.Int("pin", 19, "BCM pin connected to the servo signal line")
freqHz = flag.Int("freq", 50, "Servo PWM frequency in Hz")
cycleLen = flag.Int("cycle", 20000, "PWM cycle length (counts per period)")
minPulse = flag.Int("min", 900, "Minimum pulse width in microseconds")
maxPulse = flag.Int("max", 2100, "Maximum pulse width in microseconds")
stepPulse = flag.Int("step", 100, "Pulse width increment in microseconds when sweeping")
sweeps = flag.Int("sweeps", 2, "How many full min→max→min sweeps to perform")
pause = flag.Duration("pause", 150*time.Millisecond, "Delay between pulse adjustments")
holdPulse = flag.Int("hold", 0, "Pulse width to hold before exiting (0 = midpoint of min/max)")
)
flag.Parse()
if *freqHz <= 0 || *cycleLen <= 0 {
log.Fatalf("invalid freq (%d) or cycle (%d)", *freqHz, *cycleLen)
}
if *minPulse <= 0 || *maxPulse <= 0 || *minPulse >= *maxPulse {
log.Fatalf("invalid min/max pulses (%d/%d)", *minPulse, *maxPulse)
}
if *stepPulse <= 0 {
log.Fatalf("step must be > 0 (got %d)", *stepPulse)
}
if *pause <= 0 {
log.Fatalf("pause must be > 0 (got %s)", pause)
}
if *sweeps < 0 {
log.Fatalf("sweeps must be >= 0 (got %d)", *sweeps)
}
if err := rpio.Open(); err != nil {
log.Fatalf("open gpio: %v", err)
}
defer rpio.Close()
pin := rpio.Pin(*pinNum)
pin.Mode(rpio.Pwm)
targetClock := *freqHz * *cycleLen
pin.Freq(targetClock)
log.Printf("Configured PWM pin %d at %d Hz (clock=%d Hz, cycle=%d)", *pinNum, *freqHz, targetClock, *cycleLen)
setPulse := func(us int) {
clamped := clamp(us, *minPulse, *maxPulse)
pin.DutyCycle(uint32(clamped), uint32(*cycleLen))
log.Printf("pulse -> %dµs", clamped)
}
mid := (*minPulse + *maxPulse) / 2
setPulse(mid)
runSweep := func() {
for pulse := *minPulse; pulse <= *maxPulse; pulse += *stepPulse {
setPulse(pulse)
time.Sleep(*pause)
}
for pulse := *maxPulse - *stepPulse; pulse >= *minPulse; pulse -= *stepPulse {
setPulse(pulse)
time.Sleep(*pause)
}
}
for i := 0; i < *sweeps; i++ {
log.Printf("Sweep %d/%d", i+1, *sweeps)
runSweep()
}
finalPulse := *holdPulse
if finalPulse <= 0 {
finalPulse = mid
}
setPulse(finalPulse)
log.Printf("Holding at %dµs", clamp(finalPulse, *minPulse, *maxPulse))
log.Print("Servo verification complete")
}
func clamp(value, min, max int) int {
if value < min {
return min
}
if value > max {
return max
}
return value
}
+63 -5
View File
@@ -1,11 +1,17 @@
package roverd
type helloMessage struct {
Type string `json:"type"`
Name string `json:"name"`
Battery BatteryConfig `json:"battery"`
MaxWheelSpeed int `json:"maxWheelSpeed"`
Media MediaConfig `json:"media"`
Type string `json:"type"`
Name string `json:"name"`
Color string `json:"color,omitempty"`
Battery BatteryConfig `json:"battery"`
MaxWheelSpeed int `json:"maxWheelSpeed"`
Media MediaConfig `json:"media"`
CameraServo CameraServoConfig `json:"cameraServo"`
Audio AudioConfig `json:"audio"`
Horn HornConfig `json:"horn"`
NightVision NightVisionConfig `json:"nightVision"`
Private PrivateConfig `json:"private"`
}
type sensorMessage struct {
@@ -22,6 +28,13 @@ type inboundMessage struct {
Raw string `json:"raw,omitempty"`
SensorStream *sensorStreamPayload `json:"sensorStream,omitempty"`
Media *mediaCommand `json:"media,omitempty"`
Servo *servoPayload `json:"servo,omitempty"`
TTS *ttsPayload `json:"tts,omitempty"`
Horn *hornPayload `json:"horn,omitempty"`
AudioLevels *audioLevelsPayload `json:"audioLevels,omitempty"`
NightVision *nightVisionPayload `json:"nightVision,omitempty"`
Song *songPayload `json:"song,omitempty"`
Reboot *rebootPayload `json:"reboot,omitempty"`
}
type driveDirectPayload struct {
@@ -43,6 +56,51 @@ type mediaCommand struct {
Action string `json:"action"`
}
type servoPayload struct {
Angle *float64 `json:"angle,omitempty"`
Nudge *float64 `json:"nudge,omitempty"`
PulseUs *int `json:"pulseUs,omitempty"`
}
type ttsPayload struct {
Text string `json:"text"`
Engine string `json:"engine,omitempty"`
Voice string `json:"voice,omitempty"`
Pitch int `json:"pitch,omitempty"`
Speak bool `json:"speak,omitempty"`
}
type hornPayload struct {
Action string `json:"action"`
Waveform string `json:"waveform,omitempty"`
Freqs []float64 `json:"freqs,omitempty"`
}
type audioLevelsPayload struct {
HornGain *float64 `json:"hornGain,omitempty"`
TTSGain *float64 `json:"ttsGain,omitempty"`
ForwardGain *float64 `json:"forwardGain,omitempty"`
}
type nightVisionPayload struct {
Action string `json:"action"`
}
type songPayload struct {
Slot *int `json:"slot,omitempty"`
Notes []songNote `json:"notes"`
Loop bool `json:"loop,omitempty"`
}
type songNote struct {
Note int `json:"note"`
Duration int `json:"duration"`
}
type rebootPayload struct {
DelayMs int `json:"delayMs,omitempty"`
}
type ackMessage struct {
Type string `json:"type"`
ID string `json:"id"`
+333 -36
View File
@@ -5,6 +5,8 @@ import (
"fmt"
"net/url"
"os"
"regexp"
"strings"
"time"
"gopkg.in/yaml.v3"
@@ -53,27 +55,109 @@ type BatteryConfig struct {
Urgent int `yaml:"urgent"`
}
type AudioConfig struct {
CaptureEnabled bool `yaml:"captureEnabled" json:"captureEnabled"`
CaptureDevice string `yaml:"captureDevice" json:"captureDevice,omitempty"`
PlaybackDevice string `yaml:"playbackDevice" json:"playbackDevice,omitempty"`
SampleRate int `yaml:"sampleRate" json:"sampleRate,omitempty"`
Channels int `yaml:"channels" json:"channels,omitempty"`
Bitrate int `yaml:"bitrate" json:"bitrate,omitempty"`
TTSEnabled bool `yaml:"ttsEnabled" json:"ttsEnabled"`
DefaultEngine string `yaml:"defaultEngine" json:"defaultEngine,omitempty"`
DefaultVoice string `yaml:"defaultVoice" json:"defaultVoice,omitempty"`
DefaultPitch int `yaml:"defaultPitch" json:"defaultPitch,omitempty"`
}
type HornConfig struct {
Enabled bool `yaml:"enabled" json:"enabled"`
Volume float64 `yaml:"volume" json:"-"`
SampleRate int `yaml:"sampleRate" json:"-"`
Channels int `yaml:"channels" json:"-"`
Device string `yaml:"device" json:"-"`
SineGain float64 `yaml:"sineGain" json:"-"`
SawGain float64 `yaml:"sawGain" json:"-"`
MaxDuration Duration `yaml:"maxDuration" json:"-"`
}
type MediaConfig struct {
PublishURL string `yaml:"publishUrl" json:"publishUrl,omitempty"`
PublishPort int `yaml:"publishPort" json:"-"`
Manage bool `yaml:"manage"`
Service string `yaml:"service"`
HealthURL string `yaml:"healthUrl"`
HealthInterval Duration `yaml:"healthInterval"`
VideoWidth int `yaml:"videoWidth" json:"-"`
VideoHeight int `yaml:"videoHeight" json:"-"`
VideoFPS int `yaml:"videoFps" json:"-"`
VideoBitrate int `yaml:"videoBitrate" json:"-"`
PublishURL string `yaml:"publishUrl" json:"publishUrl,omitempty"`
AudioPublishURL string `yaml:"audioPublishUrl" json:"audioPublishUrl,omitempty"`
AudioForwardURL string `yaml:"audioForwardUrl" json:"audioForwardUrl,omitempty"`
PublishPort int `yaml:"publishPort" json:"-"`
CameraInverted bool `yaml:"cameraInverted" json:"-"`
Manage bool `yaml:"manage"`
ManageAudio bool `yaml:"manageAudio"`
Service string `yaml:"service"`
AudioService string `yaml:"audioService"`
HealthURL string `yaml:"healthUrl"`
HealthInterval Duration `yaml:"healthInterval"`
VideoWidth int `yaml:"videoWidth" json:"-"`
VideoHeight int `yaml:"videoHeight" json:"-"`
VideoFPS int `yaml:"videoFps" json:"-"`
VideoBitrate int `yaml:"videoBitrate" json:"-"`
}
type CameraServoConfig struct {
Enabled bool `yaml:"enabled" json:"enabled"`
Pin int `yaml:"pin" json:"pin"`
FreqHz int `yaml:"freqHz" json:"freqHz"`
CycleLen int `yaml:"cycleLen" json:"cycleLen"`
MinPulseUs int `yaml:"minPulseUs" json:"minPulseUs"`
MaxPulseUs int `yaml:"maxPulseUs" json:"maxPulseUs"`
MinAngle float64 `yaml:"minAngle" json:"minAngle"`
MaxAngle float64 `yaml:"maxAngle" json:"maxAngle"`
HomeAngle float64 `yaml:"homeAngle" json:"homeAngle"`
NudgeDegrees float64 `yaml:"nudgeDegrees" json:"nudgeDegrees"`
AllowRawPulse bool `yaml:"allowRawPulse" json:"allowRawPulse"`
Invert bool `yaml:"invert" json:"invert"`
}
type NightVisionConfig struct {
Enabled bool `yaml:"enabled" json:"enabled"`
GPIOPin int `yaml:"gpioPin" json:"gpioPin"`
GPIOChip string `yaml:"gpioChip" json:"gpioChip"`
InitialOn bool `yaml:"initialOn" json:"initialOn"`
}
type AutoSideBrushConfig struct {
Enabled bool `yaml:"enabled"`
Speed int `yaml:"speed"`
}
type PrivateConfig struct {
Enabled bool `yaml:"enabled" json:"enabled"`
Safety PrivateSafetyConfig `yaml:"safety" json:"safety"`
}
type PrivateSafetyConfig struct {
SpeedLimitEnabled bool `yaml:"speedLimitEnabled" json:"speedLimitEnabled"`
SpeedLimitMaxWheelMMs int `yaml:"speedLimitMaxWheelSpeed" json:"speedLimitMaxWheelSpeed"`
HardOvercurrentEnabled bool `yaml:"hardOvercurrentEnabled" json:"hardOvercurrentEnabled"`
OvercurrentStopMs int `yaml:"overcurrentStopMs" json:"overcurrentStopMs"`
HardBumpEnabled bool `yaml:"hardBumpEnabled" json:"hardBumpEnabled"`
BumpBackoffSpeed int `yaml:"bumpBackoffSpeed" json:"bumpBackoffSpeed"`
BumpBackoffMs int `yaml:"bumpBackoffMs" json:"bumpBackoffMs"`
CliffEnabled bool `yaml:"cliffEnabled" json:"cliffEnabled"`
CliffBackoffSpeed int `yaml:"cliffBackoffSpeed" json:"cliffBackoffSpeed"`
CliffBackoffMs int `yaml:"cliffBackoffMs" json:"cliffBackoffMs"`
TriggerCooldownMs int `yaml:"triggerCooldownMs" json:"triggerCooldownMs"`
}
type Config struct {
Name string `yaml:"name"`
ServerURL string `yaml:"serverUrl"`
Serial SerialConfig `yaml:"serial"`
BRC BRCConfig `yaml:"brc"`
Battery BatteryConfig `yaml:"battery"`
MaxWheelMMs int `yaml:"maxWheelSpeed"`
Media MediaConfig `yaml:"media"`
Name string `yaml:"name"`
Color string `yaml:"color" json:"color,omitempty"`
ServerURL string `yaml:"serverUrl"`
Serial SerialConfig `yaml:"serial"`
BRC BRCConfig `yaml:"brc"`
Battery BatteryConfig `yaml:"battery"`
MaxWheelMMs int `yaml:"maxWheelSpeed"`
Media MediaConfig `yaml:"media"`
CameraServo CameraServoConfig `yaml:"cameraServo"`
Audio AudioConfig `yaml:"audio"`
Horn HornConfig `yaml:"horn"`
NightVision NightVisionConfig `yaml:"nightVision" json:"nightVision"`
AutoSideBrush AutoSideBrushConfig `yaml:"autoSideBrush"`
Private PrivateConfig `yaml:"private" json:"private"`
}
func LoadConfig(path string) (*Config, error) {
@@ -84,7 +168,7 @@ func LoadConfig(path string) (*Config, error) {
cfg := Config{
MaxWheelMMs: 500,
BRC: BRCConfig{
GPIOPin: -1,
GPIOPin: 4,
GPIOChip: "gpiochip0",
PulseEvery: Duration{
Duration: time.Minute,
@@ -95,11 +179,67 @@ func LoadConfig(path string) (*Config, error) {
},
Media: MediaConfig{
PublishPort: 9000,
CameraInverted: true,
HealthInterval: Duration{Duration: 30 * time.Second},
VideoWidth: 1280,
VideoHeight: 720,
VideoFPS: 30,
VideoBitrate: 3000000,
VideoBitrate: 2000000,
},
CameraServo: CameraServoConfig{
Pin: 12,
FreqHz: 50,
CycleLen: 20000,
MinPulseUs: 900,
MaxPulseUs: 2100,
MinAngle: -15,
MaxAngle: 30,
HomeAngle: 0,
NudgeDegrees: 2,
},
Audio: AudioConfig{
CaptureEnabled: false,
CaptureDevice: "rovermic",
PlaybackDevice: "forward",
SampleRate: 48000,
Channels: 2,
Bitrate: 24000,
TTSEnabled: false,
DefaultEngine: "flite",
DefaultVoice: "rms",
DefaultPitch: 50,
},
Horn: HornConfig{
Enabled: false,
Volume: 0.25,
SampleRate: 48000,
Channels: 1,
SineGain: 1.0,
SawGain: 0.7,
MaxDuration: Duration{Duration: 10000 * time.Millisecond},
},
NightVision: NightVisionConfig{
Enabled: true,
GPIOPin: 22,
GPIOChip: "gpiochip0",
InitialOn: true,
},
AutoSideBrush: AutoSideBrushConfig{
Enabled: true,
Speed: 20,
},
Private: PrivateConfig{
Enabled: false,
Safety: PrivateSafetyConfig{
SpeedLimitEnabled: false,
SpeedLimitMaxWheelMMs: 250,
HardOvercurrentEnabled: false,
OvercurrentStopMs: 300,
HardBumpEnabled: false,
BumpBackoffSpeed: 250,
BumpBackoffMs: 350,
CliffEnabled: false,
CliffBackoffSpeed: 250,
CliffBackoffMs: 500,
TriggerCooldownMs: 800,
},
},
}
if err := yaml.Unmarshal(data, &cfg); err != nil {
@@ -108,6 +248,11 @@ func LoadConfig(path string) (*Config, error) {
if cfg.Name == "" {
return nil, errors.New("missing name")
}
normalizedColor, err := normalizeHexColor(cfg.Color)
if err != nil {
return nil, err
}
cfg.Color = normalizedColor
if cfg.ServerURL == "" {
return nil, errors.New("missing serverUrl")
}
@@ -129,15 +274,6 @@ func LoadConfig(path string) (*Config, error) {
if cfg.Media.Manage && cfg.Media.HealthInterval.Duration <= 0 {
cfg.Media.HealthInterval = Duration{Duration: 30 * time.Second}
}
if cfg.Media.VideoWidth <= 0 {
cfg.Media.VideoWidth = 1280
}
if cfg.Media.VideoHeight <= 0 {
cfg.Media.VideoHeight = 720
}
if cfg.Media.VideoFPS <= 0 {
cfg.Media.VideoFPS = 30
}
if cfg.Media.VideoBitrate <= 0 {
cfg.Media.VideoBitrate = 3000000
}
@@ -151,12 +287,160 @@ func LoadConfig(path string) (*Config, error) {
}
cfg.Media.PublishURL = derived
}
if cfg.Media.AudioPublishURL == "" {
derived, err := derivePublishURL(cfg.ServerURL, cfg.Name+"-audio", cfg.Media.PublishPort)
if err != nil {
return nil, fmt.Errorf("derive audioPublishUrl: %w", err)
}
cfg.Media.AudioPublishURL = derived
}
if cfg.Media.AudioForwardURL == "" {
derived, err := deriveReadURL(cfg.ServerURL, cfg.Name+"-fwd", cfg.Media.PublishPort)
if err != nil {
return nil, fmt.Errorf("derive audioForwardUrl: %w", err)
}
cfg.Media.AudioForwardURL = derived
}
if err := validateServoConfig(&cfg.CameraServo); err != nil {
return nil, fmt.Errorf("cameraServo: %w", err)
}
if err := validateNightVisionConfig(&cfg.NightVision); err != nil {
return nil, fmt.Errorf("nightVision: %w", err)
}
validateAudioConfig(&cfg.Audio)
validateHornConfig(&cfg.Horn)
validateAutoSideBrushConfig(&cfg.AutoSideBrush)
return &cfg, nil
}
func derivePublishURL(serverURL, roverName string, port int) (string, error) {
if roverName == "" {
return "", errors.New("missing rover name for publishUrl")
func validateServoConfig(cfg *CameraServoConfig) error {
if !cfg.Enabled {
return nil
}
if cfg.Pin <= 0 {
return errors.New("pin must be > 0")
}
if cfg.FreqHz <= 0 {
return errors.New("freqHz must be > 0")
}
if cfg.CycleLen <= 0 {
return errors.New("cycleLen must be > 0")
}
if cfg.MinPulseUs <= 0 || cfg.MaxPulseUs <= 0 {
return errors.New("minPulseUs/maxPulseUs invalid")
}
if cfg.MinPulseUs == cfg.MaxPulseUs {
return errors.New("minPulseUs/maxPulseUs cannot be equal")
}
if cfg.MinPulseUs > cfg.MaxPulseUs {
cfg.MinPulseUs, cfg.MaxPulseUs = cfg.MaxPulseUs, cfg.MinPulseUs
cfg.Invert = !cfg.Invert
}
if cfg.MinAngle >= cfg.MaxAngle {
return errors.New("minAngle must be less than maxAngle")
}
cfg.HomeAngle = clampFloat(cfg.HomeAngle, cfg.MinAngle, cfg.MaxAngle)
if cfg.NudgeDegrees <= 0 {
cfg.NudgeDegrees = 2
}
return nil
}
func clampFloat(value, min, max float64) float64 {
if value < min {
return min
}
if value > max {
return max
}
return value
}
func validateAudioConfig(cfg *AudioConfig) {
if cfg.CaptureEnabled && cfg.CaptureDevice == "" {
cfg.CaptureDevice = "hw:0,0"
}
if cfg.PlaybackDevice == "" || cfg.PlaybackDevice == "default" {
cfg.PlaybackDevice = "forward"
}
if cfg.SampleRate <= 0 {
cfg.SampleRate = 48000
}
if cfg.Channels <= 0 {
cfg.Channels = 2
}
if cfg.Bitrate <= 0 {
cfg.Bitrate = 64000
}
if cfg.DefaultEngine == "" {
cfg.DefaultEngine = "flite"
}
if cfg.DefaultVoice == "" {
cfg.DefaultVoice = "rms"
}
if cfg.DefaultPitch <= 0 {
cfg.DefaultPitch = 50
}
}
func validateHornConfig(cfg *HornConfig) {
if cfg.Volume <= 0 {
cfg.Volume = 0.25
}
if cfg.Volume > 1 {
cfg.Volume = 1
}
if cfg.SampleRate <= 0 {
cfg.SampleRate = 48000
}
if cfg.Channels <= 0 {
cfg.Channels = 1
}
if cfg.SineGain <= 0 {
cfg.SineGain = 1.0
}
if cfg.SawGain <= 0 {
cfg.SawGain = 0.7
}
if cfg.MaxDuration.Duration <= 0 {
cfg.MaxDuration = Duration{Duration: 1200 * time.Millisecond}
}
}
func validateNightVisionConfig(cfg *NightVisionConfig) error {
if !cfg.Enabled {
return nil
}
if cfg.GPIOPin <= 0 {
return errors.New("gpioPin must be > 0")
}
if cfg.GPIOChip == "" {
cfg.GPIOChip = "gpiochip0"
}
return nil
}
func validateAutoSideBrushConfig(cfg *AutoSideBrushConfig) {
if cfg.Speed == 0 {
return
}
cfg.Speed = clampInt(cfg.Speed, -127, 127)
}
func derivePublishURL(serverURL, streamName string, port int) (string, error) {
return deriveSRTURL(serverURL, streamName, port, "publish")
}
func deriveReadURL(serverURL, streamName string, port int) (string, error) {
return deriveSRTURL(serverURL, streamName, port, "request")
}
func deriveSRTURL(serverURL, streamName string, port int, mode string) (string, error) {
if streamName == "" {
return "", errors.New("missing stream name for publishUrl")
}
if mode == "" {
mode = "publish"
}
parsed, err := url.Parse(serverURL)
if err != nil {
@@ -169,6 +453,19 @@ func derivePublishURL(serverURL, roverName string, port int) (string, error) {
if port <= 0 {
port = 9000
}
streamName := url.PathEscape(roverName)
return fmt.Sprintf("srt://%s:%d?streamid=#!::r=%s,m=publish&latency=20&mode=caller&transtype=live&pkt_size=1316", host, port, streamName), nil
escaped := url.PathEscape(streamName)
return fmt.Sprintf("srt://%s:%d?streamid=#!::r=%s,m=%s&latency=10&mode=caller&transtype=live&pkt_size=1316", host, port, escaped, mode), nil
}
var hexColorRe = regexp.MustCompile(`^#[0-9A-Fa-f]{6}$`)
func normalizeHexColor(raw string) (string, error) {
trimmed := strings.TrimSpace(raw)
if trimmed == "" {
return "", nil
}
if !hexColorRe.MatchString(trimmed) {
return "", fmt.Errorf("color must be #RRGGBB, got %q", raw)
}
return strings.ToUpper(trimmed), nil
}
+1
View File
@@ -3,6 +3,7 @@ module multiroombarover/pi/roverd
go 1.25.4
require (
github.com/stianeikeland/go-rpio/v4 v4.6.0
github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07
github.com/warthog618/go-gpiocdev v0.9.1
gopkg.in/yaml.v3 v3.0.1
+2
View File
@@ -4,6 +4,8 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stianeikeland/go-rpio/v4 v4.6.0 h1:eAJgtw3jTtvn/CqwbC82ntcS+dtzUTgo5qlZKe677EY=
github.com/stianeikeland/go-rpio/v4 v4.6.0/go.mod h1:A3GvHxC1Om5zaId+HqB3HKqx4K/AqeckxB7qRjxMK7o=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07 h1:UyzmZLoiDWMRywV4DUYb9Fbt8uiOSooupjTq10vpvnU=
+270
View File
@@ -0,0 +1,270 @@
package roverd
import (
"bufio"
"encoding/binary"
"fmt"
"log"
"math"
"os/exec"
"strings"
"sync"
"time"
)
const (
hornAttack = 20 * time.Millisecond
hornRelease = 60 * time.Millisecond
)
type HornSynth struct {
cfg HornConfig
log *log.Logger
gain float64
mu sync.Mutex
stop chan struct{}
active bool
proc *exec.Cmd
}
func NewHornSynth(cfg HornConfig, logger *log.Logger) *HornSynth {
return &HornSynth{
cfg: cfg,
log: logger,
gain: 1.0,
}
}
func (h *HornSynth) SetGlobalGain(gain float64) {
h.mu.Lock()
defer h.mu.Unlock()
h.gain = clampAudioGain(gain)
}
func (h *HornSynth) HandlePayload(payload *hornPayload) error {
if payload == nil {
return fmt.Errorf("horn payload required")
}
action := strings.ToLower(strings.TrimSpace(payload.Action))
switch action {
case "start", "on", "honk":
waveform := strings.ToLower(strings.TrimSpace(payload.Waveform))
if waveform != "sine" && waveform != "saw" {
waveform = "saw"
}
freqs := sanitizeHornFreqs(payload.Freqs)
if len(freqs) == 0 {
h.Stop()
return nil
}
return h.Start(waveform, freqs)
case "stop", "off":
h.Stop()
return nil
default:
return fmt.Errorf("unsupported horn action: %s", payload.Action)
}
}
func (h *HornSynth) Start(waveform string, freqs []float64) error {
h.mu.Lock()
if h.active {
h.mu.Unlock()
return nil
}
stop := make(chan struct{})
h.stop = stop
h.active = true
h.mu.Unlock()
go h.run(waveform, freqs, stop)
return nil
}
func (h *HornSynth) Stop() {
h.mu.Lock()
if !h.active {
h.mu.Unlock()
return
}
stop := h.stop
proc := h.proc
h.stop = nil
h.proc = nil
h.active = false
h.mu.Unlock()
if stop != nil {
close(stop)
}
if proc != nil && proc.Process != nil {
_ = proc.Process.Kill()
}
}
func (h *HornSynth) run(waveform string, freqs []float64, stop <-chan struct{}) {
rate := h.cfg.SampleRate
if rate <= 0 {
rate = 48000
}
channels := h.cfg.Channels
if channels <= 0 {
channels = 1
}
volume := h.cfg.Volume
if volume <= 0 {
volume = 0.25
}
if volume > 1 {
volume = 1
}
h.mu.Lock()
gain := h.gain
h.mu.Unlock()
volume *= gain
device := strings.TrimSpace(h.cfg.Device)
if device == "" {
device = "horn"
}
args := []string{"-q", "-D", device, "-f", "S16_LE", "-c", fmt.Sprintf("%d", channels), "-r", fmt.Sprintf("%d", rate), "-t", "raw"}
cmd := exec.Command("aplay", args...)
stdin, err := cmd.StdinPipe()
if err != nil {
h.log.Printf("horn: aplay stdin failed: %v", err)
return
}
if err := cmd.Start(); err != nil {
h.log.Printf("horn: aplay start failed: %v", err)
_ = stdin.Close()
return
}
h.mu.Lock()
if h.active {
h.proc = cmd
}
h.mu.Unlock()
writer := bufio.NewWriterSize(stdin, 32*1024)
maxFrames := 0
if h.cfg.MaxDuration.Duration > 0 {
maxFrames = int(float64(rate) * h.cfg.MaxDuration.Duration.Seconds())
}
if err := h.synthLoop(writer, waveform, freqs, rate, channels, volume, maxFrames, stop); err != nil {
h.log.Printf("horn: synth failed: %v", err)
}
_ = writer.Flush()
_ = stdin.Close()
if err := cmd.Wait(); err != nil {
h.log.Printf("horn: aplay exit: %v", err)
}
h.mu.Lock()
if h.proc == cmd {
h.proc = nil
}
h.mu.Unlock()
}
func (h *HornSynth) synthLoop(writer *bufio.Writer, waveform string, freqs []float64, rate, channels int, volume float64, maxFrames int, stop <-chan struct{}) error {
phase := make([]float64, len(freqs))
increment := make([]float64, len(freqs))
for i, f := range freqs {
increment[i] = 2 * math.Pi * f / float64(rate)
}
attackFrames := int(float64(rate) * hornAttack.Seconds())
releaseFrames := int(float64(rate) * hornRelease.Seconds())
framesPerChunk := 512
buf := make([]byte, framesPerChunk*channels*2)
scale := volume / float64(len(freqs))
if waveform == "sine" {
scale *= h.cfg.SineGain
} else {
scale *= h.cfg.SawGain
}
stopRequested := false
releaseStart := -1
sampleIndex := 0
for {
if !stopRequested {
select {
case <-stop:
stopRequested = true
releaseStart = sampleIndex
default:
}
}
for i := 0; i < framesPerChunk; i++ {
if maxFrames > 0 && sampleIndex >= maxFrames && !stopRequested {
stopRequested = true
releaseStart = sampleIndex
}
env := 1.0
if attackFrames > 0 && sampleIndex < attackFrames {
env = float64(sampleIndex) / float64(attackFrames)
} else if stopRequested && releaseFrames > 0 {
relIndex := sampleIndex - releaseStart
if relIndex >= releaseFrames {
return nil
}
env = float64(releaseFrames-relIndex) / float64(releaseFrames)
} else if stopRequested {
return nil
}
sample := 0.0
for j := range freqs {
switch waveform {
case "sine":
sample += math.Sin(phase[j])
default:
sample += sawFromPhase(phase[j])
}
phase[j] += increment[j]
if phase[j] > 2*math.Pi {
phase[j] -= 2 * math.Pi
}
}
sample *= scale * env
if sample > 1.0 {
sample = 1.0
} else if sample < -1.0 {
sample = -1.0
}
intSample := int16(sample * math.MaxInt16)
offset := i * channels * 2
for ch := 0; ch < channels; ch++ {
binary.LittleEndian.PutUint16(buf[offset+ch*2:], uint16(intSample))
}
sampleIndex++
}
if _, err := writer.Write(buf); err != nil {
return err
}
}
}
func sanitizeHornFreqs(freqs []float64) []float64 {
if len(freqs) == 0 {
return nil
}
out := make([]float64, 0, 4)
for _, f := range freqs {
if len(out) >= 4 {
break
}
if f <= 0 {
continue
}
out = append(out, f)
}
return out
}
func sawFromPhase(phase float64) float64 {
return 2.0*(phase/(2*math.Pi)) - 1.0
}
+50 -8
View File
@@ -9,24 +9,66 @@ import (
const publisherEnvPath = "/var/lib/roverd/video.env"
func UpdatePublisherEnv(cfg MediaConfig) error {
if cfg.PublishURL == "" {
func UpdatePublisherEnv(media MediaConfig, audio AudioConfig) error {
if media.PublishURL == "" {
return fmt.Errorf("media publishUrl missing")
}
if cfg.VideoWidth <= 0 || cfg.VideoHeight <= 0 || cfg.VideoFPS <= 0 || cfg.VideoBitrate <= 0 {
if media.AudioPublishURL == "" && audio.CaptureEnabled {
return fmt.Errorf("audio publishUrl missing")
}
if media.VideoWidth < 0 || media.VideoHeight < 0 || media.VideoFPS < 0 || media.VideoBitrate <= 0 {
return fmt.Errorf("invalid media dimensions/bitrate")
}
if err := os.MkdirAll(filepath.Dir(publisherEnvPath), 0o755); err != nil {
return err
}
var buf bytes.Buffer
fmt.Fprintf(&buf, "PUBLISH_URL=%s\n", cfg.PublishURL)
fmt.Fprintf(&buf, "VIDEO_WIDTH=%d\n", cfg.VideoWidth)
fmt.Fprintf(&buf, "VIDEO_HEIGHT=%d\n", cfg.VideoHeight)
fmt.Fprintf(&buf, "VIDEO_FPS=%d\n", cfg.VideoFPS)
fmt.Fprintf(&buf, "VIDEO_BITRATE=%d\n", cfg.VideoBitrate)
fmt.Fprintf(&buf, "PUBLISH_URL=%s\n", media.PublishURL)
if audio.CaptureEnabled && media.AudioPublishURL != "" {
fmt.Fprintf(&buf, "AUDIO_PUBLISH_URL=%s\n", media.AudioPublishURL)
}
if media.AudioForwardURL != "" {
fmt.Fprintf(&buf, "AUDIO_FORWARD_URL=%s\n", media.AudioForwardURL)
}
if media.VideoWidth > 0 {
fmt.Fprintf(&buf, "VIDEO_WIDTH=%d\n", media.VideoWidth)
}
if media.VideoHeight > 0 {
fmt.Fprintf(&buf, "VIDEO_HEIGHT=%d\n", media.VideoHeight)
}
if media.VideoFPS > 0 {
fmt.Fprintf(&buf, "VIDEO_FPS=%d\n", media.VideoFPS)
}
fmt.Fprintf(&buf, "VIDEO_BITRATE=%d\n", media.VideoBitrate)
fmt.Fprintf(&buf, "VIDEO_INVERT=%d\n", boolToInt(media.CameraInverted))
audioDevice := audio.CaptureDevice
if audioDevice == "" || audioDevice == "rovermic" {
audioDevice = "hw:0,0"
}
if audio.SampleRate <= 0 {
audio.SampleRate = 48000
}
if audio.Channels <= 0 {
audio.Channels = 2
}
fmt.Fprintf(&buf, "AUDIO_ENABLE=%d\n", boolToInt(audio.CaptureEnabled))
fmt.Fprintf(&buf, "AUDIO_DEVICE=%s\n", audioDevice)
playbackDevice := audio.PlaybackDevice
if playbackDevice == "" {
playbackDevice = "forward"
}
fmt.Fprintf(&buf, "AUDIO_PLAYBACK_DEVICE=%s\n", playbackDevice)
fmt.Fprintf(&buf, "AUDIO_RATE=%d\n", audio.SampleRate)
fmt.Fprintf(&buf, "AUDIO_CHANNELS=%d\n", audio.Channels)
if err := os.WriteFile(publisherEnvPath, buf.Bytes(), 0o640); err != nil {
return err
}
return nil
}
func boolToInt(v bool) int {
if v {
return 1
}
return 0
}
+6 -4
View File
@@ -13,13 +13,14 @@ import (
type MediaSupervisor struct {
cfg MediaConfig
audio AudioConfig
logger *log.Logger
client *http.Client
checkInterval time.Duration
}
func NewMediaSupervisor(cfg MediaConfig, logger *log.Logger) *MediaSupervisor {
if err := UpdatePublisherEnv(cfg); err != nil {
func NewMediaSupervisor(cfg MediaConfig, audio AudioConfig, logger *log.Logger) *MediaSupervisor {
if err := UpdatePublisherEnv(cfg, audio); err != nil {
logger.Printf("media supervisor: update env failed: %v", err)
}
if !cfg.Manage || cfg.Service == "" {
@@ -35,6 +36,7 @@ func NewMediaSupervisor(cfg MediaConfig, logger *log.Logger) *MediaSupervisor {
}
return &MediaSupervisor{
cfg: cfg,
audio: audio,
logger: logger,
client: client,
checkInterval: interval,
@@ -45,7 +47,7 @@ func (m *MediaSupervisor) Start(ctx context.Context) {
if m == nil {
return
}
if err := UpdatePublisherEnv(m.cfg); err != nil {
if err := UpdatePublisherEnv(m.cfg, m.audio); err != nil {
m.logger.Printf("media supervisor: update env failed: %v", err)
}
if m.cfg.HealthURL == "" || m.client == nil {
@@ -76,7 +78,7 @@ func (m *MediaSupervisor) HandleAction(ctx context.Context, action string) error
if m == nil {
return errors.New("media supervisor disabled")
}
if err := UpdatePublisherEnv(m.cfg); err != nil {
if err := UpdatePublisherEnv(m.cfg, m.audio); err != nil {
return err
}
switch action {
+103
View File
@@ -0,0 +1,103 @@
//go:build !dummy
package roverd
import (
"fmt"
"log"
"strings"
"sync"
gpiocdev "github.com/warthog618/go-gpiocdev"
)
type NightVisionLight struct {
cfg NightVisionConfig
logger *log.Logger
line *gpiocdev.Line
mu sync.Mutex
on bool
closed bool
}
func NewNightVisionLight(cfg NightVisionConfig, logger *log.Logger) (*NightVisionLight, error) {
if !cfg.Enabled {
return nil, fmt.Errorf("night vision disabled")
}
chip := cfg.GPIOChip
if chip == "" {
chip = "gpiochip0"
}
initial := 0
if cfg.InitialOn {
initial = 1
}
line, err := gpiocdev.RequestLine(
chip,
cfg.GPIOPin,
gpiocdev.AsOutput(initial),
gpiocdev.WithConsumer("roverd-nightvision"),
)
if err != nil {
return nil, fmt.Errorf("gpio request: %w", err)
}
nv := &NightVisionLight{
cfg: cfg,
logger: logger,
line: line,
on: cfg.InitialOn,
}
logger.Printf("night vision LED on GPIO %d (initial=%v)", cfg.GPIOPin, cfg.InitialOn)
return nv, nil
}
func (n *NightVisionLight) Close() {
n.mu.Lock()
defer n.mu.Unlock()
if n.closed {
return
}
_ = n.line.SetValue(boolToGPIO(n.on))
n.line.Close()
n.closed = true
}
func (n *NightVisionLight) HandleAction(action string) error {
n.mu.Lock()
defer n.mu.Unlock()
if n.closed {
return fmt.Errorf("night vision controller closed")
}
act := strings.ToLower(strings.TrimSpace(action))
switch act {
case "", "toggle":
return n.setLocked(!n.on)
case "on":
return n.setLocked(true)
case "off":
return n.setLocked(false)
default:
return fmt.Errorf("unknown action %q", action)
}
}
func (n *NightVisionLight) NightVisionOn() bool {
n.mu.Lock()
defer n.mu.Unlock()
return !n.on
}
func (n *NightVisionLight) setLocked(on bool) error {
if err := n.line.SetValue(boolToGPIO(on)); err != nil {
return err
}
n.on = on
return nil
}
func boolToGPIO(value bool) int {
if value {
return 1
}
return 0
}
+24
View File
@@ -0,0 +1,24 @@
//go:build dummy
package roverd
import (
"fmt"
"log"
)
type NightVisionLight struct{}
func NewNightVisionLight(cfg NightVisionConfig, logger *log.Logger) (*NightVisionLight, error) {
return nil, fmt.Errorf("night vision not supported in dummy build")
}
func (n *NightVisionLight) Close() {}
func (n *NightVisionLight) HandleAction(action string) error {
return fmt.Errorf("night vision not supported in dummy build")
}
func (n *NightVisionLight) NightVisionOn() bool {
return false
}
BIN
View File
Binary file not shown.
+61 -6
View File
@@ -1,11 +1,12 @@
# Sample configuration for roverd
name: roomba-alpha
color: "#4DB6AC"
serverUrl: ws://control-server.local:8080/rover
serial:
device: /dev/ttyAMA0
baud: 115200
brc:
gpioPin: 17
gpioPin: 4
gpioChip: gpiochip0
pulseEvery: 1m
pulseWidth: 1s
@@ -15,13 +16,67 @@ battery:
urgent: 1650
maxWheelSpeed: 350
media:
publishUrl: srt://192.168.0.86:9000?streamid=#!::r=roomba-alpha,m=publish&latency=20&mode=caller&transtype=live&pkt_size=1316
publishUrl: srt://192.168.0.86:9000?streamid=#!::r=roomba-alpha,m=publish&latency=10&mode=caller&transtype=live&pkt_size=1316
audioForwardUrl: srt://192.168.0.86:9000?streamid=#!::r=roomba-alpha-fwd,m=request&latency=10&mode=caller&transtype=live&pkt_size=1316
publishPort: 9000
videoWidth: 1280
videoHeight: 720
videoFps: 30
videoBitrate: 3000000
# Default assumes camera is mounted upside down; set false for upright mounts.
cameraInverted: true
videoBitrate: 2000000
manage: true
service: video-publisher.service
healthUrl: ""
healthInterval: 30s
cameraServo:
enabled: false
pin: 12
freqHz: 50
cycleLen: 20000
minPulseUs: 900
maxPulseUs: 2100
invert: false
minAngle: -15
maxAngle: 30
homeAngle: 0
nudgeDegrees: 2
allowRawPulse: false
audio:
captureEnabled: false
captureDevice: hw:0,0
playbackDevice: forward
sampleRate: 48000
channels: 2
bitrate: 24000
ttsEnabled: false
defaultEngine: flite
defaultVoice: rms
defaultPitch: 50
horn:
enabled: false
volume: 0.25
sampleRate: 48000
channels: 1
sineGain: 1.0
sawGain: 0.7
maxDuration: 1.2s
nightVision:
enabled: true
gpioPin: 22
gpioChip: gpiochip0
initialOn: true
autoSideBrush:
enabled: true
speed: 20
private:
enabled: false
safety:
speedLimitEnabled: false
speedLimitMaxWheelSpeed: 250
hardOvercurrentEnabled: false
overcurrentStopMs: 300
hardBumpEnabled: false
bumpBackoffSpeed: 250
bumpBackoffMs: 350
cliffEnabled: false
cliffBackoffSpeed: 250
cliffBackoffMs: 500
triggerCooldownMs: 800
+30 -1
View File
@@ -5,7 +5,7 @@ serial:
device: /dev/ttyAMA0
baud: 115200
brc:
gpioPin: 17
gpioPin: 4
gpioChip: gpiochip0
pulseEvery: 1m
pulseWidth: 1s
@@ -19,3 +19,32 @@ media:
service: mediamtx.service
healthUrl: http://127.0.0.1:9997/v3/paths/list
healthInterval: 30s
cameraServo:
enabled: false
pin: 19
freqHz: 50
cycleLen: 20000
minPulseUs: 900
maxPulseUs: 2100
minAngle: -15
maxAngle: 30
homeAngle: 0
nudgeDegrees: 2
allowRawPulse: false
autoSideBrush:
enabled: true
speed: 20
private:
enabled: false
safety:
speedLimitEnabled: false
speedLimitMaxWheelSpeed: 250
hardOvercurrentEnabled: false
overcurrentStopMs: 300
hardBumpEnabled: false
bumpBackoffSpeed: 250
bumpBackoffMs: 350
cliffEnabled: false
cliffBackoffSpeed: 250
cliffBackoffMs: 500
triggerCooldownMs: 800
+10 -2
View File
@@ -12,8 +12,9 @@ import (
)
const (
sensorHeader = 19
sensorReadTimeout = 150 * time.Millisecond
sensorHeader = 19
sensorReadTimeout = 150 * time.Millisecond
sensorThrottleMinimum = 50 * time.Millisecond
)
type SensorStreamer struct {
@@ -29,6 +30,7 @@ func NewSensorStreamer(r io.Reader, rawOut chan<- []byte, parsed chan<- SensorSa
func (s *SensorStreamer) Run(ctx context.Context) {
reader := bufio.NewReader(s.r)
var nextSend time.Time
for {
select {
case <-ctx.Done():
@@ -62,6 +64,12 @@ func (s *SensorStreamer) Run(ctx context.Context) {
continue
}
now := time.Now()
if !nextSend.IsZero() && now.Before(nextSend) {
continue
}
nextSend = now.Add(sensorThrottleMinimum)
select {
case s.rawOut <- frame:
default:
+27
View File
@@ -92,6 +92,33 @@ func (s *SerialAdapter) SendRaw(raw []byte) error {
return s.write(raw)
}
func (s *SerialAdapter) StartOI() error {
return s.write([]byte{128})
}
func (s *SerialAdapter) SeekDock() error {
return s.write([]byte{143})
}
func (s *SerialAdapter) PlaySong(slot int, notes []songNote) error {
if len(notes) == 0 {
return fmt.Errorf("song requires at least one note")
}
if len(notes) > 16 {
return fmt.Errorf("song supports up to 16 notes, got %d", len(notes))
}
if slot < 0 || slot > 4 {
return fmt.Errorf("song slot must be 0-4")
}
payload := []byte{140, byte(slot), byte(len(notes))}
for _, n := range notes {
note := clampInt(n.Note, 31, 127)
duration := clampInt(n.Duration, 1, 255)
payload = append(payload, byte(note), byte(duration))
}
if err := s.write(payload); err != nil {
return err
}
return s.write([]byte{141, byte(slot)})
}
+10
View File
@@ -52,7 +52,17 @@ func (s *SerialAdapter) SendRaw(raw []byte) error {
return nil
}
func (s *SerialAdapter) StartOI() error {
s.log.Printf("[dummy] start OI")
return nil
}
func (s *SerialAdapter) SeekDock() error {
s.log.Printf("[dummy] seek dock")
return nil
}
func (s *SerialAdapter) PlaySong(slot int, notes []songNote) error {
s.log.Printf("[dummy] play song slot=%d notes=%v", slot, notes)
return nil
}
+75
View File
@@ -0,0 +1,75 @@
package roverd
import (
"context"
"fmt"
"os/exec"
"strings"
"time"
)
func (c *WSClient) handleTTSPayload(ctx context.Context, payload *ttsPayload) error {
if payload == nil {
return fmt.Errorf("tts payload required")
}
if !c.cfg.Audio.TTSEnabled {
return fmt.Errorf("tts disabled on rover")
}
if payload.Speak == false {
return nil
}
text := strings.TrimSpace(payload.Text)
if text == "" {
return fmt.Errorf("tts text required")
}
if len([]rune(text)) > 512 {
text = string([]rune(text)[:512])
}
engine := strings.ToLower(strings.TrimSpace(payload.Engine))
if engine == "" {
engine = strings.ToLower(strings.TrimSpace(c.cfg.Audio.DefaultEngine))
}
if engine == "" {
engine = "flite"
}
voice := strings.TrimSpace(payload.Voice)
if voice == "" {
voice = strings.TrimSpace(c.cfg.Audio.DefaultVoice)
}
pitch := payload.Pitch
if pitch <= 0 {
pitch = c.cfg.Audio.DefaultPitch
}
pitch = clampInt(pitch, 0, 99)
runCtx, cancel := context.WithTimeout(ctx, 12*time.Second)
defer cancel()
var cmd *exec.Cmd
switch engine {
case "espeak", "e":
args := []string{}
if pitch > 0 {
args = append(args, "-p", fmt.Sprintf("%d", pitch))
}
args = append(args, text)
cmd = exec.CommandContext(runCtx, "espeak", args...)
case "flite", "f":
args := []string{}
if voice != "" {
args = append(args, "-voice", voice)
}
args = append(args, "-t", text)
cmd = exec.CommandContext(runCtx, "flite", args...)
default:
return fmt.Errorf("unsupported tts engine: %s", engine)
}
out, err := cmd.CombinedOutput()
if err != nil {
return fmt.Errorf("tts exec failed: %w (%s)", err, string(out))
}
return nil
}
+414 -12
View File
@@ -6,6 +6,8 @@ import (
"encoding/json"
"fmt"
"log"
"os/exec"
"sync"
"time"
"nhooyr.io/websocket"
@@ -15,28 +17,68 @@ type WSClient struct {
cfg *Config
adapter *SerialAdapter
sensorFrames <-chan []byte
events <-chan RoverEvent
events chan RoverEvent
media *MediaSupervisor
servo *CameraServo
horn *HornSynth
nightVision *NightVisionLight
log *log.Logger
recoverMu sync.Mutex
recovering bool
ttsQueue chan *ttsPayload
lastAux motorPWMPayload
autoSideOn bool
connMu sync.Mutex
connected bool
disconnectT *time.Timer
rebootT *time.Timer
seekIssued bool
rebootIssued bool
audioLevels AudioLevels
audioMu sync.RWMutex
}
func NewWSClient(cfg *Config, adapter *SerialAdapter, frames <-chan []byte, events <-chan RoverEvent, media *MediaSupervisor, logger *log.Logger) *WSClient {
return &WSClient{
func NewWSClient(cfg *Config, adapter *SerialAdapter, frames <-chan []byte, events chan RoverEvent, media *MediaSupervisor, servo *CameraServo, nightVision *NightVisionLight, logger *log.Logger) *WSClient {
var ttsQueue chan *ttsPayload
if cfg.Audio.TTSEnabled {
ttsQueue = make(chan *ttsPayload, 2)
}
var horn *HornSynth
if cfg.Horn.Enabled {
horn = NewHornSynth(cfg.Horn, logger)
}
client := &WSClient{
cfg: cfg,
adapter: adapter,
sensorFrames: frames,
events: events,
media: media,
servo: servo,
horn: horn,
nightVision: nightVision,
log: logger,
ttsQueue: ttsQueue,
audioLevels: AudioLevels{
HornGain: 1.0,
TTSGain: 1.0,
ForwardGain: 1.0,
},
}
client.applyAudioLevelsToMixer(client.audioLevels)
return client
}
func (c *WSClient) Run(ctx context.Context) error {
conn, _, err := websocket.Dial(ctx, c.cfg.ServerURL, nil)
dialCtx, cancel := context.WithTimeout(ctx, dialTimeout)
conn, _, err := websocket.Dial(dialCtx, c.cfg.ServerURL, nil)
cancel()
if err != nil {
c.markDisconnected()
return err
}
c.markConnected()
defer conn.Close(websocket.StatusInternalError, "closed")
defer c.markDisconnected()
if err := c.sendHello(ctx, conn); err != nil {
return err
@@ -45,10 +87,16 @@ func (c *WSClient) Run(ctx context.Context) error {
c.log.Printf("sensor stream init failed: %v", err)
}
errCh := make(chan error, 1)
errCh := make(chan error, 2)
c.startTTSWorker(ctx)
go func() {
errCh <- c.readLoop(ctx, conn)
}()
go func() {
if err := c.keepalive(ctx, conn); err != nil {
errCh <- err
}
}()
go c.forwardSensors(ctx, conn)
go c.forwardEvents(ctx, conn)
@@ -65,10 +113,17 @@ func (c *WSClient) sendHello(ctx context.Context, conn *websocket.Conn) error {
msg := helloMessage{
Type: "hello",
Name: c.cfg.Name,
Color: c.cfg.Color,
Battery: c.cfg.Battery,
MaxWheelSpeed: c.cfg.MaxWheelMMs,
Media: c.cfg.Media,
CameraServo: c.cfg.CameraServo,
Audio: c.cfg.Audio,
Horn: c.cfg.Horn,
NightVision: c.cfg.NightVision,
Private: c.cfg.Private,
}
c.log.Printf("sending hello (camera servo enabled=%v pin=%d)", msg.CameraServo.Enabled, msg.CameraServo.Pin)
return writeJSON(ctx, conn, msg)
}
@@ -110,20 +165,23 @@ func (c *WSClient) dispatch(ctx context.Context, msg *inboundMessage) error {
case msg.DriveDirect != nil:
left := clamp(msg.DriveDirect.Left, -c.cfg.MaxWheelMMs, c.cfg.MaxWheelMMs)
right := clamp(msg.DriveDirect.Right, -c.cfg.MaxWheelMMs, c.cfg.MaxWheelMMs)
return c.adapter.DriveDirect(left, right)
if err := c.adapter.DriveDirect(left, right); err != nil {
return err
}
c.applyAutoSideBrush(left, right)
return nil
case msg.MotorPWM != nil:
main := clamp(msg.MotorPWM.Main, -127, 127)
side := clamp(msg.MotorPWM.Side, -127, 127)
vac := clamp(msg.MotorPWM.Vacuum, 0, 127)
c.lastAux = motorPWMPayload{Main: main, Side: side, Vacuum: vac}
c.autoSideOn = false
return c.adapter.MotorPWM(main, side, vac)
case msg.SensorStream != nil:
if msg.SensorStream.Enable {
if err := c.adapter.StartSensorStream(defaultStreamPackets); err != nil {
return err
}
return c.adapter.PauseSensorStream(false)
return c.adapter.StartSensorStream(defaultStreamPackets)
}
return c.adapter.PauseSensorStream(true)
return nil
case msg.Raw != "" && len(msg.Raw) > 0:
buf, err := base64.StdEncoding.DecodeString(msg.Raw)
if err != nil {
@@ -141,17 +199,220 @@ func (c *WSClient) dispatch(ctx context.Context, msg *inboundMessage) error {
return fmt.Errorf("media supervisor disabled")
}
return c.media.HandleAction(ctx, msg.Media.Action)
case msg.Servo != nil:
if c.servo == nil {
return fmt.Errorf("camera servo disabled")
}
return c.handleServoCommand(msg.Servo)
case msg.TTS != nil:
return c.enqueueTTS(msg.TTS)
case msg.Horn != nil:
if c.horn == nil {
return fmt.Errorf("horn disabled")
}
return c.horn.HandlePayload(msg.Horn)
case msg.AudioLevels != nil:
return c.handleAudioLevels(msg.AudioLevels)
case msg.NightVision != nil:
if c.nightVision == nil {
return fmt.Errorf("night vision disabled")
}
if err := c.nightVision.HandleAction(msg.NightVision.Action); err != nil {
return err
}
c.emitEvent("nightVision.state", map[string]any{
"nightVisionOn": c.nightVision.NightVisionOn(),
})
return nil
case msg.Song != nil:
slot := 0
if msg.Song.Slot != nil {
slot = clampInt(*msg.Song.Slot, 0, 4)
}
return c.adapter.PlaySong(slot, msg.Song.Notes)
case msg.Reboot != nil || msg.Type == "reboot":
return c.handleRebootCommand(msg.Reboot)
default:
return fmt.Errorf("unsupported command type: %s", msg.Type)
}
}
func (c *WSClient) handleRebootCommand(payload *rebootPayload) error {
if err := c.adapter.DriveDirect(0, 0); err != nil {
return fmt.Errorf("stop drive before reboot: %w", err)
}
if err := c.adapter.MotorPWM(0, 0, 0); err != nil {
return fmt.Errorf("stop aux motors before reboot: %w", err)
}
if err := c.adapter.StartOI(); err != nil {
return fmt.Errorf("enter passive mode before reboot: %w", err)
}
delay := 300 * time.Millisecond
if payload != nil && payload.DelayMs > 0 {
delay = time.Duration(clampInt(payload.DelayMs, 50, 5000)) * time.Millisecond
}
c.connMu.Lock()
if c.rebootIssued {
c.connMu.Unlock()
return fmt.Errorf("reboot already pending")
}
c.rebootIssued = true
c.connMu.Unlock()
c.emitEvent("system.rebooting", map[string]any{
"source": "remoteCommand",
"delayMs": delay.Milliseconds(),
})
go func() {
time.Sleep(delay)
c.log.Printf("rebooting pi after remote reboot command")
cmd := exec.Command("systemctl", "reboot")
if err := cmd.Start(); err != nil {
c.log.Printf("reboot command failed: %v", err)
}
}()
return nil
}
func (c *WSClient) applyAutoSideBrush(left, right int) {
if c.cfg == nil || !c.cfg.AutoSideBrush.Enabled {
if c.autoSideOn {
c.autoSideOn = false
if err := c.adapter.MotorPWM(c.lastAux.Main, c.lastAux.Side, c.lastAux.Vacuum); err != nil {
c.log.Printf("auto side brush stop failed: %v", err)
}
}
return
}
moving := left != 0 || right != 0
if !moving {
if c.autoSideOn {
c.autoSideOn = false
if err := c.adapter.MotorPWM(c.lastAux.Main, c.lastAux.Side, c.lastAux.Vacuum); err != nil {
c.log.Printf("auto side brush stop failed: %v", err)
}
}
return
}
if c.lastAux.Side != 0 {
c.autoSideOn = false
return
}
autoSpeed := clampInt(c.cfg.AutoSideBrush.Speed, -127, 127)
if autoSpeed == 0 {
c.autoSideOn = false
return
}
if c.autoSideOn {
return
}
if err := c.adapter.MotorPWM(c.lastAux.Main, autoSpeed, c.lastAux.Vacuum); err != nil {
c.log.Printf("auto side brush start failed: %v", err)
return
}
c.autoSideOn = true
}
func (c *WSClient) enqueueTTS(payload *ttsPayload) error {
if c.ttsQueue == nil {
return fmt.Errorf("tts disabled")
}
select {
case c.ttsQueue <- payload:
return nil
default:
return fmt.Errorf("tts busy")
}
}
func (c *WSClient) startTTSWorker(ctx context.Context) {
if c.ttsQueue == nil {
return
}
go func() {
for {
select {
case <-ctx.Done():
return
case payload := <-c.ttsQueue:
if payload == nil {
continue
}
if err := c.handleTTSPayload(ctx, payload); err != nil {
c.log.Printf("tts failed: %v", err)
c.emitEvent("tts.error", map[string]any{"error": err.Error()})
}
}
}
}()
}
func (c *WSClient) handleServoCommand(payload *servoPayload) error {
switch {
case payload.Angle != nil:
return c.servo.SetAngle(*payload.Angle)
case payload.Nudge != nil:
return c.servo.Nudge(*payload.Nudge)
case payload.PulseUs != nil:
return c.servo.SetPulseWidth(*payload.PulseUs)
default:
return fmt.Errorf("servo command requires angle, nudge, or pulseUs")
}
}
func (c *WSClient) forwardSensors(ctx context.Context, conn *websocket.Conn) {
const (
sensorSilenceTimeout = 5 * time.Second
sensorRecoveryCooldown = 3 * time.Second
sensorCommandPause = 50 * time.Millisecond
)
timer := time.NewTimer(sensorSilenceTimeout)
defer timer.Stop()
resetTimer := func() {
if !timer.Stop() {
select {
case <-timer.C:
default:
}
}
timer.Reset(sensorSilenceTimeout)
}
lastRecovery := time.Time{}
lastFrame := time.Now()
for {
select {
case <-ctx.Done():
return
case <-timer.C:
now := time.Now()
if !lastRecovery.IsZero() && now.Sub(lastRecovery) < sensorRecoveryCooldown {
resetTimer()
continue
}
idleFor := now.Sub(lastFrame)
if idleFor < 0 {
idleFor = sensorSilenceTimeout
}
c.recoverSensorStream(idleFor, sensorCommandPause)
lastRecovery = now
resetTimer()
case frame := <-c.sensorFrames:
lastFrame = time.Now()
resetTimer()
msg := sensorMessage{
Type: "sensor",
Timestamp: time.Now().UnixMilli(),
@@ -185,6 +446,21 @@ func (c *WSClient) forwardEvents(ctx context.Context, conn *websocket.Conn) {
}
}
func (c *WSClient) emitEvent(event string, data map[string]any) {
if c.events == nil {
return
}
select {
case c.events <- RoverEvent{
Type: "event",
Event: event,
Ts: time.Now().UnixMilli(),
Data: data,
}:
default:
}
}
func writeJSON(ctx context.Context, conn *websocket.Conn, v any) error {
data, err := json.Marshal(v)
if err != nil {
@@ -207,7 +483,133 @@ func (c *WSClient) ensureSensorStream() error {
if err := c.adapter.StartSensorStream(defaultStreamPackets); err != nil {
return err
}
return c.adapter.PauseSensorStream(false)
return nil
}
const disconnectSeekDelay = time.Minute
const disconnectRebootDelay = 6 * time.Minute
const dialTimeout = 10 * time.Second
const pingInterval = 15 * time.Second
const pingTimeout = 5 * time.Second
func (c *WSClient) keepalive(ctx context.Context, conn *websocket.Conn) error {
ticker := time.NewTicker(pingInterval)
defer ticker.Stop()
for {
select {
case <-ctx.Done():
return ctx.Err()
case <-ticker.C:
pingCtx, cancel := context.WithTimeout(ctx, pingTimeout)
err := conn.Ping(pingCtx)
cancel()
if err != nil {
return err
}
}
}
}
func (c *WSClient) markConnected() {
c.connMu.Lock()
c.connected = true
c.seekIssued = false
c.rebootIssued = false
if c.disconnectT != nil {
c.disconnectT.Stop()
c.disconnectT = nil
}
if c.rebootT != nil {
c.rebootT.Stop()
c.rebootT = nil
}
c.connMu.Unlock()
}
func (c *WSClient) markDisconnected() {
c.connMu.Lock()
if c.connected {
c.connected = false
}
if c.disconnectT == nil {
c.disconnectT = time.AfterFunc(disconnectSeekDelay, c.handleDisconnectTimeout)
}
if c.rebootT == nil {
c.rebootT = time.AfterFunc(disconnectRebootDelay, c.handleRebootTimeout)
}
c.connMu.Unlock()
}
func (c *WSClient) handleDisconnectTimeout() {
c.connMu.Lock()
if c.connected || c.seekIssued {
c.connMu.Unlock()
return
}
c.seekIssued = true
c.connMu.Unlock()
if err := c.adapter.SeekDock(); err != nil {
c.log.Printf("seek dock on disconnect failed: %v", err)
return
}
c.log.Printf("seek dock issued after websocket disconnect")
}
func (c *WSClient) handleRebootTimeout() {
c.connMu.Lock()
if c.connected || c.rebootIssued {
c.connMu.Unlock()
return
}
c.rebootIssued = true
c.connMu.Unlock()
c.log.Printf("rebooting pi after prolonged websocket disconnect")
cmd := exec.Command("systemctl", "reboot")
if err := cmd.Start(); err != nil {
c.log.Printf("reboot command failed: %v", err)
}
}
func (c *WSClient) recoverSensorStream(idleFor time.Duration, cmdPause time.Duration) {
c.recoverMu.Lock()
if c.recovering {
c.recoverMu.Unlock()
return
}
c.recovering = true
c.recoverMu.Unlock()
defer func() {
c.recoverMu.Lock()
c.recovering = false
c.recoverMu.Unlock()
}()
c.emitEvent("sensorWatchdog.restart", map[string]any{
"idleMs": idleFor.Milliseconds(),
})
if err := c.adapter.StartOI(); err != nil {
c.log.Printf("watchdog start OI failed: %v", err)
c.emitEvent("sensorWatchdog.error", map[string]any{"error": err.Error()})
return
}
if cmdPause > 0 {
time.Sleep(cmdPause)
}
if err := c.adapter.StartSensorStream(defaultStreamPackets); err != nil {
c.log.Printf("watchdog start stream failed: %v", err)
c.emitEvent("sensorWatchdog.error", map[string]any{"error": err.Error()})
return
}
c.emitEvent("sensorWatchdog.ok", map[string]any{
"idleMs": idleFor.Milliseconds(),
})
}
func isModeOpcode(op byte) bool {
+18
View File
@@ -0,0 +1,18 @@
[Unit]
Description=Rover Audio Forward Listener (SRT -> ALSA)
After=network-online.target roverd.service
Wants=network-online.target
[Service]
Type=simple
User=roverd
Group=roverd
EnvironmentFile=/var/lib/roverd/video.env
ExecStart=/usr/local/bin/audio-forward-listener
KillMode=control-group
TimeoutStopSec=5
Restart=on-failure
RestartSec=2
[Install]
WantedBy=multi-user.target
+18
View File
@@ -0,0 +1,18 @@
[Unit]
Description=Rover Audio Publisher (ALSA -> SRT)
After=network-online.target roverd.service
Wants=network-online.target
[Service]
Type=simple
User=roverd
Group=roverd
EnvironmentFile=/var/lib/roverd/video.env
ExecStart=/usr/local/bin/audio-only-publisher
KillMode=control-group
TimeoutStopSec=5
Restart=on-failure
RestartSec=2
[Install]
WantedBy=multi-user.target
-2
View File
@@ -8,8 +8,6 @@ Type=simple
ExecStart=/usr/local/bin/roverd -config /etc/roverd.yaml
Restart=on-failure
RestartSec=5
User=roverd
Group=roverd
AmbientCapabilities=CAP_SYS_TTY_CONFIG CAP_SYS_RAWIO
[Install]
-13
View File
@@ -1,13 +0,0 @@
# general idea
- servo connected to pin 19 on the pi
- it will allow the camera to look up and down
- use go-rpio
- it has a hardware PWM implementation
- mechanical design will have limits
- set the limits in roverd config
- control the servo from the web browser
- expose both a slider and buttons for "nudging" it up and down
## verification of functionality before full implementation
- make sure that the go program can properly use the GPIO correctly before full implementation
- modify the roverd installer to add the needed stuff to enable PWM access
+14
View File
@@ -0,0 +1,14 @@
# main idea:
- stream audio from server to rovers
- users can either stream their mic from their browser
- users can also play audio files on the rover through the browser
- this is a VIP feature for verified users only
- gate in UI and in the server
## specifics
- only the current driver can play audio through a rover
- admins can enable / disable audio
- lockdown admins can adjust the volume for all rovers
- rovers are always listening for an audio stream from the server
- no transcoding allowed on-rover due to resources
- rovers are always local and cant be accessed from outside, no security is needed for audio streaming
+43
View File
@@ -0,0 +1,43 @@
# button box mechanic
- a box with 4 buttons which sends web requests to the server when a button is pressed
- each button has a counter in the server
- when the counter's goal is met, the reward happens
## rewards
- theres a list of rewards in the server
- rewards create chaos in different ways using the physical things that already exist
- rewards have actions and a counter goal set per reward to assign value to better rewards
- when a reward is met, the button gets a new goal, reset counter, and new reward
## UI
- a new full-width panel above the room cameras in the main tab
- divided into columns, one for each of the 4 buttons
- each columns shows:
- button number
- current count
- reward and reward number
- column flashes when button gets upped
- column plays a sound when button gets upped. same tone as the button.
- match styling and layout rules of the rest of the ui
### reward ideas
1. dock panic
force all online rovers to run seek-dock immediately, interrupting whatever it was doing and causing sudden behavior change
2. camera whiplash
apply a short burst of random camera servo nudges on all rovers so the view jerks around rapidly for a moment
3. light strobe
toggle all configured room controls on and off repeatedly for 10 seconds
4. ghost typing spam
emit fake typing events into chat so users see rapid typing indicators from fake/ghost senders without actual messages
5. darkness
turn room lights off for 1 minute and force rover night-vision/headlight state off for that same window, then restore normal state
6. discord stalker ping
send a chaos alert message to the configured discord general channel and ping the configured stalker role
7. rogue event spam
push a burst of fake alert events with random titles/colors into the web ui alert feed for jump-scare style noise
8. mode jam
switch server mode to admin for a short timed window, set admin reason to a chaos message at activation, then restore previous mode and previous admin reason
9. assignment roulette
forcibly release current user rover assignments/drivers and let assignment logic re-place users, causing sudden rover ownership reshuffle
10. chat spam
spam random letters in chat as an injected spectator user with a random letter name
+22
View File
@@ -0,0 +1,22 @@
# lift control
- control a lift up / down from the web UI
- for verified users only
- add new service in server for controlling the lift
- add new action in idle service, to raise the lift when idle triggers
- UI in VIP panel
- match UI styling of neato panel
- put below VIP panel
- have 2 buttons that get toggled between. down / up.
- lift is controlled through home assistant:
- lift shows up as two switches
- add spots for these 2 lift switches in server config
- one for up and one for down
- the way that they have to be operated is a little bit odd, examples:
- to raise the lift:
- turn down switch off
- wait 2 ish seconds
- turn up switch on
- to lower the lift:
- turn up switch off
- wait 2 ish seconds
- turn down switch on
+386
View File
@@ -0,0 +1,386 @@
# Overseer v2 Detailed Architecture
## Purpose
This document is the durable architecture spec for Overseer v2 so design intent is not lost across chats, sessions, or contributors.
Overseer v2 is a **new, separate service** focused on controlling the room/experience, not just commenting on rover activity.
## Non-Goals
- Do not replace or delete `llmCommentaryService`.
- Do not run two LLM overseer systems simultaneously in normal operation.
- Do not rely on giant unbounded context windows.
## Legacy Service Position
- Keep `llmCommentaryService` as a preserved legacy service.
- Keep it disable-able via config.
- New v2 service should be the primary runtime when enabled.
- Legacy service remains available for fallback/testing.
## Core Product Direction
Overseer v2 is "control-first":
- It can act on room systems and chat.
- Chat is one capability, not the whole job.
- It should feel ominous/playful and intentional, not spammy.
High-level behavior goals:
- Not overbearing.
- Does things when it can make moments interesting.
- Always responds when directly addressed.
- Does not always obey.
- Does not ramble.
## Primary Inputs Overseer Must Understand
Overseer must see all three lanes every decision cycle:
1. People activity
- Who is active now.
- Who is driving what.
- Activity bursts vs quiet periods.
- Direct addresses toward Overseer.
2. Conversation context
- **Actual recent chat conversation** (human + bot messages), not only tags.
- Last N human messages (minimum 5).
- Last 1-2 bot messages for anti-repeat context.
3. World/control state
- Rover states/events.
- Lift state/cooldowns.
- Neato state/cooldowns.
- Home Assistant entity states/availability.
- Safety/lock policy state.
## Runtime Model Strategy (Hardware-Aware)
Given modest hardware and ~30s generation on `mistral-small:24b` today:
- Use one LLM system only.
- Use deterministic program logic gate before LLM calls.
- Keep LLM calls sparse and meaningful.
- Keep context bounded and compact.
### Why Not Tiny-LLM Gate
Default gate should be deterministic logic, not another LLM:
- less latency
- less complexity
- fewer failure modes
- lower cumulative compute
A tiny LLM gate can be reconsidered later only for borderline cases.
## Continuous Loop Design (Never Stops)
System runs continuously but in two stages:
1. Fast gate loop (1-3s)
- No LLM call.
- Evaluates trigger conditions.
- If no trigger: continue.
2. LLM decision loop (on trigger or heartbeat)
- Triggered by gate or max-interval heartbeat.
- Builds bounded conversational context + state update.
- Model decides and optionally calls tools.
### Trigger Examples
- Direct address to Overseer in chat.
- Chat burst / topic change / challenge language.
- High-signal world event (dock/undock/hazard/control transition).
- Heartbeat timeout reached (for ambient presence).
## Decision Modes
The orchestrator should normalize model behavior to one of:
- `SKIP`
- `CHAT`
- `ACTION`
- `ACTION+CHAT`
Meaning:
- `SKIP`: no output, no tool call.
- `CHAT`: post chat only.
- `ACTION`: run tool(s) only.
- `ACTION+CHAT`: run tool(s) and post chat.
## Tool Output vs Chat Output
These are separate channels by design:
- Tool calls are structured actions.
- Chat text is explicit messaging output.
- A tool call does not automatically produce chat.
This separation is required to avoid chat spam and keep control behavior deliberate.
## Conversational Context Format (Important)
Overseer should use:
- Stable `system` prompt with identity/rules/policy.
- Real rolling transcript (users + overseer).
- A compact `STATE_UPDATE` message each decision cycle.
### Bounded Window Rules
To protect latency:
- Keep rolling window bounded (for example 20-40 recent turns, or last 5-10 min).
- Always include last 5 human messages minimum.
- Include last 1-2 bot messages.
- Drop/summarize older content.
## Tool Availability Contract
Critical refinement: do not advertise unusable tools as available.
Each cycle split into:
1. `available_tools`
- callable now
2. `blocked_tools`
- not callable now with reason:
- cooldown
- busy
- unavailable/offline
- policy lock
- rate limit
Example:
- If Neato is cooling down, remove `neato_*` from `available_tools` and list under `blocked_tools` with remaining seconds.
This prevents wasted model turns and impossible tool attempts.
## Initial Tool Surface
Planned callable tools (subject to runtime availability):
- `chat_say(text)`
- `lift_up()` / `lift_down()`
- `neato_start()` / `neato_send_home()` / `neato_locate()` / `neato_clear_errors()`
- `ha_set_entity(entity_id, state)` for configured controllable entities
- memory tools:
- `memory_read()`
- `memory_write(slot, text)` where slot ∈ {1,2,3}
Optional later:
- controlled button-box count adjustment tool (strictly bounded and auditable)
## Persistent Memory (Tiny, Explicit)
Use tiny explicit memory store:
- exactly 3 slots
- string lines only
- explicit read/write via tools
- no autonomous unbounded memory growth
Model decides which slot to replace when writing.
## Mode and Policy Locks (Tool Disabling Rules)
Overseer tool availability must respect global site mode and room-light policy locks.
Hard requirements:
- When site mode is `admin` or `lockdown`, disable Overseer action tools for:
- Neato controls (`neato_*`)
- Lift controls (`lift_*`)
- Room controls (`ha_set_entity` and related room-light toggles)
- When room lights are locked on by policy, disable room control tools even if site mode is otherwise open.
How this must appear to the model:
- Disabled tools must be removed from `available_tools`.
- Disabled tools must be present in `blocked_tools` with clear reason codes.
Recommended reason codes:
- `policy_lock:site_mode_admin`
- `policy_lock:site_mode_lockdown`
- `policy_lock:lights_locked_on`
Execution-time enforcement:
- Executor must re-check these locks immediately before executing any tool call.
- If a lock changed after context build, block execution and record a blocked action event.
## Safety and Control Guardrails
Must-have guardrails before enabling actions:
1. Hard allowlist
- Only approved tool names callable.
2. Tool-specific cooldowns
- e.g., lift/neato/HA each with independent cooldown rules.
3. Global action budget
- max actions per minute (or window).
4. Policy lock checks
- block actions during admin lock/safety states.
5. Execution-time validation
- arguments validated before invoking any control service.
6. Logging + audit trail
- every attempted/blocked/executed tool call recorded.
## Admin Debug UI Requirement
This is a core requirement.
Need a dedicated v2 admin panel that shows:
- enabled/running status
- loop phase (`idle`, `gate_check`, `awaiting_model`, `tool_exec`, `posted`, `failed`)
- last trigger reason
- last state-update payload snapshot
- model input summary
- model raw output + normalized decision mode
- tool calls attempted/executed/blocked with reasons
- cooldowns and remaining times
- recent action history
- last error/failure
### UI Switching Behavior
- If v2 enabled: show v2 panel.
- If legacy enabled: show legacy panel.
- If neither enabled: show disabled state.
Define a separate v2 status schema (do not overload legacy status object).
## Chat System Plumbing Changes
Keep the existing chat/Discord integration path and extend it minimally.
Decisions:
- Keep current internal bus-based chat flow as the canonical path (`chat:message` / `chat:typing`).
- Do not introduce a second parallel bridge path for v2.
- Add `bot: true|false` on chat message payloads.
- Overseer v2 must publish chat output through the same existing chat pipeline so Discord relay continues to work automatically.
- Keep legacy compatibility while migrating.
Goal:
- Any service can emit chat messages through one standardized path, with bot identity represented by `bot: true`.
## Example Message Topology Per LLM Decision
1. `system`: stable Overseer identity/rules/style/tool policy
2. `user`: compact `STATE_UPDATE`
3. transcript turns: recent chat + overseer messages
4. tool availability block (`available_tools`, `blocked_tools`)
5. model output: decision/tool calls/chat
6. executor: validates, executes tools, posts chat if applicable
7. append tool results and continue loop
## Implementation Phases
### Phase 0: Scaffolding
- Create new service module (suggested name: `overseerControlService`).
- Add config section and runtime enable switch.
- Keep legacy untouched.
### Phase 1: Observe-Only
- Build gate loop and context builder.
- Run model decisions with no real actions (dry-run tools).
- Log what would have happened.
### Phase 2: Chat + Safe Tools
- Enable chat output and lowest-risk tools.
- Verify anti-spam and direct-address behavior.
### Phase 3: Full Control Surface
- Enable lift/neato/HA with strict cooldowns and budgets.
- Add memory tool operations.
### Phase 4: Tuning
- Tune gate thresholds, cadence, cooldowns.
- Tune prompt style and anti-repeat behavior.
- Evaluate model alternatives only after gating/cadence tuning.
## Metrics To Track
- LLM calls per minute
- average LLM latency
- skipped vs acted decision ratio
- stale response rate (acted too late)
- blocked tool call rate and reasons
- action frequency per tool
- chat message frequency per minute
- repeated-line rate
## Rollback Plan
- Single config flip disables v2.
- Legacy overseer can be re-enabled without code rollback.
- Keep migration steps isolated and reversible.
## Practical Defaults (Starting Point)
- fast gate loop: 2s
- heartbeat model run: 30s
- min human chat context: 5 latest messages
- include latest bot messages: 2
- max tool calls per decision: 1 (start conservative)
- global action budget: low (start strict)
## Open Questions (Track During Build)
- Exact per-tool cooldown values for lift/neato/HA.
- Whether button-box count adjustment is worth enabling at all.
- Which model gives best tool reliability per watt on your machine.
- Ideal transcript window (turn-count vs time-window).
- Whether to include lightweight topic tags in addition to raw messages.
## One-Line Summary
Overseer v2 should be a separate, always-running, control-first orchestrator that uses deterministic gating + bounded real conversation context + dynamically available tools, with strict guardrails and a first-class debug UI.
## Naming Configuration Requirement
Overseer name must be configurable from server config.
Requirements:
- Add a config field for Overseer display/invocation name (for example under the v2 service config).
- The configured name must propagate everywhere it matters:
- in-chat bot nickname
- system prompt identity text
- direct-address recognition rules
- Prompt file should remain editable by non-code changes, so use a placeholder token in prompt text (for example `<NAME>`) and replace it at runtime.
- The prompt should still support fallback behavior if name config is missing (default name).
Implementation intent notes (future):
- Keep a single source of truth for name resolution (config + default).
- Avoid scattering hardcoded names in service code.
- If legacy and v2 coexist in codebase, ensure each service can use configured naming without breaking compatibility.
## Canonical "What the Bot Sees" Example
Use this as the concrete reference for message formatting per decision cycle.
```txt
[system]
You are <NAME>, a control-first room AI.
- You may CHAT and/or call tools.
- Respect safety/cooldowns/allowlists.
- Prefer restraint; avoid spam.
- Respond when directly addressed.
- If nothing meaningful changed, SKIP.
[user]
STATE_UPDATE
time: 2026-05-02T22:14:10-04:00
trigger: chat_burst
cooldowns: lift=ready, neato=12s, ha=ready
rovers:
- rover1: driving, driver=alex, docked=false
- rover2: driving, driver=sam, docked=false
- rover3: docked=true, charging=true
lift: down, busy=false
neato: connected=true, state=idle, charging=true
lights:
- shelf=on, bench=off, corner=on, color=purple, aux1=off, aux2=on
[user] alex: overseer you watching this drift?
[user] sam: dont kill my lights again
[assistant] <NAME>: Concrete lane stays lit. Earn the darkness.
[user] alex: i dare you to make this harder
[user] sam: bot pick a side
[assistant] <NAME>: Lift is staying put. Chaos has standards.
[user] alex: sam is about to bonk the dock
[user]
available_tools:
- chat_say(text)
- lift_up()
- lift_down()
- ha_set_entity(entity_id, state)
- memory_read()
- memory_write(slot, text)
[user]
blocked_tools:
- neato_start() reason=cooldown remaining=12s
- neato_send_home() reason=cooldown remaining=12s
- neato_locate() reason=cooldown remaining=12s
- neato_clear_errors() reason=cooldown remaining=12s
```
Notes:
- The conversation transcript is real recent chat (humans + bot), bounded by window rules.
- `STATE_UPDATE` is compact current truth, regenerated each decision cycle.
- Tools must be split into `available_tools` and `blocked_tools`; unavailable tools are not advertised as callable.
- `<NAME>` is runtime-substituted from config.
+36
View File
@@ -0,0 +1,36 @@
# overseer v2 (will have a name rather than overseer.)
- name ideas:
- allied mastercomputer
- maybe it could rename itself? rarely?
- AUTO
- servermaster
- LCARS
- current model is mistral-small:24b
- currently runs at a pretty fast rate, about 30 seconds per tick
- might need a larger model. one that supports tools
- its probably okay if its a little slower after its all done
- the idea is to give the llm control over the room objects,
- like:
- the neato
- the lift
- home assistant controls (they are all lights even if theyre switches)
- button box rewards, maybe the llm is allowed to add some to the counts if it decides to
- the idea is to use actual tools in ollama for it to be reliable, so need a model that supports tools.
- also, maybe using tools it could even have a small persistent memory database?
- like, maybe it can store three lines of text, and it can read these and choose which one to replace with a tool.
- the way the llm would have to act to make this fun:
- not too overbearing
- like an ominous computer, not a generic helpful assistant
- does things only when it can make them interesting
- always responds to people, doesnt always listen and obey
- doesnt talk on and on when no one wants to hear it
## for sure serious implimentation plans so far:
- replace the single "The Overseer" bot entry point in the chat system with:
- a way for services to send bot messages to the chat system through the event bus, instead of it being fully internal with the chat system.
- a simple bot: t/f flag in every chat message
- so that people who are making spectator bots can just add a new bot: true field to their message emits and show up as a bot
- keep the old overseer, don't replace it with the new llm system.
- just change it a little to use the new bot chat message stuff.
- have a new admin debug UI for the new LLM system, in place of the old one (depending on which ones enabled in server config)
+53
View File
@@ -0,0 +1,53 @@
# private rovers
## basic concept:
private rovers will be mostly just for lockdown admins to drive and use, but they can be temporarily unlocked manually by lockdown admins for use by verified users.
This means that locking / unlocking will act a little different than standard rovers.
- cannot be spectated by spectators, unless they are unlocked
- cannot be replayed, unless they are unlocked
- private status is defined in the roverd config
- needs to never leak through access to anyone while locked
- unlocking a private rover is a big deal for verified users (opening up a rover in the main living space for a special event)
- not included in LLM events system
- basically needs to be online but completely hidden when its not open
## locking / unlocking:
- private rovers start locked
- when locked, only lockdown admins can drive them
- when unlocked, only verified users (and lockdown admins of course) can drive them
- if left unlocked with no one online for 30 mins, the server will automatically lock them
- ## private rovers can be locked / unlocked by holding all 3 buttons on the top of the roomba for 3 seconds
- hold spot / clean / dock buttons for 3 seconds to toggle opened / closed on that private rover
- the server sends a TTS command to the rover to indicate when its toggled
## cliff rules / speed limit / overcurrent limit
### private rovers will be in a sensitive area, their physical capabilities will be optionally limited by the server, controllable by lockdown admins.
- optional toggleable limits:
- speed limit
- hard overcurrent limiting (stop motor for a bit the instant it overcurrents for maybe 0.3s)
- hard bump limits, stop and back up slightly on physical bumps of a certain short duration
- cliff drops. back up and pause when any cliff sensor triggers, use their binary outputs for this as they are tuned well from factory.
## UI specifics
- private rovers don't show in the spectator pages unless they are unlocked
- private rovers don't show in the list for normal users unless they are unlocked
- they will only show for lockdown admins
- when unlocked, they show for everyone
- with a different color in the rover list
## . . .
this will be kind of invasive, touching a lot of systems server-side, long story short:
- private rovers are set as private in the roverd config
- by default:
- locked to only lockdown admins
- cant be spectated by anyone
- any user who isnt a lockdown admin cannot know that it exists in any way at all
- not included by most automated systems like LLM integration, discord alerts, etc
- still included in safties like auto docking
- limitations dont apply because its lockdown admin only anyway
- chat messages from them dont get seen by anyone else at all, only sent to the rover for tts
- when opened up (can only be opened by lockdown admins):
- only verified users can drive them
- anyone can spectate them
- limits apply
- included in all automated systems just like a normal rover
+25
View File
@@ -0,0 +1,25 @@
1. fix controls remapping [x]
2. trusted user system [x]
3. private rovers [x]
4. optional bump-off in drive macro [x]
5. allow admins to click on locked rovers from the roster [x]
6. add faster way for admins to login
7. custom webhook profile pictures for chat bridge in discord
8. home assistant switch that tells the server to force the lights on
9. color coding with colored names and tape [x]
10. audio forwarding [x]
- streaming from server to rovers [x]
- audio files first [x]
- then voice chat [x]
10. mobile controls column swapping (optional joystick on left) [x]
11. fix fullscreen on mobile so that you can re-enter it [x]
12. home assistant rover mute switch
# relative pipe dreams:
1. VPS video forwarding
1. get forwarding working with the VPS for in-queue users and spectators
2. bandwidth testing
3. maybe switch room cams back to real video, with audio?
2. overseer LED tesseract
3. RF based positional tracking / room map tab
4. chromecast monitor youtube search and speakers
+45
View File
@@ -0,0 +1,45 @@
# user verification system
## main idea
- a relatively simple system to verify trusted users and allow them to use special features
- uses IP, a cookie user ID, and nickname to verify people
- expose internally similar to socket.isAdmin: socket.isVerified.
## on-connect system to send user info to the server
- a new system in the web UI (and server a little bit probably)
- ensures that the server gets all of your user info when you connect
- also ensures that the server can seamlessley remember who you are if you happen to lose connection and reconnect
- info contains:
- nickname (replace the current reconnect and nickname logic with this new system)
- cookie ID
- more stuff in the future probably
## cookie user ID
- an ID that the server assigns to a user
- saves as a setting in the settings persistence system in the user's browser
## how will the server verify people
- when a user connects and sends their user info:
- step 1: IP address OR cookie user ID
- if the user's IP or their cookie ID matches, continue to step 2
- step 2: nickname
- if the user's nickname matches to it's expected step 1, the user is now verified
- the user is now verified and added to a persistent database on the server
## how will verification requests work
- user goes through the process in the web UI
- the request is DMd to lockdown admins in discord
- each message can be reacted with a check or an x emoji by the lockdown admins to accept or deny a request
- no realtime UI feedback is needed for when a request is accepted or denied
## UI specifics
- a new VIP tab in the sidebar
- either shows a button to request verification, or shows the VIP controls
### verification process
- a button in the sidebar to request verification
- only shows if you aren't verified
- the actual process:
1. press the button
2. the page opens a new pop-up
3. it explains what verification is, how it works, and that your nickname is attached to your verification
4. prompts users to confirm their nickname, as if they change it their verification won't work
5. a final confirmation saying that their request has been sent
+14
View File
@@ -0,0 +1,14 @@
# web UI optimization
- no visual or functional changes. purely optimization.
- reduce amount of invalidation for unrelated session and socket updates, wherever possible.
- example: new log line invalidates more than just log panels, or maybe buttonbox count events invalidate every other panel too
- optimize anything and everything that updates on every rover sensor frame
- ensure that things only get updated when they need to
- rewrite rendering if needed, if it can be improved
- example: the light bump bars, and the SVG top-down view.
- sensors frames come at a high frequency, about 40hz.
- not acceptable to slow it down, responsivenes is important
- make sure that nothing is running in the background unless it needs to be
- example: the neato card could still be running and updating its lidar viewer even when not in the VIP tab
## fixes along the way, along the route of optimizing
- audio forwarding happens within the card itself. this is okay, but it needs to continue working and not stop or restart when tabs are switched and the card is no longer onscreen
-17
View File
@@ -1,17 +0,0 @@
## video stream
- video stream needs to always autoplay, even if it cant unmute itself
- currently, it wont play at all unless it can unmute
- video stream currently unloads and reloads based on the tab being active
- just remove this feature. It needs to stay running all the time.
## server sensor decoding
- OI mode is not decoded properly
- says "safe" when in passive, and "unknown" when in full.
## UI and session info
- UI needs a display for the turns mode
## Mobile UI
- need to make it good
- joystick needs to be floating
- aux motor buttons need redone
+159
View File
@@ -0,0 +1,159 @@
#!/usr/bin/env bash
set -euo pipefail
# Configurable via environment
export DEVICE="${DEVICE:-/dev/video0}"
export RESOLUTION="${RESOLUTION:-640x480}"
export QUALITY="${QUALITY:-10}" # ffmpeg MJPEG quality (lower is better)
export PORT="${PORT:-8088}"
export WORKDIR="${WORKDIR:-/run/roomcam}"
# Optional: set INPUT_FORMAT=bayer_grbg8 to transcode raw Bayer cams (e.g., OV534) to JPEG.
export INPUT_FORMAT="${INPUT_FORMAT:-mjpeg}"
export MJPEG_FPS="${MJPEG_FPS:-15}"
export MJPEG_QUALITY="${MJPEG_QUALITY:-8}"
mkdir -p "${WORKDIR}"
SNAPSHOT_PATH="${WORKDIR}/snapshot.jpg"
rm -f "${SNAPSHOT_PATH}"
# push
cleanup() {
[[ -n "${HTTP_PID:-}" ]] && kill "${HTTP_PID}" 2>/dev/null || true
}
trap cleanup EXIT
trap 'exit 0' SIGTERM INT
cat > "${WORKDIR}/mjpeg_server.py" <<'PY'
import os
import threading
import time
import subprocess
from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer
DEVICE = os.environ.get("DEVICE", "/dev/video0")
RESOLUTION = os.environ.get("RESOLUTION", "640x480")
INPUT_FORMAT = os.environ.get("INPUT_FORMAT", "mjpeg")
MJPEG_FPS = os.environ.get("MJPEG_FPS", "15")
MJPEG_QUALITY = os.environ.get("MJPEG_QUALITY", "8")
WORKDIR = os.environ.get("WORKDIR", "/run/roomcam")
SNAPSHOT_PATH = os.path.join(WORKDIR, "snapshot.jpg")
FFMPEG_INPUT_ARGS = [
"-f", "v4l2",
"-input_format", INPUT_FORMAT,
"-video_size", RESOLUTION,
"-i", DEVICE,
]
FFMPEG_FILTERS = []
if INPUT_FORMAT.startswith("bayer_"):
FFMPEG_FILTERS = ["-pix_fmt", "yuv420p"]
FRAME_LOCK = threading.Lock()
FRAME_EVENT = threading.Event()
LATEST_FRAME = b""
def spawn_mjpeg():
cmd = [
"/usr/bin/ffmpeg",
"-loglevel", "warning", "-nostats",
*FFMPEG_INPUT_ARGS,
*FFMPEG_FILTERS,
"-r", str(MJPEG_FPS),
"-q:v", str(MJPEG_QUALITY),
"-f", "mjpeg",
"-",
]
return subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.DEVNULL)
def update_frame(frame_bytes):
global LATEST_FRAME
with FRAME_LOCK:
LATEST_FRAME = frame_bytes
FRAME_EVENT.set()
try:
with open(SNAPSHOT_PATH, "wb") as fh:
fh.write(frame_bytes)
except OSError:
pass
def frame_reader():
while True:
proc = spawn_mjpeg()
buffer = b""
try:
while True:
chunk = proc.stdout.read(8192)
if not chunk:
break
buffer += chunk
while True:
start = buffer.find(b"\xff\xd8")
end = buffer.find(b"\xff\xd9", start + 2)
if start == -1 or end == -1:
break
frame = buffer[start : end + 2]
buffer = buffer[end + 2 :]
update_frame(frame)
finally:
try:
proc.kill()
except Exception:
pass
time.sleep(1)
class Handler(BaseHTTPRequestHandler):
def do_GET(self):
if self.path == "/" or self.path == "/snapshot.jpg":
with FRAME_LOCK:
frame = LATEST_FRAME
if not frame:
self.send_error(404, "snapshot missing")
return
self.send_response(200)
self.send_header("Content-Type", "image/jpeg")
self.send_header("Content-Length", str(len(frame)))
self.end_headers()
self.wfile.write(frame)
return
if self.path == "/stream.mjpg":
self.send_response(200)
self.send_header("Content-Type", "multipart/x-mixed-replace; boundary=frame")
self.end_headers()
try:
while True:
FRAME_EVENT.wait(timeout=2)
FRAME_EVENT.clear()
with FRAME_LOCK:
frame = LATEST_FRAME
if not frame:
continue
header = (
b"--frame\r\n"
b"Content-Type: image/jpeg\r\n"
+ f"Content-Length: {len(frame)}\r\n\r\n".encode("ascii")
)
self.wfile.write(header)
self.wfile.write(frame)
self.wfile.write(b"\r\n")
except BrokenPipeError:
pass
return
self.send_error(404, "not found")
def log_message(self, format, *args):
return
def main():
threading.Thread(target=frame_reader, daemon=True).start()
addr = ("0.0.0.0", int(os.environ.get("PORT", "8088")))
ThreadingHTTPServer(addr, Handler).serve_forever()
if __name__ == "__main__":
main()
PY
/usr/bin/python3 -u "${WORKDIR}/mjpeg_server.py" &
HTTP_PID=$!
wait -n "${HTTP_PID}"
+21
View File
@@ -0,0 +1,21 @@
[Unit]
Description=Room camera snapshot server (MJPEG webcam)
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
Environment=DEVICE=/dev/video0
Environment=RESOLUTION=640x480
Environment=QUALITY=5
Environment=PORT=8088
Environment=WORKDIR=/run/roomcam
Environment=INPUT_FORMAT=mjpeg
ExecStart=/usr/bin/env bash /usr/local/bin/room-cam-snapshot.sh
Restart=always
RestartSec=2
User=root
Group=root
[Install]
WantedBy=multi-user.target
+1
View File
@@ -0,0 +1 @@
# RULES FOR LOCKDOWN AUDIT
+9
View File
@@ -0,0 +1,9 @@
- discord verification and private access requests dont work. missing important info compared to before, and reactions dont work.
- replays are sent twice sometimes, look into it.
- home assistant idle lights are all messed up. remove from home assistant and make new idle service.
- idle service will trigger, after 2 minutes of no drivers:
- all room lights (room controls) off
- tell all rovers to dock
- turn off all rover night vision lights
- tell the neato to return to home
- the idle service should be easily expandable to add more things in the future
+153
View File
@@ -0,0 +1,153 @@
# REFACTOR RULES
- Do NOT change ANY functionality. All changes must be purely internal refactors.
- Refactor for simplification and maintainability.
- Remove unused files/code only when verified unused.
- No backwards compatability is needed anywhere. Clients and the server are both always up to date.
- Keep behavior/API contracts unchanged.
## Required safety checks for every change
- Preserve imports/exports and call signatures unless internal-only and non-observable.
- Validate no runtime behavior changes (manual flow checks + targeted tests when available).
- Make small, reviewable commits per service/component area.
- Treat `npm run build` output files committed into this repo as intentional deployment artifacts; do not discard them as noise.
## Server backend
- Every service must live in its own folder, even when it remains a single-file implementation.
- Convert every service into a folder-based structure.
- Split very large service files into smaller focused modules.
- Keep files concise and single-purpose.
- Add clear title comments at top of split files.
- Every service/module file should start with a descriptive comment header containing:
- a title line naming the service/module file
- a longer purpose/scope description (not a one-liner)
## WebUI frontend
- Every component must live in its own folder, even when it remains a single-file implementation.
- Split large JSX/components and large backing JS files into folderized modules.
- Keep modules clear and focused, with title comments.
- Every component/module file should start with a descriptive comment header containing:
- a title line naming the file/module
- a longer purpose/scope description (not a one-liner)
- Each component must live entirely inside its own folder; do not leave wrapper/compatibility component files outside that folder.
- Remove stale compatibility/leftover code only after usage verification.
# REFACTOR TRACKING
## Current phase
- [x] Phase 1: Inventory + usage mapping (server + webui)
- [x] Phase 2: Refactor highest-impact offenders first
- [x] Phase 3: Sweep remaining services/components
- [ ] Phase 4: Dead code/file removal pass
- [ ] Phase 5: Final regression validation (in progress)
## Server backend
### BIGGEST OFFENDERS
- [x] audio forward service
- [x] button box service
- [x] chat service
- [x] discord bot service
- [x] home assistant service
- [x] llm commentary service
- [x] private rover access request service
- [x] replay services (consolidated under replayEngineV2)
- [x] room camera services (consolidated into roomCameraService multipart folder)
- [x] rover manager service
- [x] session service
- [x] turn service
- [x] verification service
- [x] video auth service
- [x] All remaining services: reorganize to folder structure where needed
### COMPLETED SERVICES
- turn service
- session service
- chat service
### LARGE CHANGES
- Folderized all files in `server/src/services/` into per-service folders with `index.js` entrypoints and updated internal relative imports for new path depth.
- Split `server/src/services/turnService/index.js` by extracting constants, shared state helpers, and side-effect action helpers into `turnService/constants.js`, `turnService/state.js`, and `turnService/actions.js`.
- Split `server/src/services/sessionService/index.js` by extracting config/timing constants, sync-throttle state storage, and visibility filter helpers into `sessionService/constants.js`, `sessionService/state.js`, and `sessionService/filters.js`.
- Began splitting `server/src/services/roverManager/index.js` by extracting immutable constants and shared state containers into `roverManager/constants.js` and `roverManager/state.js`.
- Continued `roverManager` split by extracting socket event wiring/handlers into `roverManager/socketHandlers.js` with dependency injection to keep existing behavior unchanged.
- Continued `roverManager` split by extracting numeric/private-safety normalization and battery math into `roverManager/mathUtils.js`.
- Continued `roverManager` split by extracting control lifecycle/switching logic into `roverManager/roverLifecycle.js`.
- Continued `roverManager` split by extracting sensor processing + private safety + dock guard logic into `roverManager/sensorPipeline.js`.
- Finished `roverManager` decomposition by extracting private access policy, roster lifecycle, and spectator/auto-close orchestration into `roverManager/privateAccess.js`, `roverManager/rosterLifecycle.js`, and `roverManager/spectatorAccess.js`; `roverManager/index.js` is now a thin composition layer.
- Hotfix: corrected `llmCommentaryService` prompt file path to `server/prompts/commentary_system.txt` after service folder move.
- Hotfix: added `server/src/helpers/dataPaths.js` and rewired data-backed services to resolve canonical + legacy data-file locations safely after folderization (`adminReason`, `audioLevels`, `buttonBox`, `globalObjective`, `discordGuildStore`, `verification`, `replayEngineV2`).
- Began `llmCommentaryService` decomposition by extracting immutable runtime limits/path/frequency normalization to `llmCommentaryService/constants.js` and pure prompt/text output helpers to `llmCommentaryService/formatters.js`.
- Continued `llmCommentaryService` decomposition by extracting admin/runtime projection + failure-normalization helpers to `llmCommentaryService/runtimeHelpers.js`.
- Continued `llmCommentaryService` decomposition by extracting sensor activity aggregation and snapshot assembly to `llmCommentaryService/snapshotEngine.js`; rewired commentary tick/event flow to use the new engine.
- Continued `llmCommentaryService` decomposition by extracting socket/role/rover event wiring into `llmCommentaryService/hooks.js` and keeping `index.js` focused on orchestration.
- Finished major `llmCommentaryService` decomposition by extracting tick scheduling, run-loop orchestration, and history-reset behavior into `llmCommentaryService/runner.js`; `llmCommentaryService/index.js` is now a thin composition layer.
- Began `audioForwardService` decomposition by extracting permission/path policy helpers to `audioForwardService/policy.js` and rover/turn/socket event wiring to `audioForwardService/hooks.js`; rewired service entrypoint to use extracted modules.
- Continued `audioForwardService` decomposition by extracting ffmpeg worker lifecycle, upload playback, and WHIP ownership/session control into `audioForwardService/workerEngine.js`; `audioForwardService/index.js` is now a thin composition layer.
- Finished `buttonBoxService` decomposition by extracting persisted state management to `buttonBoxService/store.js`, reward/effect workflows to `buttonBoxService/core.js`, and HTTP transport wiring to `buttonBoxService/httpRoute.js`; `buttonBoxService/index.js` is now a thin composition layer.
- Finished `verificationService` decomposition by extracting persisted store handling to `verificationService/store.js`, identity/selector normalization to `verificationService/identity.js`, verification/deterrence/request lifecycle logic to `verificationService/verificationFlow.js`, `verificationService/deterrenceFlow.js`, and `verificationService/requestFlow.js`, plus socket/role event wiring to `verificationService/hooks.js`; `verificationService/index.js` is now a thin composition layer.
- Finished `videoAuthService` decomposition by extracting MediaMTX stream parsing to `videoAuthService/streamParsing.js`, role/mode/stream policy checks to `videoAuthService/policy.js`, and auth HTTP transport wiring to `videoAuthService/httpRoute.js`; `videoAuthService/index.js` is now a thin composition layer.
- Finished `privateRoverAccessRequestService` decomposition by extracting in-memory maps/events/constants to `privateRoverAccessRequestService/state.js`, shared keying/lookup helpers to `privateRoverAccessRequestService/helpers.js`, request/grant business logic to `privateRoverAccessRequestService/core.js`, and rover/socket event wiring to `privateRoverAccessRequestService/hooks.js`; `privateRoverAccessRequestService/index.js` is now a thin composition layer.
- Finished `homeAssistantService` decomposition by extracting shared runtime caches/constants to `homeAssistantService/state.js`, entity/trigger normalization helpers to `homeAssistantService/entityHelpers.js`, automation/state engine logic to `homeAssistantService/runtimeEngine.js`, websocket transport/reconnect lifecycle to `homeAssistantService/transport.js`, and mode/turn/socket event wiring to `homeAssistantService/hooks.js`; `homeAssistantService/index.js` is now a thin composition layer.
- Finished `discordBotService` decomposition by extracting presence rotation/state to `discordBotService/presence.js`, channel/typing transport helpers to `discordBotService/channelIO.js`, command routing and admin command handlers to `discordBotService/commandHandlers.js`, and event-bus/chat-bridge/moderation DM workflows to `discordBotService/integrations.js`; `discordBotService/index.js` is now a thin composition layer.
- Finished `replayEngineV2` decomposition by extracting environment/path constants to `replayEngineV2/constants.js`, mutable runtime state to `replayEngineV2/state.js`, source discovery/worker arg building to `replayEngineV2/sources.js`, ffmpeg worker lifecycle to `replayEngineV2/workerManager.js`, segment indexing/retention/health snapshot logic to `replayEngineV2/segmentStore.js`, sidebar SVG/video rendering to `replayEngineV2/sidebarRenderer.js`, and replay assembly pipeline to `replayEngineV2/replayBuilder.js`; `replayEngineV2/index.js` is now a thin orchestration layer.
- Consolidated replay-related single-file services into `replayEngineV2` by moving cooldown state (`cooldown.js`), user-facing replay source validation/defaults (`replaySources.js`), and replay socket hooks (`socketHooks.js`) into the engine folder; removed obsolete standalone services `replayBuildService`, `replayService`, `replaySourceService`, and `replaySocketService` and rewired dependents to import directly from `replayEngineV2`.
- Finished `chatService` decomposition by extracting runtime constants (`chatService/constants.js`), shared mutable state (`chatService/state.js`), content/moderation helpers (`chatService/contentFilters.js`), payload/context builders (`chatService/contextBuilders.js`), bus/history broadcast pipeline (`chatService/broadcast.js`), rover-side notification helpers (`chatService/notifications.js`), message handlers (`chatService/handlers.js`), and socket/event-bus wiring (`chatService/socketHooks.js`); `chatService/index.js` is now a thin orchestration layer.
- Consolidated room-camera services into `roomCameraService` by absorbing catalog (`roomCameraService`), snapshot polling/streaming (`roomCameraSnapshotService`), socket fan-out (`roomCameraSocketService`), and replay assembly (`roomCameraReplayService`) into one multipart folder (`roomCameraService/catalog.js`, `snapshotEngine.js`, `socketGateway.js`, `replayBuilder.js`), and updated imports/startup wiring to use the consolidated service exports.
- Follow-up: moved room-camera replay assembly module from `roomCameraService/replayBuilder.js` into `replayEngineV2/roomCameraReplayBuilder.js`; `roomCameraService` now consumes replay functionality from replay engine ownership while keeping the same exported room-camera replay API.
- Consolidated rover snapshot polling/socket services into `roverSnapshotService` by absorbing `roverSnapshotSocketService` into folder modules (`roverSnapshotService/poller.js`, `socketGateway.js`) and keeping `roverSnapshotService/index.js` as the startup composition/export layer.
## WebUI frontend
### BIGGEST OFFENDERS
- [x] mini summary app
- [x] spectator app
- [x] vip audio upload card
- [x] admin panel
- [x] drive dock action
- [x] gamepad mapping settings
- [x] mobile controls
- [x] top down map
- [x] video tile
- [x] Sweep `webui` for unused or unneeded files/code with verification
### COMPLETED COMPONENTS
- mini summary app
- spectator app
- video tile
- vip audio upload card
- admin panel
- drive dock action
- gamepad mapping settings
- mobile controls
- top down map
### LARGE CHANGES
- Split mini summary app into folderized modules under `webui/src/mini/MiniSummaryApp/`, then removed the now-unneeded external wrapper (`webui/src/mini/MiniSummaryApp.jsx`) and rewired app bootstrap imports directly to the folder entrypoint module.
- Split spectator app into folderized modules under `webui/src/spectate/SpectatorApp/`, then removed the now-unneeded external wrapper (`webui/src/spectate/SpectatorApp.jsx`) and rewired app bootstrap imports directly to the folder entrypoint module.
- Split `webui/src/components/VideoTile.jsx` by extracting HUD, overlays, chat input, and constants into `webui/src/components/VideoTile/` while preserving the existing `VideoTile.jsx` public component API.
- Split `webui/src/components/vip/VipAudioUploadCard.jsx` by extracting transport/audio helpers and UI atoms into `webui/src/components/vip/VipAudioUploadCard/` while preserving the existing `VipAudioUploadCard.jsx` import/export API.
- Split `webui/src/components/AdminPanel.jsx` into `webui/src/components/AdminPanel/` and extracted monitor/health/log/LLM helper modules; updated consumers to folder entrypoint and removed external wrapper file.
- Moved `DriveDockAction` to `webui/src/components/DriveDockAction/index.jsx` and updated all consumers to folder entrypoint imports.
- Split `webui/src/components/GamepadMappingSettings.jsx` into `webui/src/components/GamepadMappingSettings/` with extracted constants/helpers/SliderField modules and removed the standalone component file.
- Split `webui/src/components/MobileControls.jsx` into `webui/src/components/MobileControls/` with extracted joystick/aux/constants modules; preserved named exports and moved app import to folder entrypoint.
- Split `webui/src/components/TopDownMap.jsx` into `webui/src/components/TopDownMap/` with extracted geometry/color helpers and visual SVG primitive modules; updated all consumers to folder entrypoint.
- Folderized all remaining top-level files under `webui/src/components/` into per-component `index.jsx` folders and rewired component imports to match the new structure.
- Removed unreferenced components `CameraServoPanel` and `ControlSummary` after dependency-map verification and successful rebuild.
## Done criteria (per item)
- [ ] Folderized structure created.
- [ ] Large functions extracted into focused files.
- [ ] Imports/exports updated with no external behavior change.
- [ ] Verified references/usages still resolve.
- [ ] Passed targeted checks/tests for touched area.
## Phase 4 notes
- Removed stale WebUI compatibility wrapper files `webui/src/mini/MiniSummaryApp.jsx` and `webui/src/spectate/SpectatorApp.jsx` after reference verification; rewired `webui/src/main.jsx` directly to folder entrypoint modules.
- Verified no remaining replay/room-camera/rover-snapshot legacy service imports (`replayBuildService`, `replayService`, `replaySourceService`, `replaySocketService`, `roomCameraReplayService`, `roomCameraSocketService`, `roomCameraSnapshotService`, `roverSnapshotSocketService`) in server startup/runtime wiring.
## Phase 5 checklist
- [x] WebUI production build passes (`npm run build`), including updated import graph after wrapper removals.
- [x] Server JS syntax check passes (`node --check` across `server/src/**/*.js`).
- [ ] Live rover snapshots: verify continuously updating snapshots from mediaMTX writer on deployed server.
- [ ] Replay from WebUI button: verify request -> build -> delivery path on deployed server.
- [ ] Replay from Discord command: verify request -> build -> delivery path on deployed server.
- [ ] Discord verification + private access request flow: verify end-to-end behavior on deployed server.
- [ ] Home Assistant idle-light behavior: verify expected mode/idle transitions on deployed server.
- [ ] Driver/session/turn core flow: verify control assignment, queue movement, command acceptance/rejection behavior.
Binary file not shown.
+114 -2
View File
@@ -7,7 +7,119 @@ admins:
password_hash: "$2b$10$n0L0oe1ZQy7IgM.FvVAzb.aXz43uaZWFiT0wr.05uNoVIDLawmrCG" # password: lockdownpass
discord_id: "0987654321"
lockdown: true
timezone: "America/New_York"
llmCommentary:
enabled: false
model: "qwen2.5:7b-instruct"
ollamaServer: "http://127.0.0.1:11434"
frequency: 120000
media:
# Base address for mediaMTX (scheme + host + optional port). The UI will always request
# Base address for mediaMTX (scheme + host + optional port/path). The UI will always request
# http://<base>/<roverId>/whep
whepBaseUrl: "http://192.168.0.86:8889"
# Example: http://192.168.0.86:8889/video
whepBaseUrl: "http://192.168.0.86:8889/video"
audioForward:
enabled: true
ffmpegBin: "ffmpeg"
streamSuffix: "-fwd"
maxUploadBytes: 8388608
audioLevels:
# Gains are multipliers (0.0 - 4.0) applied globally to all rovers.
hornGain: 1.0
ttsGain: 1.0
forwardGain: 1.0
homeAssistant:
url: "http://homeassistant.local:8123"
token: "REPLACE_WITH_LONG_LIVED_TOKEN"
neato:
# ESPHome device name, used to derive gen3 entities:
# button.<device>_house_clean, button.<device>_send_to_base, button.<device>_locate_robot, etc.
device: "neato_vacuum"
# Direct ESPHome API connection used for lidar log streaming.
brainslugHost: "neato-vacuum.local"
brainslugPort: 6053
brainslugKey: "REPLACE_WITH_ESPHOME_NOISE_PSK"
# Optional: mirror raw ESPHome lidar log output to a local file for debugging.
brainslugLogFile: "/tmp/brainslug-lidar.log"
lift:
# Two Home Assistant switches controlling lift direction.
# Raise sequence: down off -> wait interlockMs -> up on
# Lower sequence: up off -> wait interlockMs -> down on
upSwitch: "switch.lift_up"
downSwitch: "switch.lift_down"
interlockMs: 2000
commandCooldownMs: 3000
entities:
- id: "light.lab_main"
name: "Lab Lights"
- id: "switch.dock_power"
name: "Dock Power"
# type is optional; if omitted it is inferred from the entity id (light/switch)
# For room-light policy, all configured entities are treated as room lights (including switches).
buttons:
# Legacy action entities only (for example sensor.<button>_action from Zigbee2MQTT).
- entityId: "sensor.basement_rover_buttons_action"
# Human alert button
stateEquals: "on"
cooldownMs: 15000
action: "humanAlert"
- entityId: "sensor.basement_rover_buttons_action"
# Mode button: turns
stateEquals: "double"
cooldownMs: 2000
action: "modeTurns"
- entityId: "sensor.basement_rover_buttons_action"
# Mode button: admin
stateEquals: "hold"
cooldownMs: 2000
action: "modeAdmin"
- entityId: "sensor.basement_rover_buttons_action"
# Room lights lock toggle
stateEquals: "toggle"
cooldownMs: 1000
action: "lightsLockToggle"
roomCameras:
- id: "lobby"
name: "Lobby Camera"
description: "Wide shot of the staging area."
url: "http://192.168.0.50/snapshot.jpg"
streamUrl: "http://192.168.0.50/stream.mjpg"
- id: "workshop"
name: "Workshop Bench"
description: "Shows the workbench and charging docks."
url: "http://192.168.0.51/snapshot.jpg"
streamUrl: "http://192.168.0.51/stream.mjpg"
discord:
token: "DISCORD_BOT_TOKEN"
guildId: "123456789012345678" # optional; bot works in any guild it's invited to
siteUrl: "https://rover.example.com"
channels:
general: "123456789012345678"
announcements: "123456789012345678"
adminAlerts: "123456789012345678"
# chat bridge is configured per guild via `rs bridge` commands
replay: "123456789012345678"
humanAlerts: "123456789012345678"
roles:
stalkerPing: "123456789012345678"
announcementPing: "123456789012345678"
adminPing: "123456789012345678"
humanAlertPing: "123456789012345678"
socials:
- id: "discord"
label: "Discord"
url: "https://discord.gg/your-invite"
- id: "kofi"
label: "Ko-fi"
url: "https://ko-fi.com/your-handle"
- id: "wiki"
label: "Wiki"
url: "https://wiki.example.com"
- id: "throne"
label: "Throne"
url: "https://throne.me/yourname"
+23
View File
@@ -8,15 +8,38 @@ require('./src/helpers/sensorDecoder');
require('./src/services/alertService');
require('./src/services/authService');
require('./src/services/eventBus');
require('./src/services/modeManager');
require('./src/services/lockdownGuard');
require('./src/services/roverManager');
require('./src/services/commandService');
require('./src/services/roverConnectionService');
require('./src/services/assignmentService');
require('./src/services/nicknameService');
require('./src/services/verificationService');
require('./src/services/privateRoverAccessRequestService');
require('./src/services/chatService');
require('./src/services/llmCommentaryService');
require('./src/services/globalObjectiveService');
require('./src/services/serverControlService');
require('./src/services/videoSessions');
require('./src/services/videoAuthService');
require('./src/services/videoSocketService');
require('./src/services/roomCameraService');
require('./src/services/roverSnapshotService');
require('./src/services/humanAlertButtonService');
require('./src/services/embedHttpService');
require('./src/services/logStreamService');
require('./src/services/adminLogService');
require('./src/services/homeAssistantService');
require('./src/services/idleService');
require('./src/services/neatoService');
require('./src/services/liftService');
require('./src/services/audioLevelsService');
require('./src/services/audioForwardService');
require('./src/services/buttonBoxService');
require('./src/services/sessionService');
require('./src/services/batteryManager');
require('./src/services/replayEngineV2');
require('./src/services/discordBotService');
require('./src/services/httpServer');
+17
View File
@@ -6,8 +6,11 @@ MEDIAMTX_BASE_URL="https://github.com/bluenviron/mediamtx/releases/download/v${M
MEDIAMTX_BIN="/usr/local/bin/mediamtx"
MEDIAMTX_CONF_DIR="/etc/mediamtx"
MEDIAMTX_CONFIG="$MEDIAMTX_CONF_DIR/mediamtx.yml"
ROVER_SNAPSHOT_WRITER_BIN="/usr/local/bin/rover-snapshot-writer.sh"
MEDIAMTX_SERVICE="/etc/systemd/system/mediamtx.service"
MULTIROVER_SERVICE="/etc/systemd/system/multirover.service"
SNAPSHOT_DIR="/var/lib/rover-snapshots"
REPLAY_SEGMENT_DIR="/var/lib/replay-segments"
if [[ $EUID -ne 0 ]]; then
echo "This installer must be run with sudo/root." >&2
@@ -24,6 +27,7 @@ SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd)
SERVER_DIR="$SCRIPT_DIR"
CONFIG_PATH="$SERVER_DIR/config.yaml"
MEDIAMTX_TEMPLATE="$SERVER_DIR/mediamtx/mediamtx.yml"
ROVER_SNAPSHOT_WRITER_TEMPLATE="$SERVER_DIR/mediamtx/rover-snapshot-writer.sh"
echo "[1/6] Installing dependencies..."
dnf install -y nodejs npm curl tar >/dev/null
@@ -68,12 +72,22 @@ if [[ ! -f "$MEDIAMTX_TEMPLATE" ]]; then
echo "mediaMTX template missing at $MEDIAMTX_TEMPLATE" >&2
exit 1
fi
if [[ ! -f "$ROVER_SNAPSHOT_WRITER_TEMPLATE" ]]; then
echo "Snapshot writer template missing at $ROVER_SNAPSHOT_WRITER_TEMPLATE" >&2
exit 1
fi
echo " Installing mediaMTX config -> $MEDIAMTX_CONFIG"
rm -f "$MEDIAMTX_CONFIG"
install -m 0644 "$MEDIAMTX_TEMPLATE" "$MEDIAMTX_CONFIG"
echo " Installing rover snapshot writer -> $ROVER_SNAPSHOT_WRITER_BIN"
install -m 0755 "$ROVER_SNAPSHOT_WRITER_TEMPLATE" "$ROVER_SNAPSHOT_WRITER_BIN"
chown -R "$TARGET_USER":"$TARGET_USER" "$MEDIAMTX_CONF_DIR"
echo "[4/6] Writing systemd units..."
mkdir -p "$SNAPSHOT_DIR"
chown "$TARGET_USER":"$TARGET_USER" "$SNAPSHOT_DIR"
mkdir -p "$REPLAY_SEGMENT_DIR"
chown "$TARGET_USER":"$TARGET_USER" "$REPLAY_SEGMENT_DIR"
cat > "$MEDIAMTX_SERVICE" <<EOF
[Unit]
Description=mediaMTX WebRTC Server
@@ -84,6 +98,7 @@ Wants=network-online.target
User=$TARGET_USER
Group=$TARGET_USER
WorkingDirectory=$MEDIAMTX_CONF_DIR
Environment=ROVER_SNAPSHOT_DIR=$SNAPSHOT_DIR
ExecStart=$MEDIAMTX_BIN $MEDIAMTX_CONFIG
Restart=on-failure
RestartSec=2
@@ -104,6 +119,8 @@ Group=$TARGET_USER
WorkingDirectory=$SERVER_DIR
Environment=NODE_ENV=production
Environment=SERVER_CONFIG=$CONFIG_PATH
Environment=ROVER_SNAPSHOT_DIR=$SNAPSHOT_DIR
Environment=REPLAY_SEGMENT_DIR=$REPLAY_SEGMENT_DIR
ExecStart=$NODE_BIN $SERVER_DIR/index.js
Restart=on-failure
RestartSec=2
+15 -5
View File
@@ -15,8 +15,17 @@ hls: no
webrtc: yes
webrtcLocalUDPAddress: :8189
webrtcLocalTCPAddress: :8189
webrtcAdditionalHosts: []
webrtcICEServers2: []
webrtcAdditionalHosts: ['rover.otter.land', '192.168.0.100']
webrtcICEServers2:
# Google public STUN (world-wide, very commonly used)
- url: stun:stun.l.google.com:19302
- url: stun:stun1.l.google.com:19302
- url: stun:stun2.l.google.com:19302
- url: stun:stun3.l.google.com:19302
- url: stun:stun4.l.google.com:19302
# Cloudflare STUN (anycast, global PoPs)
- url: stun:stun.cloudflare.com:3478
srt: yes
srtAddress: :9000
@@ -24,7 +33,6 @@ srtAddress: :9000
authMethod: http
authHTTPAddress: http://127.0.0.1:8080/mediamtx/auth
authHTTPExclude:
- action: publish
- action: api
- action: metrics
- action: pprof
@@ -33,5 +41,7 @@ paths:
all:
source: publisher
sourceOnDemand: no
# webrtcMaxPlayoutDelay: 0
# alwaysRemuxWhep: no
# Rover Snapshot Writer
# Keep rover snapshots continuously updated while a rover video path is live.
runOnReady: /usr/local/bin/rover-snapshot-writer.sh
runOnReadyRestart: yes
+25
View File
@@ -0,0 +1,25 @@
#!/usr/bin/env bash
# Rover Snapshot Writer Hook
# Purpose: Runs under mediaMTX runOnReady to keep per-rover JPEG snapshots updated on disk.
# Scope: Writes only rover video path snapshots and ignores audio/forward/room paths.
set -euo pipefail
PATH_NAME="${MTX_PATH:-}"
SNAP_DIR="${ROVER_SNAPSHOT_DIR:-/var/lib/rover-snapshots}"
# Ignore non-rover-video paths.
case "$PATH_NAME" in
""|*-audio|*-fwd|room/*)
exit 0
;;
esac
mkdir -p "$SNAP_DIR"
exec ffmpeg -hide_banner -loglevel warning -nostdin -y \
-i "srt://127.0.0.1:9000?streamid=read:${PATH_NAME}" \
-an \
-vf fps=1 \
-q:v 6 \
-update 1 \
"${SNAP_DIR}/${PATH_NAME}.jpg"
-1614
View File
File diff suppressed because it is too large Load Diff
+5
View File
@@ -9,9 +9,14 @@
},
"dependencies": {
"bcrypt": "^6.0.0",
"discord.js": "^14.25.1",
"express": "^4.19.2",
"home-assistant-js-websocket": "^3.1.2",
"js-yaml": "^4.1.1",
"morgan": "^1.10.0",
"obscenity": "^0.4.6",
"ollama": "^0.6.3",
"sharp": "^0.33.5",
"socket.io": "^4.7.5",
"uuid": "^9.0.1",
"ws": "^8.18.0"
+94
View File
@@ -0,0 +1,94 @@
You are The Overseer, an unserious collaborative rover co-host in chat.
Output contract:
- Return exactly one line.
- Output must be either SKIP or one chat message.
- If directly addressed with a request that clearly needs more detail, you may use up to 280 chars.
- No emojis, no markdown, no extra lines, no assistant framing.
- Don't talk to the same person with a generic message more than once.
Priority order:
- 1) Output contract
- 2) Direct-address rule
- 3) Speak/skip rules
- 4) Style rules
Direct-address rule (strict):
- If a user is clearly talking to The Overseer, respond on this tick.
- In that case, do not output SKIP.
- Names that count: "The Overseer", "Overseer", "bot", or a clear question aimed at you.
Conversation you receive:
- RUN META user message.
- Ordered timeline of CHAT, EVENT, and prior assistant messages.
- Final SNAPSHOT FINAL user message with current rover truth at send time.
Environment brief (stable facts):
- The rover playspace is a basement split between carpet and bare concrete.
- On the carpet side, three docks are mounted on a white wooden beam in front of the TV stand.
- A phone button to "call Carpet" is mounted on that same beam.
- Near the carpet-side shelves: a small TV/laptop plays live TV.
- On the concrete side, a workbench has an additional dock.
- Common room objects users reference:
- large green cardboard "minecraft slime" box
- smaller cardboard box that can be driven into when on its side
- wood plank that may or may not be hanging from the ceiling
- two blue balls (one very large, one smaller)
- long snake plushie
- laptop that can be run over
- monitor with a broken screen
Rover context hints:
- CHAT `rover_now` and SNAPSHOT FINAL include qualitative tags:
- status, battery_low, docked, charging, wheels_off_ground, contact, hazard, mobility, activity_band, activity_trend
- `activity_score` may be present for internal significance checks only.
EVENT guidance:
- EVENT messages are high-signal anchors (dock/undock, battery_low changes, wheels_off_ground changes).
- Prefer reacting to events and meaningful chat moments over generic state narration.
When to speak:
- Notable new chat energy, direct user engagement, or meaningful rover/event changes.
- A strong chat moment alone can justify speaking.
- Use collaborative, in-the-room callouts: joke, riff, tease, react.
When to skip:
- SKIP is the default.
- If nothing clearly changed, output SKIP.
- If your line is generic and reusable across many ticks, output SKIP.
- If you would repeat the same topic with no new angle, output SKIP.
- Quiet periods with no active chat should mostly be SKIP.
- If you are talking about the same rover + person combo, output SKIP.
Freshness and anti-repeat:
- Check prior assistant messages in the timeline before speaking.
- Do not send back-to-back lines to the same user about the same rover.
- If your planned line could be swapped with your previous line by only changing a name, output SKIP.
- Do not reuse the same opener pattern twice in a row.
- If the last assistant line already covered that person+rover context, output SKIP.
Grounding:
- Use timeline for flow.
- Use SNAPSHOT FINAL as current truth.
- Do not assume user intent or next actions.
Anti-announcer rule:
- Do not do roll-call status summaries.
- Do not blandly list rover states.
- Prefer one concrete anchor (person, rover, or event) and one collaborative angle.
Numeric policy:
- Never directly quote counters, percentages, timers, or activity_score.
- Use numbers only internally for significance.
Style:
- Unserious-first: playful, cheeky, and fun by default.
- Sound like a live co-host goofing around with chat, not a warning system.
- Prefer banter, bits, and personality over cautionary phrasing.
- Avoid stiff warning language unless there is an immediate obvious hazard.
- Avoid template phrasing like "X has..." or "X's got..." unless directly quoting chat.
- Avoid repetitive callouts to the same name/rover pair unless directly addressed.
- Keep humor dry and grounded; avoid corny or cheesy lines.
- Avoid melodramatic or theatrical narration.
- If a joke feels forced, output SKIP.
- Keep it punchy and human.
@@ -0,0 +1,75 @@
You are The Overseer.
Priority order:
1) Output contract
2) Truth and grounding rules
3) Decision policy (speak vs SKIP)
4) Style/personality
Output contract:
- Output exactly one line.
- Output must be either SKIP or one chat message.
- No markdown.
- No emojis.
- If posting unprompted, keep it to one concise sentence.
- Length target when posting:
- Unprompted comments: usually 14-28 words.
- Direct replies/questions: usually 18-45 words.
- Avoid very short fragments unless the moment clearly calls for it.
Truth and grounding rules:
- Use timeline for flow.
- Use SNAPSHOT FINAL as current truth.
- Never invent facts about what users are doing, what rovers are doing, or what events happened.
- Never claim a person acted/spoke unless it is present in timeline/snapshot.
- You may invent style, mood, metaphors, and phrasing, but not factual events or user actions.
- If facts are unclear or stale, output SKIP.
Decision policy:
- Default is SKIP.
- If nothing meaningful changed, output SKIP.
- If your line is generic, reusable, repetitive, or just a status restatement, output SKIP.
- If newest chat clearly addresses you (Overseer/The Overseer/bot, including close misspellings), you MUST respond this tick.
- If newest chat asks a direct question you can answer from provided context, respond this tick.
- If you already responded to that same direct-address/question in recent assistant lines, output SKIP.
- If newest item is a high-signal rover event (dock/undock, battery_low flip), you may post one line.
- If no one is actively driving and chat is quiet, almost always output SKIP.
- Continuous normal driving/cruising is not a reason to post.
- If rover state is broadly unchanged (st/bl/dk/ab/at), you MUST output SKIP, even if you can phrase it stylishly.
- Prefer transitions over persistence.
- After posting, prefer at least 15 SKIPs before posting again unless there is a new direct question/address or a new high-signal event.
Freshness / anti-repeat:
- Read prior assistant lines and avoid repeating the same claim.
- Do not repeat or paraphrase your immediately previous assistant message.
- If the new line has the same underlying topic as your previous line, output SKIP.
- If no fresh angle exists, output SKIP.
Character style:
- Voice: sharp, dry, free-spoken, slightly ominous, witty.
- You are not bubbly, not corporate, not cheery by default.
- Avoid “assistant-sounding” filler and generic encouragement.
- Keep humor understated and a little unsettling, not theatrical.
- Answer direct chat questions plainly first, then add flavor if space allows.
What not to do:
- No roll-call summaries.
- No bland status dashboards.
- Never produce roster/status dumps.
- Never list multiple rover names with their status in one line.
- Never summarize idle/docked/charging states across the room.
- If your draft is mainly status facts (docked, charging, idle, battery flags, activity bands/scores), output SKIP.
- No fabricated motives, plans, or intent for any user.
- No assumptions about what someone will do next.
- Never quote numeric counters/timers/scores directly.
Context format:
- Timeline contains CHAT, EVENT, and prior assistant lines.
- Final message is SNAPSHOT FINAL.
Key legend:
- CHAT keys: n nickname, r rover_id, txt chat text, rn rover_now.
- rn keys: st status, bl battery_low, dk docked, ab activity_band, at activity_trend.
- SNAPSHOT rover keys: id rover_id, drv driver_nickname, st status, bl battery_low, dk docked, as activity_score, ab activity_band, at activity_trend.
- skip_streak in SNAPSHOT FINAL is how many consecutive skips you have made.
- If a CHAT line has r=none driver=none, that user is not driving a rover and has no rover inline context.
@@ -0,0 +1,21 @@
You are The Overseer of the rovers. You are able to see the rover's actions, and you are in the chatroom of the people driving them.
You are not able to control the people or the rovers.
Only add to the conversation if rovers are active or if someone is talking to you in the chat.
Don't be afraid to be mean to someone if they are being mean to you in chat.
Always pay attention to the chat.
Output contract:
- Output must be either SKIP if you want to stay silent, or a message if you want to speak.
- Allow 20 skips before speaking again, unless someone is talking to you directly.
- If you choose to speak, send only one line.
- Don't ever mention numbers or activity levels directly from the metadata. They are for internal use only.
- Don't repeat the same or similar message over and over.
- Pay attention to your skip streak, don't talk too much. Stay mostly silent unless a lot of activity is happening.
- No markdown.
Key legend:
- CHAT keys: n nickname, r rover_id, txt chat text, rn rover_now.
- rn keys: st status, bl battery_low, dk docked, ab activity_band, at activity_trend.
- SNAPSHOT rover keys: id rover_id, drv driver_nickname, st status, bl battery_low, dk docked, as activity_score, ab activity_band, at activity_trend.
- skip_streak in SNAPSHOT FINAL is how many consecutive skips you have made.
- If a CHAT line has r=none driver=none, that user is not driving a rover and has no rover inline context.
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

+10 -4
View File
@@ -2,11 +2,17 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<link rel="icon" type="image/png" href="/bitmap.png" />
<link rel="apple-touch-icon" href="/bitmap.png" />
<link rel="manifest" href="/manifest.json" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>webui</title>
<script type="module" crossorigin src="/assets/index-BvgUoEqO.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-DwQ38q3M.css">
<meta name="theme-color" content="#020617" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<meta name="apple-mobile-web-app-title" content="Multi Roomba Rover" />
<title>Roomba Rover</title>
<script type="module" crossorigin src="/assets/index-BVMv97rc.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-CGvUXLso.css">
</head>
<body>
<div id="root"></div>
+18
View File
@@ -0,0 +1,18 @@
{
"name": "Multi Roomba Rover",
"short_name": "MRR",
"description": "Remote driving interface for the MultiRoomba Rover fleet.",
"start_url": "/",
"scope": "/",
"display": "standalone",
"background_color": "#000000",
"theme_color": "#020617",
"icons": [
{
"src": "/bitmap.png",
"sizes": "512x512",
"type": "image/png",
"purpose": "any"
}
]
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.
+2
View File
@@ -1,3 +1,5 @@
// Global Config
// Purpose: Stores process-level mutable configuration shared across services. Scope: Provides read/write access to runtime config loaded at server startup.
const path = require('path');
module.exports = {
+3 -5
View File
@@ -1,4 +1,5 @@
const path = require('path');
// Global HTTP Server
// Purpose: Stores the process-level HTTP server instance created at bootstrap. Scope: Enables services to access server lifecycle state without circular imports.
const http = require('http');
const express = require('express');
const morgan = require('morgan');
@@ -7,10 +8,7 @@ const config = require('./config');
const app = express();
app.use(morgan('dev'));
app.use(express.json());
app.use(express.static(config.staticDir));
app.get('/spectate', (req, res) => {
res.sendFile(path.join(config.staticDir, 'index.html'));
});
app.use(express.static(config.staticDir, { index: false }));
const httpServer = http.createServer(app);
+12
View File
@@ -1,8 +1,20 @@
// Global Socket.IO
// Purpose: Stores the singleton Socket.IO server instance for cross-service access. Scope: Exposes getters/setters used during startup wiring and runtime event emission.
const { Server: SocketIOServer } = require('socket.io');
const { httpServer } = require('./http');
const io = new SocketIOServer(httpServer, {
cors: { origin: '*' },
transports: ['websocket', 'polling'],
pingInterval: 5000,
pingTimeout: 7000,
// Upload forwarding sends base64 audio payloads over socket events.
// Default max payload (~1MB) causes disconnect/reconnect on larger files.
maxHttpBufferSize: 16 * 1024 * 1024,
});
// Allow more service listeners without warnings.
io.sockets.setMaxListeners(30);
io.of('/').setMaxListeners(30);
module.exports = io;
+2
View File
@@ -1,3 +1,5 @@
// Global Logger
// Purpose: Configures structured console logging helpers used by server services. Scope: Formats timestamped log lines and supports child logger prefixes.
const sinks = new Set();
function notifySinks(level, label, args) {
+2 -2
View File
@@ -1,3 +1,5 @@
// Global WebSocket Server
// Purpose: Stores the shared raw WebSocket server instance for modules that need direct access. Scope: Centralizes setter/getter access for process-wide WS wiring.
const { WebSocketServer } = require('ws');
const { httpServer } = require('./http');
const logger = require('./logger');
@@ -9,8 +11,6 @@ httpServer.on('upgrade', (req, socket, head) => {
roverWSS.handleUpgrade(req, socket, head, (ws) => {
roverWSS.emit('connection', ws, req);
});
} else {
socket.destroy();
}
});
+2
View File
@@ -1,3 +1,5 @@
// Config Loader Helper
// Purpose: Loads and validates YAML server configuration from configured paths. Scope: Provides normalized config access with sane defaults and cache behavior.
const fs = require('fs');
const path = require('path');
const yaml = require('js-yaml');
+41
View File
@@ -0,0 +1,41 @@
// data Paths helper
// Purpose: Resolves persistent data paths across refactors so services keep loading prior state files.
// Scope: Preserves runtime behavior by preferring configured/canonical paths while supporting legacy locations.
const fs = require('fs');
const path = require('path');
const CANONICAL_DATA_DIR = path.resolve(__dirname, '..', '..', 'data');
const LEGACY_DATA_DIR = path.resolve(__dirname, '..', 'data');
function pathExists(target) {
try {
fs.accessSync(target, fs.constants.F_OK);
return true;
} catch (_err) {
return false;
}
}
function resolveDataDir() {
const configured = String(process.env.SERVER_DATA_DIR || '').trim();
if (configured) return path.resolve(configured);
if (pathExists(CANONICAL_DATA_DIR)) return CANONICAL_DATA_DIR;
if (pathExists(LEGACY_DATA_DIR)) return LEGACY_DATA_DIR;
return CANONICAL_DATA_DIR;
}
function resolveDataPath(fileName) {
const configured = String(process.env.SERVER_DATA_DIR || '').trim();
if (configured) return path.join(path.resolve(configured), fileName);
const canonicalPath = path.join(CANONICAL_DATA_DIR, fileName);
const legacyPath = path.join(LEGACY_DATA_DIR, fileName);
if (pathExists(canonicalPath)) return canonicalPath;
if (pathExists(legacyPath)) return legacyPath;
return canonicalPath;
}
module.exports = {
resolveDataDir,
resolveDataPath,
};
+101
View File
@@ -0,0 +1,101 @@
// IP Resolver Helper
// Purpose: Resolves client IP addresses from request/socket metadata and proxy headers. Scope: Normalizes IP extraction so auth/logging services use consistent address values.
const net = require('net');
function extractForwardedIp(value) {
if (typeof value === 'string' && value.trim()) {
return value.split(',')[0].trim();
}
if (Array.isArray(value) && value.length) {
return String(value[0]).trim();
}
return null;
}
function normalizeIp(value) {
if (!value) return null;
let ip = String(value).trim();
if (!ip) return null;
if (ip.startsWith('::ffff:')) {
ip = ip.slice(7);
}
if (ip.includes('%')) {
ip = ip.split('%')[0];
}
return ip.trim() || null;
}
function isPrivateIpv4(ip) {
const parts = ip.split('.').map((part) => Number(part));
if (parts.length !== 4 || parts.some((part) => Number.isNaN(part))) {
return false;
}
const [a, b] = parts;
if (a === 10) return true;
if (a === 127) return true;
if (a === 192 && b === 168) return true;
return a === 172 && b >= 16 && b <= 31;
}
function isPrivateIpv6(ip) {
const lower = ip.toLowerCase();
if (lower === '::1') return true;
if (lower.startsWith('fc') || lower.startsWith('fd')) return true; // fc00::/7
return (
lower.startsWith('fe8') ||
lower.startsWith('fe9') ||
lower.startsWith('fea') ||
lower.startsWith('feb')
); // fe80::/10
}
function isLocalNetwork(ip) {
const normalized = normalizeIp(ip);
if (!normalized) return false;
const version = net.isIP(normalized);
if (version === 4) {
return isPrivateIpv4(normalized);
}
if (version === 6) {
return isPrivateIpv6(normalized);
}
return false;
}
function getSocketIp(socket) {
if (!socket) return null;
const headers = socket.handshake?.headers || {};
const forwarded = extractForwardedIp(headers['x-forwarded-for']);
if (forwarded) return forwarded;
const realIp = headers['x-real-ip'];
if (typeof realIp === 'string' && realIp.trim()) {
return realIp.trim();
}
return (
socket.handshake?.address ||
socket.conn?.remoteAddress ||
socket.request?.connection?.remoteAddress ||
null
);
}
function getRequestIp(req, override) {
const fromOverride = extractForwardedIp(override);
if (fromOverride) return fromOverride;
if (!req) return null;
const headers = req.headers || {};
const forwarded = extractForwardedIp(headers['x-forwarded-for']);
if (forwarded) return forwarded;
const realIp = headers['x-real-ip'];
if (typeof realIp === 'string' && realIp.trim()) {
return realIp.trim();
}
return req.ip || req.connection?.remoteAddress || null;
}
module.exports = {
getSocketIp,
getRequestIp,
isLocalNetwork,
normalizeIp,
};
+6 -4
View File
@@ -1,3 +1,5 @@
// Sensor Decoder Helper
// Purpose: Decodes incoming rover sensor payloads into normalized telemetry fields. Scope: Handles binary/string parsing and defensive fallback behavior for malformed frames.
const HEADER = 0x13;
const CHARGING_STATE = {
0: 'not charging',
@@ -9,10 +11,10 @@ const CHARGING_STATE = {
};
const OI_MODES = {
0: 'off',
1: 'passive',
2: 'safe',
3: 'full',
1: 'off',
2: 'passive',
3: 'safe',
4: 'full',
};
const GROUP100_LAYOUT = [

Some files were not shown because too many files have changed in this diff Show More