agenticros 0.0.1 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (330) hide show
  1. package/LICENSE +192 -0
  2. package/README.md +90 -4
  3. package/dist/commands/config.d.ts +20 -0
  4. package/dist/commands/config.d.ts.map +1 -0
  5. package/dist/commands/config.js +179 -0
  6. package/dist/commands/config.js.map +1 -0
  7. package/dist/commands/doctor.d.ts +33 -0
  8. package/dist/commands/doctor.d.ts.map +1 -0
  9. package/dist/commands/doctor.js +232 -0
  10. package/dist/commands/doctor.js.map +1 -0
  11. package/dist/commands/down.d.ts +15 -0
  12. package/dist/commands/down.d.ts.map +1 -0
  13. package/dist/commands/down.js +91 -0
  14. package/dist/commands/down.js.map +1 -0
  15. package/dist/commands/init.d.ts +21 -0
  16. package/dist/commands/init.d.ts.map +1 -0
  17. package/dist/commands/init.js +259 -0
  18. package/dist/commands/init.js.map +1 -0
  19. package/dist/commands/logs.d.ts +18 -0
  20. package/dist/commands/logs.d.ts.map +1 -0
  21. package/dist/commands/logs.js +67 -0
  22. package/dist/commands/logs.js.map +1 -0
  23. package/dist/commands/status.d.ts +12 -0
  24. package/dist/commands/status.d.ts.map +1 -0
  25. package/dist/commands/status.js +56 -0
  26. package/dist/commands/status.js.map +1 -0
  27. package/dist/commands/up.d.ts +20 -0
  28. package/dist/commands/up.d.ts.map +1 -0
  29. package/dist/commands/up.js +70 -0
  30. package/dist/commands/up.js.map +1 -0
  31. package/dist/index.d.ts +12 -0
  32. package/dist/index.d.ts.map +1 -0
  33. package/dist/index.js +107 -0
  34. package/dist/index.js.map +1 -0
  35. package/dist/menu.d.ts +9 -0
  36. package/dist/menu.d.ts.map +1 -0
  37. package/dist/menu.js +96 -0
  38. package/dist/menu.js.map +1 -0
  39. package/dist/runners/real-robot.d.ts +15 -0
  40. package/dist/runners/real-robot.d.ts.map +1 -0
  41. package/dist/runners/real-robot.js +46 -0
  42. package/dist/runners/real-robot.js.map +1 -0
  43. package/dist/runners/sim.d.ts +19 -0
  44. package/dist/runners/sim.d.ts.map +1 -0
  45. package/dist/runners/sim.js +53 -0
  46. package/dist/runners/sim.js.map +1 -0
  47. package/dist/util/env.d.ts +24 -0
  48. package/dist/util/env.d.ts.map +1 -0
  49. package/dist/util/env.js +53 -0
  50. package/dist/util/env.js.map +1 -0
  51. package/dist/util/logger.d.ts +24 -0
  52. package/dist/util/logger.d.ts.map +1 -0
  53. package/dist/util/logger.js +62 -0
  54. package/dist/util/logger.js.map +1 -0
  55. package/dist/util/paths.d.ts +57 -0
  56. package/dist/util/paths.d.ts.map +1 -0
  57. package/dist/util/paths.js +132 -0
  58. package/dist/util/paths.js.map +1 -0
  59. package/dist/util/pidfile.d.ts +16 -0
  60. package/dist/util/pidfile.d.ts.map +1 -0
  61. package/dist/util/pidfile.js +63 -0
  62. package/dist/util/pidfile.js.map +1 -0
  63. package/dist/util/state.d.ts +26 -0
  64. package/dist/util/state.d.ts.map +1 -0
  65. package/dist/util/state.js +55 -0
  66. package/dist/util/state.js.map +1 -0
  67. package/package.json +60 -1
  68. package/runtime/BUNDLE.json +11 -0
  69. package/runtime/LICENSE +192 -0
  70. package/runtime/README.md +273 -0
  71. package/runtime/docs/architecture.md +366 -0
  72. package/runtime/docs/cli.md +140 -0
  73. package/runtime/docs/memory.md +292 -0
  74. package/runtime/docs/robot-setup.md +347 -0
  75. package/runtime/package.json +28 -0
  76. package/runtime/packages/agenticros/agenticros-agenticros-0.0.1.tgz +0 -0
  77. package/runtime/packages/agenticros/openclaw.plugin.json +451 -0
  78. package/runtime/packages/agenticros/package.json +41 -0
  79. package/runtime/packages/agenticros/src/camera-snapshot-cache.ts +59 -0
  80. package/runtime/packages/agenticros/src/camera-snapshot-routes.ts +44 -0
  81. package/runtime/packages/agenticros/src/commands/estop.ts +41 -0
  82. package/runtime/packages/agenticros/src/commands/transport.ts +195 -0
  83. package/runtime/packages/agenticros/src/config-file.ts +136 -0
  84. package/runtime/packages/agenticros/src/config-page.ts +498 -0
  85. package/runtime/packages/agenticros/src/context/robot-context.ts +373 -0
  86. package/runtime/packages/agenticros/src/depth.ts +313 -0
  87. package/runtime/packages/agenticros/src/describer.ts +157 -0
  88. package/runtime/packages/agenticros/src/image-binary-trim.ts +16 -0
  89. package/runtime/packages/agenticros/src/index.ts +85 -0
  90. package/runtime/packages/agenticros/src/landing-page.ts +38 -0
  91. package/runtime/packages/agenticros/src/memory.ts +44 -0
  92. package/runtime/packages/agenticros/src/plugin-api.ts +173 -0
  93. package/runtime/packages/agenticros/src/plugin-image-base64.ts +69 -0
  94. package/runtime/packages/agenticros/src/preflight.ts +110 -0
  95. package/runtime/packages/agenticros/src/routes.ts +328 -0
  96. package/runtime/packages/agenticros/src/safety/validator.ts +43 -0
  97. package/runtime/packages/agenticros/src/service.ts +359 -0
  98. package/runtime/packages/agenticros/src/skill-api.ts +65 -0
  99. package/runtime/packages/agenticros/src/skill-loader.ts +146 -0
  100. package/runtime/packages/agenticros/src/teleop/page.ts +498 -0
  101. package/runtime/packages/agenticros/src/teleop/routes.ts +650 -0
  102. package/runtime/packages/agenticros/src/tools/index.ts +26 -0
  103. package/runtime/packages/agenticros/src/tools/ros2-action.ts +50 -0
  104. package/runtime/packages/agenticros/src/tools/ros2-camera.ts +221 -0
  105. package/runtime/packages/agenticros/src/tools/ros2-depth-distance.ts +58 -0
  106. package/runtime/packages/agenticros/src/tools/ros2-introspect.ts +62 -0
  107. package/runtime/packages/agenticros/src/tools/ros2-memory.ts +158 -0
  108. package/runtime/packages/agenticros/src/tools/ros2-param.ts +87 -0
  109. package/runtime/packages/agenticros/src/tools/ros2-publish.ts +52 -0
  110. package/runtime/packages/agenticros/src/tools/ros2-service.ts +46 -0
  111. package/runtime/packages/agenticros/src/tools/ros2-subscribe.ts +71 -0
  112. package/runtime/packages/agenticros/tsconfig.json +9 -0
  113. package/runtime/packages/agenticros-claude-code/README.md +260 -0
  114. package/runtime/packages/agenticros-claude-code/config.example.json +9 -0
  115. package/runtime/packages/agenticros-claude-code/dist/config.d.ts +8 -0
  116. package/runtime/packages/agenticros-claude-code/dist/config.d.ts.map +1 -0
  117. package/runtime/packages/agenticros-claude-code/dist/config.js +93 -0
  118. package/runtime/packages/agenticros-claude-code/dist/config.js.map +1 -0
  119. package/runtime/packages/agenticros-claude-code/dist/depth.d.ts +20 -0
  120. package/runtime/packages/agenticros-claude-code/dist/depth.d.ts.map +1 -0
  121. package/runtime/packages/agenticros-claude-code/dist/depth.js +126 -0
  122. package/runtime/packages/agenticros-claude-code/dist/depth.js.map +1 -0
  123. package/runtime/packages/agenticros-claude-code/dist/find-object/coco-classes.d.ts +6 -0
  124. package/runtime/packages/agenticros-claude-code/dist/find-object/coco-classes.d.ts.map +1 -0
  125. package/runtime/packages/agenticros-claude-code/dist/find-object/coco-classes.js +36 -0
  126. package/runtime/packages/agenticros-claude-code/dist/find-object/coco-classes.js.map +1 -0
  127. package/runtime/packages/agenticros-claude-code/dist/find-object/find-object.d.ts +33 -0
  128. package/runtime/packages/agenticros-claude-code/dist/find-object/find-object.d.ts.map +1 -0
  129. package/runtime/packages/agenticros-claude-code/dist/find-object/find-object.js +134 -0
  130. package/runtime/packages/agenticros-claude-code/dist/find-object/find-object.js.map +1 -0
  131. package/runtime/packages/agenticros-claude-code/dist/follow-me/controller.d.ts +43 -0
  132. package/runtime/packages/agenticros-claude-code/dist/follow-me/controller.d.ts.map +1 -0
  133. package/runtime/packages/agenticros-claude-code/dist/follow-me/controller.js +73 -0
  134. package/runtime/packages/agenticros-claude-code/dist/follow-me/controller.js.map +1 -0
  135. package/runtime/packages/agenticros-claude-code/dist/follow-me/detector.d.ts +58 -0
  136. package/runtime/packages/agenticros-claude-code/dist/follow-me/detector.d.ts.map +1 -0
  137. package/runtime/packages/agenticros-claude-code/dist/follow-me/detector.js +251 -0
  138. package/runtime/packages/agenticros-claude-code/dist/follow-me/detector.js.map +1 -0
  139. package/runtime/packages/agenticros-claude-code/dist/follow-me/loop.d.ts +61 -0
  140. package/runtime/packages/agenticros-claude-code/dist/follow-me/loop.d.ts.map +1 -0
  141. package/runtime/packages/agenticros-claude-code/dist/follow-me/loop.js +268 -0
  142. package/runtime/packages/agenticros-claude-code/dist/follow-me/loop.js.map +1 -0
  143. package/runtime/packages/agenticros-claude-code/dist/index.d.ts +3 -0
  144. package/runtime/packages/agenticros-claude-code/dist/index.d.ts.map +1 -0
  145. package/runtime/packages/agenticros-claude-code/dist/index.js +111 -0
  146. package/runtime/packages/agenticros-claude-code/dist/index.js.map +1 -0
  147. package/runtime/packages/agenticros-claude-code/dist/memory.d.ts +17 -0
  148. package/runtime/packages/agenticros-claude-code/dist/memory.d.ts.map +1 -0
  149. package/runtime/packages/agenticros-claude-code/dist/memory.js +44 -0
  150. package/runtime/packages/agenticros-claude-code/dist/memory.js.map +1 -0
  151. package/runtime/packages/agenticros-claude-code/dist/safety.d.ts +10 -0
  152. package/runtime/packages/agenticros-claude-code/dist/safety.d.ts.map +1 -0
  153. package/runtime/packages/agenticros-claude-code/dist/safety.js +34 -0
  154. package/runtime/packages/agenticros-claude-code/dist/safety.js.map +1 -0
  155. package/runtime/packages/agenticros-claude-code/dist/tools.d.ts +36 -0
  156. package/runtime/packages/agenticros-claude-code/dist/tools.d.ts.map +1 -0
  157. package/runtime/packages/agenticros-claude-code/dist/tools.js +777 -0
  158. package/runtime/packages/agenticros-claude-code/dist/tools.js.map +1 -0
  159. package/runtime/packages/agenticros-claude-code/dist/transport.d.ts +17 -0
  160. package/runtime/packages/agenticros-claude-code/dist/transport.d.ts.map +1 -0
  161. package/runtime/packages/agenticros-claude-code/dist/transport.js +46 -0
  162. package/runtime/packages/agenticros-claude-code/dist/transport.js.map +1 -0
  163. package/runtime/packages/agenticros-claude-code/dist/zero-shot/detector.d.ts +42 -0
  164. package/runtime/packages/agenticros-claude-code/dist/zero-shot/detector.d.ts.map +1 -0
  165. package/runtime/packages/agenticros-claude-code/dist/zero-shot/detector.js +114 -0
  166. package/runtime/packages/agenticros-claude-code/dist/zero-shot/detector.js.map +1 -0
  167. package/runtime/packages/agenticros-claude-code/package.json +29 -0
  168. package/runtime/packages/agenticros-claude-code/src/config.ts +96 -0
  169. package/runtime/packages/agenticros-claude-code/src/depth.ts +173 -0
  170. package/runtime/packages/agenticros-claude-code/src/find-object/coco-classes.ts +38 -0
  171. package/runtime/packages/agenticros-claude-code/src/find-object/find-object.ts +190 -0
  172. package/runtime/packages/agenticros-claude-code/src/follow-me/controller.ts +109 -0
  173. package/runtime/packages/agenticros-claude-code/src/follow-me/depth-loop.ts +420 -0
  174. package/runtime/packages/agenticros-claude-code/src/follow-me/detector.ts +303 -0
  175. package/runtime/packages/agenticros-claude-code/src/follow-me/loop.ts +330 -0
  176. package/runtime/packages/agenticros-claude-code/src/index.ts +125 -0
  177. package/runtime/packages/agenticros-claude-code/src/memory.ts +51 -0
  178. package/runtime/packages/agenticros-claude-code/src/safety.ts +44 -0
  179. package/runtime/packages/agenticros-claude-code/src/tools.ts +891 -0
  180. package/runtime/packages/agenticros-claude-code/src/transport.ts +58 -0
  181. package/runtime/packages/agenticros-claude-code/src/zero-shot/detector.ts +169 -0
  182. package/runtime/packages/agenticros-claude-code/tsconfig.json +9 -0
  183. package/runtime/packages/agenticros-claude-code/yolo-debug.mjs +106 -0
  184. package/runtime/packages/agenticros-gemini/README.md +139 -0
  185. package/runtime/packages/agenticros-gemini/package.json +28 -0
  186. package/runtime/packages/agenticros-gemini/scripts/smoke-api.mjs +42 -0
  187. package/runtime/packages/agenticros-gemini/src/chat.ts +139 -0
  188. package/runtime/packages/agenticros-gemini/src/config.ts +92 -0
  189. package/runtime/packages/agenticros-gemini/src/depth.ts +173 -0
  190. package/runtime/packages/agenticros-gemini/src/index.ts +58 -0
  191. package/runtime/packages/agenticros-gemini/src/memory.ts +32 -0
  192. package/runtime/packages/agenticros-gemini/src/safety.ts +44 -0
  193. package/runtime/packages/agenticros-gemini/src/tools.ts +516 -0
  194. package/runtime/packages/agenticros-gemini/src/transport.ts +58 -0
  195. package/runtime/packages/agenticros-gemini/tsconfig.json +8 -0
  196. package/runtime/packages/core/package.json +47 -0
  197. package/runtime/packages/core/src/banner.ts +32 -0
  198. package/runtime/packages/core/src/cmd-vel-twist.ts +31 -0
  199. package/runtime/packages/core/src/config.ts +279 -0
  200. package/runtime/packages/core/src/index.ts +54 -0
  201. package/runtime/packages/core/src/memory/__tests__/factory.test.ts +70 -0
  202. package/runtime/packages/core/src/memory/__tests__/local-provider.test.ts +195 -0
  203. package/runtime/packages/core/src/memory/__tests__/mem0-provider.test.ts +192 -0
  204. package/runtime/packages/core/src/memory/__tests__/smart-defaults.test.ts +46 -0
  205. package/runtime/packages/core/src/memory/factory.ts +63 -0
  206. package/runtime/packages/core/src/memory/index.ts +10 -0
  207. package/runtime/packages/core/src/memory/local/provider.ts +229 -0
  208. package/runtime/packages/core/src/memory/mem0/provider.ts +379 -0
  209. package/runtime/packages/core/src/memory/types.ts +96 -0
  210. package/runtime/packages/core/src/topic-utils.ts +95 -0
  211. package/runtime/packages/core/src/transport/factory.ts +47 -0
  212. package/runtime/packages/core/src/transport/local/conversion.ts +333 -0
  213. package/runtime/packages/core/src/transport/local/entities.ts +129 -0
  214. package/runtime/packages/core/src/transport/local/transport.ts +406 -0
  215. package/runtime/packages/core/src/transport/rosbridge/actions.ts +81 -0
  216. package/runtime/packages/core/src/transport/rosbridge/adapter.ts +157 -0
  217. package/runtime/packages/core/src/transport/rosbridge/client.ts +438 -0
  218. package/runtime/packages/core/src/transport/rosbridge/services.ts +41 -0
  219. package/runtime/packages/core/src/transport/rosbridge/topics.ts +60 -0
  220. package/runtime/packages/core/src/transport/rosbridge/types.ts +118 -0
  221. package/runtime/packages/core/src/transport/transport.ts +77 -0
  222. package/runtime/packages/core/src/transport/types.ts +137 -0
  223. package/runtime/packages/core/src/transport/webrtc/signaling-client.ts +196 -0
  224. package/runtime/packages/core/src/transport/webrtc/signaling-types.ts +130 -0
  225. package/runtime/packages/core/src/transport/webrtc/transport.ts +516 -0
  226. package/runtime/packages/core/src/transport/zenoh/adapter.ts +357 -0
  227. package/runtime/packages/core/src/transport/zenoh/cdr.ts +183 -0
  228. package/runtime/packages/core/src/transport/zenoh/keys.ts +51 -0
  229. package/runtime/packages/core/tsconfig.json +9 -0
  230. package/runtime/packages/ros-camera/package.json +30 -0
  231. package/runtime/packages/ros-camera/src/index.ts +13 -0
  232. package/runtime/packages/ros-camera/src/snapshot.ts +372 -0
  233. package/runtime/packages/ros-camera/tsconfig.json +9 -0
  234. package/runtime/pnpm-lock.yaml +5260 -0
  235. package/runtime/pnpm-workspace.yaml +2 -0
  236. package/runtime/ros2_ws/src/agenticros_agent/agenticros_agent/__init__.py +0 -0
  237. package/runtime/ros2_ws/src/agenticros_agent/agenticros_agent/agent_node.py +561 -0
  238. package/runtime/ros2_ws/src/agenticros_agent/package.xml +25 -0
  239. package/runtime/ros2_ws/src/agenticros_agent/resource/agenticros_agent +0 -0
  240. package/runtime/ros2_ws/src/agenticros_agent/setup.cfg +4 -0
  241. package/runtime/ros2_ws/src/agenticros_agent/setup.py +25 -0
  242. package/runtime/ros2_ws/src/agenticros_bringup/README.md +128 -0
  243. package/runtime/ros2_ws/src/agenticros_bringup/agenticros_bringup/__init__.py +1 -0
  244. package/runtime/ros2_ws/src/agenticros_bringup/agenticros_bringup/cmd_vel_relay.py +33 -0
  245. package/runtime/ros2_ws/src/agenticros_bringup/launch/cmd_vel_bridge.launch.py +58 -0
  246. package/runtime/ros2_ws/src/agenticros_bringup/launch/gazebo_turtlebot3.launch.py +69 -0
  247. package/runtime/ros2_ws/src/agenticros_bringup/launch/mode_a_gazebo.launch.py +55 -0
  248. package/runtime/ros2_ws/src/agenticros_bringup/launch/mode_a_gazebo_rviz.launch.py +48 -0
  249. package/runtime/ros2_ws/src/agenticros_bringup/launch/realsense_rosbridge.launch.py +154 -0
  250. package/runtime/ros2_ws/src/agenticros_bringup/launch/rosbridge_gazebo.launch.py +54 -0
  251. package/runtime/ros2_ws/src/agenticros_bringup/launch/rviz.launch.py +38 -0
  252. package/runtime/ros2_ws/src/agenticros_bringup/launch/turtlebot3_gazebo_rviz.launch.py +42 -0
  253. package/runtime/ros2_ws/src/agenticros_bringup/package.xml +24 -0
  254. package/runtime/ros2_ws/src/agenticros_bringup/resource/agenticros_bringup +0 -0
  255. package/runtime/ros2_ws/src/agenticros_bringup/rviz/turtlebot3_agenticros.rviz +174 -0
  256. package/runtime/ros2_ws/src/agenticros_bringup/setup.cfg +4 -0
  257. package/runtime/ros2_ws/src/agenticros_bringup/setup.py +28 -0
  258. package/runtime/ros2_ws/src/agenticros_discovery/agenticros_discovery/__init__.py +0 -0
  259. package/runtime/ros2_ws/src/agenticros_discovery/agenticros_discovery/discovery_node.py +172 -0
  260. package/runtime/ros2_ws/src/agenticros_discovery/package.xml +22 -0
  261. package/runtime/ros2_ws/src/agenticros_discovery/resource/agenticros_discovery +0 -0
  262. package/runtime/ros2_ws/src/agenticros_discovery/setup.cfg +5 -0
  263. package/runtime/ros2_ws/src/agenticros_discovery/setup.py +25 -0
  264. package/runtime/ros2_ws/src/agenticros_follow_me/README.md +66 -0
  265. package/runtime/ros2_ws/src/agenticros_follow_me/agenticros_follow_me/__init__.py +1 -0
  266. package/runtime/ros2_ws/src/agenticros_follow_me/agenticros_follow_me/__main__.py +5 -0
  267. package/runtime/ros2_ws/src/agenticros_follow_me/agenticros_follow_me/follow_me_node.py +278 -0
  268. package/runtime/ros2_ws/src/agenticros_follow_me/agenticros_follow_me/follower_controller.py +631 -0
  269. package/runtime/ros2_ws/src/agenticros_follow_me/agenticros_follow_me/person_tracker.py +635 -0
  270. package/runtime/ros2_ws/src/agenticros_follow_me/package.xml +22 -0
  271. package/runtime/ros2_ws/src/agenticros_follow_me/resource/agenticros_follow_me +0 -0
  272. package/runtime/ros2_ws/src/agenticros_follow_me/setup.py +25 -0
  273. package/runtime/ros2_ws/src/agenticros_msgs/CMakeLists.txt +26 -0
  274. package/runtime/ros2_ws/src/agenticros_msgs/msg/CapabilityManifest.msg +9 -0
  275. package/runtime/ros2_ws/src/agenticros_msgs/package.xml +22 -0
  276. package/runtime/ros2_ws/src/agenticros_msgs/srv/FollowMeGetStatus.srv +11 -0
  277. package/runtime/ros2_ws/src/agenticros_msgs/srv/FollowMeSetDistance.srv +4 -0
  278. package/runtime/ros2_ws/src/agenticros_msgs/srv/FollowMeSetTarget.srv +6 -0
  279. package/runtime/ros2_ws/src/agenticros_msgs/srv/FollowMeStart.srv +5 -0
  280. package/runtime/ros2_ws/src/agenticros_msgs/srv/FollowMeStop.srv +3 -0
  281. package/runtime/ros2_ws/src/agenticros_msgs/srv/GetCapabilities.srv +5 -0
  282. package/runtime/ros2_ws/src/agenticros_sim/CMakeLists.txt +24 -0
  283. package/runtime/ros2_ws/src/agenticros_sim/README.md +120 -0
  284. package/runtime/ros2_ws/src/agenticros_sim/config/agenticros-sim.config.json +28 -0
  285. package/runtime/ros2_ws/src/agenticros_sim/config/amr_bridge.yaml +111 -0
  286. package/runtime/ros2_ws/src/agenticros_sim/config/amr_view.rviz +172 -0
  287. package/runtime/ros2_ws/src/agenticros_sim/env-hooks/gz_resource_path.dsv.in +3 -0
  288. package/runtime/ros2_ws/src/agenticros_sim/env-hooks/gz_resource_path.sh.in +7 -0
  289. package/runtime/ros2_ws/src/agenticros_sim/launch/sim_amr.launch.py +159 -0
  290. package/runtime/ros2_ws/src/agenticros_sim/models/agenticros_amr/model.config +17 -0
  291. package/runtime/ros2_ws/src/agenticros_sim/models/agenticros_amr/model.sdf +244 -0
  292. package/runtime/ros2_ws/src/agenticros_sim/package.xml +27 -0
  293. package/runtime/ros2_ws/src/agenticros_sim/worlds/agenticros_indoor.sdf +183 -0
  294. package/runtime/scripts/activate_workspace.sh +285 -0
  295. package/runtime/scripts/agenticros-describer.policy.yaml +96 -0
  296. package/runtime/scripts/agenticros-proxy.cjs +99 -0
  297. package/runtime/scripts/agenticros-rosbridge.policy.yaml +62 -0
  298. package/runtime/scripts/check-cli-tarball-size.mjs +42 -0
  299. package/runtime/scripts/configure_agenticros.sh +200 -0
  300. package/runtime/scripts/configure_for_sim.sh +64 -0
  301. package/runtime/scripts/fix-openclaw-control-ui-path.sh +20 -0
  302. package/runtime/scripts/install_cli.sh +94 -0
  303. package/runtime/scripts/install_rosbridge_from_source.sh +67 -0
  304. package/runtime/scripts/lib/agenticros-banner.sh +28 -0
  305. package/runtime/scripts/onboard_robot.sh +75 -0
  306. package/runtime/scripts/openai.policy.yaml +77 -0
  307. package/runtime/scripts/openclaw-dashboard-url.cjs +49 -0
  308. package/runtime/scripts/pack-runtime.mjs +245 -0
  309. package/runtime/scripts/run_demo_native.sh +43 -0
  310. package/runtime/scripts/run_nemoclaw_host_stack.sh +91 -0
  311. package/runtime/scripts/run_robot_rosbridge.sh +36 -0
  312. package/runtime/scripts/sandbox_rosbridge_relay.py +137 -0
  313. package/runtime/scripts/setup-openclaw-local.cjs +75 -0
  314. package/runtime/scripts/setup_gateway_plugin.sh +329 -0
  315. package/runtime/scripts/setup_robot.sh +113 -0
  316. package/runtime/scripts/setup_workspace.sh +484 -0
  317. package/runtime/scripts/sim/run_sim.sh +146 -0
  318. package/runtime/scripts/smoke_test_nemoclaw.sh +123 -0
  319. package/runtime/scripts/start_demo.sh +55 -0
  320. package/runtime/scripts/sync-skill-tools.mjs +335 -0
  321. package/runtime/scripts/test-follow-me-sim.mjs +135 -0
  322. package/runtime/scripts/test-mcp-e2e.mjs +184 -0
  323. package/runtime/scripts/test-rclnodejs.mts +129 -0
  324. package/runtime/scripts/use-openclaw-2026.2.26.sh +19 -0
  325. package/runtime/scripts/use-openclaw-2026.3.11.sh +19 -0
  326. package/runtime/scripts/zenoh-bridge-ros2dds-robot.json5 +30 -0
  327. package/runtime/scripts/zenohd-agenticros.json5 +11 -0
  328. package/runtime/scripts/zenohd-rosclaw.json5 +11 -0
  329. package/runtime/tsconfig.base.json +19 -0
  330. package/index.js +0 -6
@@ -0,0 +1,329 @@
1
+ #!/bin/bash
2
+ # setup_gateway_plugin.sh - One-time gateway-side setup for the AgenticROS plugin
3
+ #
4
+ # Run this on the machine where the OpenClaw gateway runs (typically the robot
5
+ # itself, since the default transport is now `local`).
6
+ #
7
+ # What this does:
8
+ # 1. Builds all workspace packages (core, ros-camera, agenticros plugin)
9
+ # 2. Produces a flat deployment of the plugin via `pnpm deploy --prod`
10
+ # (required by OpenClaw 2026.6+: the install-time code safety scan
11
+ # rejects any node_modules symlink that points outside the install root,
12
+ # which pnpm's workspace-symlink layout always trips)
13
+ # 3. Registers the deployed plugin with OpenClaw via `openclaw plugins install -l`
14
+ # 4. (Optional) Sets robot namespace / rosbridge URL via flags
15
+ # 5. (Optional) Adjusts the systemd user service so the gateway picks it up
16
+ #
17
+ # After this completes, restart the gateway:
18
+ # systemctl --user restart openclaw-gateway.service
19
+ #
20
+ # Usage: ./scripts/setup_gateway_plugin.sh [OPTIONS]
21
+ # --repo PATH Path to agenticros repo (default: parent of scripts/)
22
+ # --deploy-dir PATH Where to write the flat plugin deployment
23
+ # (default: ~/.agenticros/plugin-deploy)
24
+ # --transport MODE Transport mode: local | rosbridge | zenoh | webrtc
25
+ # (default: leave plugin defaults; "local" out of the box)
26
+ # --rosbridge-url URL e.g. ws://localhost:9090 or ws://192.168.1.50:9090
27
+ # (only used when --transport rosbridge)
28
+ # --zenoh-endpoint U e.g. ws://localhost:10000 (only used when --transport zenoh)
29
+ # --robot-namespace N ROS2 namespace for cmd_vel (e.g. robot3946b404c33e4aa39a8d16deb1c5c593)
30
+ # --camera-topic T Camera topic for ros2_camera_snapshot / teleop
31
+ # --skip-build Skip `pnpm build` (assume it's already done)
32
+ # --no-systemd Skip systemd service tweaks
33
+ # --no-restart Don't restart the gateway at the end
34
+ # -h, --help Show this help
35
+
36
+ set -e
37
+
38
+ REPO_ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)
39
+ DEPLOY_DIR="$HOME/.agenticros/plugin-deploy"
40
+ TRANSPORT=""
41
+ ROSBRIDGE_URL=""
42
+ ZENOH_ENDPOINT=""
43
+ ROBOT_NAMESPACE=""
44
+ CAMERA_TOPIC=""
45
+ SKIP_BUILD=false
46
+ NO_SYSTEMD=false
47
+ NO_RESTART=false
48
+
49
+ source "$REPO_ROOT/scripts/lib/agenticros-banner.sh" 2>/dev/null || true
50
+
51
+ while [[ $# -gt 0 ]]; do
52
+ case $1 in
53
+ --repo) REPO_ROOT="$2"; shift 2 ;;
54
+ --deploy-dir) DEPLOY_DIR="$2"; shift 2 ;;
55
+ --transport) TRANSPORT="$2"; shift 2 ;;
56
+ --rosbridge-url) ROSBRIDGE_URL="$2"; shift 2 ;;
57
+ --zenoh-endpoint) ZENOH_ENDPOINT="$2"; shift 2 ;;
58
+ --robot-namespace) ROBOT_NAMESPACE="$2"; shift 2 ;;
59
+ --camera-topic) CAMERA_TOPIC="$2"; shift 2 ;;
60
+ --skip-build) SKIP_BUILD=true; shift ;;
61
+ --no-systemd) NO_SYSTEMD=true; shift ;;
62
+ --no-restart) NO_RESTART=true; shift ;;
63
+ -h|--help) sed -n '2,38p' "$0"; exit 0 ;;
64
+ *) echo "Unknown option: $1"; exit 1 ;;
65
+ esac
66
+ done
67
+
68
+ PLUGIN_SRC="$REPO_ROOT/packages/agenticros"
69
+
70
+ if command -v agenticros_banner &>/dev/null; then agenticros_banner; fi
71
+ echo "AgenticROS gateway plugin setup"
72
+ echo " Repo: $REPO_ROOT"
73
+ echo " Plugin src: $PLUGIN_SRC"
74
+ echo " Deploy to: $DEPLOY_DIR"
75
+ [[ -n "$TRANSPORT" ]] && echo " Transport: $TRANSPORT"
76
+ echo ""
77
+
78
+ if [[ ! -f "$PLUGIN_SRC/package.json" ]]; then
79
+ echo "Plugin directory not found or missing package.json: $PLUGIN_SRC"
80
+ exit 1
81
+ fi
82
+
83
+ if ! command -v pnpm &>/dev/null; then
84
+ echo "pnpm is required but not on PATH. Install pnpm (https://pnpm.io) and re-run."
85
+ exit 1
86
+ fi
87
+
88
+ if ! command -v openclaw &>/dev/null; then
89
+ echo "openclaw CLI is required but not on PATH. Install OpenClaw and re-run."
90
+ exit 1
91
+ fi
92
+
93
+ # 1. Install + build workspace deps
94
+ if [[ "$SKIP_BUILD" != true ]]; then
95
+ echo "[1/5] Installing workspace deps..."
96
+ (cd "$REPO_ROOT" && pnpm install --frozen-lockfile 2>/dev/null || pnpm install)
97
+ echo ""
98
+ echo "[2/5] Building required packages (core, ros-camera, agenticros)..."
99
+ (cd "$REPO_ROOT" && \
100
+ pnpm --filter @agenticros/core build && \
101
+ pnpm --filter @agenticros/ros-camera build && \
102
+ pnpm --filter ./packages/agenticros build)
103
+ else
104
+ echo "[1-2/5] Skipping install + build (--skip-build)."
105
+ fi
106
+ echo ""
107
+
108
+ # 3. Flatten the plugin into a deploy directory.
109
+ # OpenClaw 2026.6+ rejects `node_modules/<dep>` symlinks that resolve outside
110
+ # the plugin install root. `pnpm deploy --prod` materialises every dep inside
111
+ # the deploy directory, so all symlinks are safely contained.
112
+ echo "[3/5] Building flat plugin deployment at $DEPLOY_DIR ..."
113
+ mkdir -p "$(dirname "$DEPLOY_DIR")"
114
+ rm -rf "$DEPLOY_DIR"
115
+ (cd "$REPO_ROOT" && pnpm --filter ./packages/agenticros deploy --prod "$DEPLOY_DIR")
116
+ # pnpm leaves one self-reference symlink (.pnpm/node_modules/agenticros → the
117
+ # source path) that the safety scan will reject. It's not needed at runtime.
118
+ rm -f "$DEPLOY_DIR/node_modules/.pnpm/node_modules/agenticros"
119
+
120
+ # `pnpm deploy --prod` skips lifecycle scripts, so rclnodejs's postinstall
121
+ # (which runs `node scripts/generate_messages.js` to materialise ROS message
122
+ # bindings under `generated/`) never runs. Without that folder, the local
123
+ # transport fails on first connect with ENOENT. Reuse the workspace copy when
124
+ # available (fast, no ROS env needed in this script); otherwise regenerate in
125
+ # place against the active ROS env.
126
+ RCLN_DEPLOY=$(find "$DEPLOY_DIR/node_modules/.pnpm" -maxdepth 3 -type d -name rclnodejs 2>/dev/null | head -1)
127
+ if [[ -n "$RCLN_DEPLOY" ]]; then
128
+ RCLN_WS=$(find "$REPO_ROOT/node_modules/.pnpm" -maxdepth 3 -type d -name rclnodejs 2>/dev/null | head -1)
129
+ if [[ -n "$RCLN_WS" && -d "$RCLN_WS/generated" ]]; then
130
+ cp -a "$RCLN_WS/generated" "$RCLN_DEPLOY/"
131
+ echo " rclnodejs/generated copied from workspace ($(find "$RCLN_DEPLOY/generated" -type f | wc -l) files)."
132
+ elif [[ -n "$ROS_DISTRO" ]] || [[ -f /opt/ros/humble/setup.bash ]]; then
133
+ echo " rclnodejs/generated missing from workspace — regenerating in place against ROS..."
134
+ DISTRO="${ROS_DISTRO:-humble}"
135
+ ( cd "$RCLN_DEPLOY" && bash -c "source /opt/ros/$DISTRO/setup.bash && node scripts/generate_messages.js" ) || \
136
+ echo " WARNING: rclnodejs message generation failed; the 'local' transport may not work."
137
+ else
138
+ echo " WARNING: no rclnodejs/generated in workspace and no ROS distro found; the 'local' transport may not work."
139
+ fi
140
+ fi
141
+ echo " Deployment built."
142
+ echo ""
143
+
144
+ # 4. Register with OpenClaw. We background the install because the CLI also
145
+ # boots the plugin lifecycle to validate it (which sits in a reconnect
146
+ # loop forever if ROS isn't reachable). We wait for the "Linked plugin
147
+ # path" log line, then kill the supervisor.
148
+ echo "[4/5] Registering plugin with OpenClaw..."
149
+ LOG="$(mktemp -t agenticros-install.XXXX.log)"
150
+ ( openclaw plugins install -l "$DEPLOY_DIR" >"$LOG" 2>&1 ) &
151
+ INSTALL_PID=$!
152
+ for _ in $(seq 1 60); do
153
+ if grep -q "Linked plugin path" "$LOG" 2>/dev/null; then break; fi
154
+ if ! kill -0 "$INSTALL_PID" 2>/dev/null; then break; fi
155
+ sleep 1
156
+ done
157
+ # If still running, the install succeeded and we just need to stop the watchdog.
158
+ if kill -0 "$INSTALL_PID" 2>/dev/null; then
159
+ kill -TERM "$INSTALL_PID" 2>/dev/null || true
160
+ sleep 1
161
+ kill -KILL "$INSTALL_PID" 2>/dev/null || true
162
+ fi
163
+ if grep -q "installation blocked\|Plugin .* installation blocked" "$LOG"; then
164
+ echo "Plugin install FAILED. Last log lines:"
165
+ tail -20 "$LOG"
166
+ rm -f "$LOG"
167
+ exit 1
168
+ fi
169
+ echo " Plugin registered (log: $LOG)."
170
+ echo ""
171
+
172
+ # 5. Optionally patch plugin config block in ~/.openclaw/openclaw.json.
173
+ OPENCLAW_JSON="${OPENCLAW_CONFIG:-$HOME/.openclaw/openclaw.json}"
174
+ if [[ ! -f "$OPENCLAW_JSON" ]]; then
175
+ echo "[5/5] No OpenClaw config at $OPENCLAW_JSON — skipping config patch."
176
+ elif [[ -n "$TRANSPORT$ROSBRIDGE_URL$ZENOH_ENDPOINT$ROBOT_NAMESPACE$CAMERA_TOPIC" ]]; then
177
+ echo "[5/5] Patching plugin config in $OPENCLAW_JSON ..."
178
+ cp "$OPENCLAW_JSON" "$OPENCLAW_JSON.bak.$(date +%s)"
179
+ if command -v jq &>/dev/null; then
180
+ TMP=$(mktemp)
181
+ jq \
182
+ --arg transport "$TRANSPORT" \
183
+ --arg rb "$ROSBRIDGE_URL" \
184
+ --arg zenoh "$ZENOH_ENDPOINT" \
185
+ --arg ns "$ROBOT_NAMESPACE" \
186
+ --arg cam "$CAMERA_TOPIC" \
187
+ '
188
+ .plugins = (.plugins // {}) |
189
+ .plugins.entries = (.plugins.entries // {}) |
190
+ .plugins.entries.agenticros = (.plugins.entries.agenticros // {}) |
191
+ .plugins.entries.agenticros.enabled = true |
192
+ .plugins.entries.agenticros.config = (.plugins.entries.agenticros.config // {}) |
193
+ ( if $transport != "" then .plugins.entries.agenticros.config.transport = { mode: $transport } else . end ) |
194
+ ( if $rb != "" then .plugins.entries.agenticros.config.rosbridge = { url: $rb } else . end ) |
195
+ ( if $zenoh != "" then .plugins.entries.agenticros.config.zenoh = { routerEndpoint: $zenoh } else . end ) |
196
+ ( if $ns != "" or $cam != "" then
197
+ .plugins.entries.agenticros.config.robot = ( (.plugins.entries.agenticros.config.robot // {})
198
+ + ( if $ns != "" then { namespace: $ns } else {} end )
199
+ + ( if $cam != "" then { cameraTopic: $cam } else {} end ) )
200
+ else . end )
201
+ ' "$OPENCLAW_JSON" > "$TMP" && mv "$TMP" "$OPENCLAW_JSON"
202
+ echo " Config patched (via jq)."
203
+ elif command -v python3 &>/dev/null; then
204
+ TRANSPORT="$TRANSPORT" \
205
+ ROSBRIDGE_URL="$ROSBRIDGE_URL" \
206
+ ZENOH_ENDPOINT="$ZENOH_ENDPOINT" \
207
+ ROBOT_NAMESPACE="$ROBOT_NAMESPACE" \
208
+ CAMERA_TOPIC="$CAMERA_TOPIC" \
209
+ OPENCLAW_JSON="$OPENCLAW_JSON" \
210
+ python3 - <<'PYEOF'
211
+ import json, os, pathlib
212
+ p = pathlib.Path(os.environ["OPENCLAW_JSON"])
213
+ d = json.loads(p.read_text())
214
+ ag = d.setdefault("plugins", {}).setdefault("entries", {}).setdefault("agenticros", {})
215
+ ag["enabled"] = True
216
+ cfg = ag.setdefault("config", {})
217
+ t = os.environ.get("TRANSPORT") or ""
218
+ rb = os.environ.get("ROSBRIDGE_URL") or ""
219
+ zn = os.environ.get("ZENOH_ENDPOINT") or ""
220
+ ns = os.environ.get("ROBOT_NAMESPACE") or ""
221
+ cm = os.environ.get("CAMERA_TOPIC") or ""
222
+ if t: cfg["transport"] = {"mode": t}
223
+ if rb: cfg.setdefault("rosbridge", {})["url"] = rb
224
+ if zn: cfg.setdefault("zenoh", {})["routerEndpoint"] = zn
225
+ if ns or cm:
226
+ robot = cfg.setdefault("robot", {})
227
+ if ns: robot["namespace"] = ns
228
+ if cm: robot["cameraTopic"] = cm
229
+ p.write_text(json.dumps(d, indent=2) + "\n")
230
+ PYEOF
231
+ echo " Config patched (via python3 fallback; install jq for the canonical path)."
232
+ else
233
+ echo " Neither jq nor python3 is available; set these manually under plugins.entries.agenticros.config:"
234
+ [[ -n "$TRANSPORT" ]] && echo " transport.mode = \"$TRANSPORT\""
235
+ [[ -n "$ROSBRIDGE_URL" ]] && echo " rosbridge.url = \"$ROSBRIDGE_URL\""
236
+ [[ -n "$ZENOH_ENDPOINT" ]] && echo " zenoh.routerEndpoint = \"$ZENOH_ENDPOINT\""
237
+ [[ -n "$ROBOT_NAMESPACE" ]] && echo " robot.namespace = \"$ROBOT_NAMESPACE\""
238
+ [[ -n "$CAMERA_TOPIC" ]] && echo " robot.cameraTopic = \"$CAMERA_TOPIC\""
239
+ fi
240
+ else
241
+ echo "[5/5] No --transport / --rosbridge-url / --zenoh-endpoint / --robot-namespace / --camera-topic given; leaving config defaults (transport.mode = \"local\")."
242
+ fi
243
+ echo ""
244
+
245
+ # Systemd user service tweaks (only needed when the gateway runs from systemd).
246
+ # The "local" transport uses rclnodejs, which picks a prebuilt binary based on
247
+ # ROS_DISTRO. When the gateway runs from systemd it has no ROS env, so
248
+ # rclnodejs falls back to a from-source rebuild that almost always fails. We
249
+ # capture the ROS env once and feed it to the gateway via EnvironmentFile=.
250
+ if [[ "$NO_SYSTEMD" != true ]]; then
251
+ USER_SVC="$HOME/.config/systemd/user/openclaw-gateway.service"
252
+ if [[ -f "$USER_SVC" ]]; then
253
+ # 6a. Generate ROS env file for the gateway.
254
+ ROS_SETUP=""
255
+ if [[ -n "$ROS_DISTRO" && -f "/opt/ros/$ROS_DISTRO/setup.bash" ]]; then
256
+ ROS_SETUP="/opt/ros/$ROS_DISTRO/setup.bash"
257
+ else
258
+ for d in /opt/ros/*/setup.bash; do
259
+ [[ -f "$d" ]] && ROS_SETUP="$d" && break
260
+ done
261
+ fi
262
+ if [[ -n "$ROS_SETUP" ]]; then
263
+ ENV_FILE="$HOME/.agenticros/gateway-ros.env"
264
+ mkdir -p "$(dirname "$ENV_FILE")"
265
+ # Diff env before/after sourcing ROS so we only export ROS-relevant vars.
266
+ # NB: also forward any colcon overlay if one is present in $HOME/<ros2_ws>/install.
267
+ OVERLAY=""
268
+ for cand in "$REPO_ROOT/ros2_ws/install/setup.bash" "$HOME/ros2_ws/install/setup.bash"; do
269
+ [[ -f "$cand" ]] && OVERLAY="$cand" && break
270
+ done
271
+ # ROS setup.bash relies on a few vars being declared but not necessarily
272
+ # set, so we deliberately disable `set -u` (cleared via SHELLOPTS too in
273
+ # case the parent shell inherited it).
274
+ env -i HOME="$HOME" PATH="$PATH" bash <<EOSH > "$ENV_FILE"
275
+ set +u
276
+ unset SHELLOPTS 2>/dev/null || true
277
+ # shellcheck disable=SC1090
278
+ source "$ROS_SETUP"
279
+ if [ -n "$OVERLAY" ]; then source "$OVERLAY"; fi
280
+ for v in ROS_DISTRO ROS_VERSION ROS_PYTHON_VERSION ROS_DOMAIN_ID \\
281
+ AMENT_PREFIX_PATH CMAKE_PREFIX_PATH COLCON_PREFIX_PATH \\
282
+ LD_LIBRARY_PATH PYTHONPATH PKG_CONFIG_PATH \\
283
+ RMW_IMPLEMENTATION ROS_LOCALHOST_ONLY; do
284
+ val="\${!v-}"
285
+ if [ -n "\$val" ]; then echo "\$v=\$val"; fi
286
+ done
287
+ EOSH
288
+ echo " ROS env written to $ENV_FILE (sourced from $ROS_SETUP${OVERLAY:+ + $OVERLAY})."
289
+
290
+ # 6b. Drop-in pointing the gateway at the env file.
291
+ DROPIN_DIR="$HOME/.config/systemd/user/openclaw-gateway.service.d"
292
+ DROPIN="$DROPIN_DIR/agenticros-ros.conf"
293
+ mkdir -p "$DROPIN_DIR"
294
+ cat > "$DROPIN" <<EOF
295
+ # Auto-generated by scripts/setup_gateway_plugin.sh. Re-run that script after
296
+ # changing ROS distro / overlay to refresh $ENV_FILE.
297
+ [Service]
298
+ EnvironmentFile=$ENV_FILE
299
+ EOF
300
+ echo " Systemd drop-in written to $DROPIN."
301
+ systemctl --user daemon-reload
302
+ else
303
+ echo " No ROS installation found under /opt/ros/<distro>. The 'local' transport will not work until ROS is on PATH for the gateway."
304
+ fi
305
+
306
+ if [[ "$NO_RESTART" != true ]]; then
307
+ echo "Restarting openclaw-gateway.service ..."
308
+ systemctl --user restart openclaw-gateway.service
309
+ sleep 2
310
+ systemctl --user is-active openclaw-gateway.service || true
311
+ else
312
+ echo "Skipping restart (--no-restart). To pick up the plugin: systemctl --user restart openclaw-gateway.service"
313
+ fi
314
+ else
315
+ echo "No systemd user service at $USER_SVC. Restart the gateway however you started it to pick up the plugin."
316
+ echo "Make sure ROS (e.g. /opt/ros/$ROS_DISTRO/setup.bash) is sourced in the gateway's environment so rclnodejs can find its prebuilt binary."
317
+ fi
318
+ fi
319
+ echo ""
320
+
321
+ echo "Gateway plugin setup complete."
322
+ echo ""
323
+ echo "Verify with: openclaw plugins list | grep -i agenticros"
324
+ echo "Logs: tail -f /tmp/openclaw/openclaw-$(date +%Y-%m-%d).log"
325
+ echo ""
326
+ echo "Next time the plugin source changes, re-run this script (with --skip-build"
327
+ echo "if you've already run pnpm build) to refresh the deployment in $DEPLOY_DIR."
328
+ echo ""
329
+ echo "See docs/robot-setup.md for details on transport modes and robot wiring."
@@ -0,0 +1,113 @@
1
+ #!/bin/bash
2
+ # setup_robot.sh - One-time robot-side setup for AgenticROS (no Docker)
3
+ #
4
+ # Run this on the robot after cloning the repo. It builds the workspace,
5
+ # installs rosbridge (apt or from source), and prepares run scripts.
6
+ #
7
+ # Usage: ./scripts/setup_robot.sh [--ros-distro jazzy|humble] [--skip-apt]
8
+ # --ros-distro ROS2 distro (default: auto-detect from /opt/ros)
9
+ # --skip-apt Skip suggesting sudo apt install; go straight to from-source if needed
10
+
11
+ set -e
12
+
13
+ REPO_ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)
14
+ ROS2_WS="$REPO_ROOT/ros2_ws"
15
+ SKIP_APT=false
16
+ ROS_DISTRO=""
17
+ source "$REPO_ROOT/scripts/lib/agenticros-banner.sh"
18
+
19
+ while [[ $# -gt 0 ]]; do
20
+ case $1 in
21
+ --ros-distro) ROS_DISTRO="$2"; shift 2 ;;
22
+ --skip-apt) SKIP_APT=true; shift ;;
23
+ *) echo "Unknown option: $1"; exit 1 ;;
24
+ esac
25
+ done
26
+
27
+ agenticros_banner
28
+ echo "AgenticROS robot setup"
29
+ echo ""
30
+
31
+ # Detect ROS distro if not set
32
+ if [[ -z "$ROS_DISTRO" ]]; then
33
+ for d in /opt/ros/*/; do
34
+ if [[ -d "$d" && -f "${d}setup.bash" ]]; then
35
+ ROS_DISTRO=$(basename "$d")
36
+ echo "Detected ROS2 distro: $ROS_DISTRO"
37
+ break
38
+ fi
39
+ done
40
+ fi
41
+ if [[ -z "$ROS_DISTRO" ]]; then
42
+ echo "No ROS2 installation found in /opt/ros. Install ROS2 (Humble or Jazzy) first."
43
+ exit 1
44
+ fi
45
+
46
+ if [[ ! -f "/opt/ros/$ROS_DISTRO/setup.bash" ]]; then
47
+ echo "ROS2 $ROS_DISTRO not found at /opt/ros/$ROS_DISTRO"
48
+ exit 1
49
+ fi
50
+
51
+ # 1. Build ros2_ws
52
+ echo ""
53
+ echo "[1/3] Building ROS2 workspace (agenticros_msgs, agenticros_discovery, agenticros_agent)..."
54
+ source "/opt/ros/$ROS_DISTRO/setup.bash"
55
+ cd "$ROS2_WS"
56
+ if [[ ! -f install/setup.bash ]]; then
57
+ colcon build --symlink-install
58
+ else
59
+ echo "Workspace already built; re-building to be sure..."
60
+ colcon build --symlink-install
61
+ fi
62
+ echo "Workspace OK."
63
+ echo ""
64
+
65
+ # 2. Rosbridge: try apt, else from source
66
+ echo "[2/3] Rosbridge WebSocket server..."
67
+ if ros2 pkg list 2>/dev/null | grep -q rosbridge_server; then
68
+ echo "rosbridge_suite already available."
69
+ else
70
+ if [[ "$SKIP_APT" != true ]]; then
71
+ echo "Attempting to install rosbridge_suite via apt (may prompt for sudo)..."
72
+ if sudo apt-get update -qq 2>/dev/null && sudo apt-get install -y "ros-$ROS_DISTRO-rosbridge-suite" 2>/dev/null; then
73
+ echo "rosbridge_suite installed via apt."
74
+ else
75
+ echo "apt install failed or skipped. Building from source..."
76
+ "$REPO_ROOT/scripts/install_rosbridge_from_source.sh" "$ROS_DISTRO"
77
+ fi
78
+ else
79
+ echo "Building rosbridge from source (--skip-apt)..."
80
+ "$REPO_ROOT/scripts/install_rosbridge_from_source.sh" "$ROS_DISTRO"
81
+ fi
82
+ fi
83
+ echo ""
84
+
85
+ # 3. Quick check
86
+ echo "[3/3] Verifying..."
87
+ source "/opt/ros/$ROS_DISTRO/setup.bash"
88
+ source "$ROS2_WS/install/setup.bash"
89
+ for _d in "$ROS2_WS/venv_rosbridge/lib/python"*/site-packages; do
90
+ [[ -d "$_d" ]] && export PYTHONPATH="$_d:${PYTHONPATH:-}" && break
91
+ done
92
+ if ros2 pkg list 2>/dev/null | grep -q rosbridge_server; then
93
+ echo "rosbridge_server: OK"
94
+ else
95
+ echo "WARNING: rosbridge_server still not found. Run: ./scripts/install_rosbridge_from_source.sh $ROS_DISTRO"
96
+ fi
97
+ for pkg in agenticros_msgs agenticros_discovery; do
98
+ if ros2 pkg list 2>/dev/null | grep -q "^${pkg}$"; then echo "$pkg: OK"; else echo "$pkg: missing"; fi
99
+ done
100
+ echo ""
101
+
102
+ echo "=============================================="
103
+ echo " Robot setup complete"
104
+ echo "=============================================="
105
+ echo ""
106
+ echo "Start the bridges on this robot with:"
107
+ echo " ./scripts/run_demo_native.sh $ROS_DISTRO"
108
+ echo ""
109
+ echo "Then on the machine where OpenClaw runs, install and enable the plugin:"
110
+ echo " ./scripts/setup_gateway_plugin.sh"
111
+ echo ""
112
+ echo "See docs/robot-setup.md for full options and troubleshooting."
113
+ echo ""