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.
- package/LICENSE +192 -0
- package/README.md +90 -4
- package/dist/commands/config.d.ts +20 -0
- package/dist/commands/config.d.ts.map +1 -0
- package/dist/commands/config.js +179 -0
- package/dist/commands/config.js.map +1 -0
- package/dist/commands/doctor.d.ts +33 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +232 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/down.d.ts +15 -0
- package/dist/commands/down.d.ts.map +1 -0
- package/dist/commands/down.js +91 -0
- package/dist/commands/down.js.map +1 -0
- package/dist/commands/init.d.ts +21 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +259 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/logs.d.ts +18 -0
- package/dist/commands/logs.d.ts.map +1 -0
- package/dist/commands/logs.js +67 -0
- package/dist/commands/logs.js.map +1 -0
- package/dist/commands/status.d.ts +12 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +56 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/up.d.ts +20 -0
- package/dist/commands/up.d.ts.map +1 -0
- package/dist/commands/up.js +70 -0
- package/dist/commands/up.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +107 -0
- package/dist/index.js.map +1 -0
- package/dist/menu.d.ts +9 -0
- package/dist/menu.d.ts.map +1 -0
- package/dist/menu.js +96 -0
- package/dist/menu.js.map +1 -0
- package/dist/runners/real-robot.d.ts +15 -0
- package/dist/runners/real-robot.d.ts.map +1 -0
- package/dist/runners/real-robot.js +46 -0
- package/dist/runners/real-robot.js.map +1 -0
- package/dist/runners/sim.d.ts +19 -0
- package/dist/runners/sim.d.ts.map +1 -0
- package/dist/runners/sim.js +53 -0
- package/dist/runners/sim.js.map +1 -0
- package/dist/util/env.d.ts +24 -0
- package/dist/util/env.d.ts.map +1 -0
- package/dist/util/env.js +53 -0
- package/dist/util/env.js.map +1 -0
- package/dist/util/logger.d.ts +24 -0
- package/dist/util/logger.d.ts.map +1 -0
- package/dist/util/logger.js +62 -0
- package/dist/util/logger.js.map +1 -0
- package/dist/util/paths.d.ts +57 -0
- package/dist/util/paths.d.ts.map +1 -0
- package/dist/util/paths.js +132 -0
- package/dist/util/paths.js.map +1 -0
- package/dist/util/pidfile.d.ts +16 -0
- package/dist/util/pidfile.d.ts.map +1 -0
- package/dist/util/pidfile.js +63 -0
- package/dist/util/pidfile.js.map +1 -0
- package/dist/util/state.d.ts +26 -0
- package/dist/util/state.d.ts.map +1 -0
- package/dist/util/state.js +55 -0
- package/dist/util/state.js.map +1 -0
- package/package.json +60 -1
- package/runtime/BUNDLE.json +11 -0
- package/runtime/LICENSE +192 -0
- package/runtime/README.md +273 -0
- package/runtime/docs/architecture.md +366 -0
- package/runtime/docs/cli.md +140 -0
- package/runtime/docs/memory.md +292 -0
- package/runtime/docs/robot-setup.md +347 -0
- package/runtime/package.json +28 -0
- package/runtime/packages/agenticros/agenticros-agenticros-0.0.1.tgz +0 -0
- package/runtime/packages/agenticros/openclaw.plugin.json +451 -0
- package/runtime/packages/agenticros/package.json +41 -0
- package/runtime/packages/agenticros/src/camera-snapshot-cache.ts +59 -0
- package/runtime/packages/agenticros/src/camera-snapshot-routes.ts +44 -0
- package/runtime/packages/agenticros/src/commands/estop.ts +41 -0
- package/runtime/packages/agenticros/src/commands/transport.ts +195 -0
- package/runtime/packages/agenticros/src/config-file.ts +136 -0
- package/runtime/packages/agenticros/src/config-page.ts +498 -0
- package/runtime/packages/agenticros/src/context/robot-context.ts +373 -0
- package/runtime/packages/agenticros/src/depth.ts +313 -0
- package/runtime/packages/agenticros/src/describer.ts +157 -0
- package/runtime/packages/agenticros/src/image-binary-trim.ts +16 -0
- package/runtime/packages/agenticros/src/index.ts +85 -0
- package/runtime/packages/agenticros/src/landing-page.ts +38 -0
- package/runtime/packages/agenticros/src/memory.ts +44 -0
- package/runtime/packages/agenticros/src/plugin-api.ts +173 -0
- package/runtime/packages/agenticros/src/plugin-image-base64.ts +69 -0
- package/runtime/packages/agenticros/src/preflight.ts +110 -0
- package/runtime/packages/agenticros/src/routes.ts +328 -0
- package/runtime/packages/agenticros/src/safety/validator.ts +43 -0
- package/runtime/packages/agenticros/src/service.ts +359 -0
- package/runtime/packages/agenticros/src/skill-api.ts +65 -0
- package/runtime/packages/agenticros/src/skill-loader.ts +146 -0
- package/runtime/packages/agenticros/src/teleop/page.ts +498 -0
- package/runtime/packages/agenticros/src/teleop/routes.ts +650 -0
- package/runtime/packages/agenticros/src/tools/index.ts +26 -0
- package/runtime/packages/agenticros/src/tools/ros2-action.ts +50 -0
- package/runtime/packages/agenticros/src/tools/ros2-camera.ts +221 -0
- package/runtime/packages/agenticros/src/tools/ros2-depth-distance.ts +58 -0
- package/runtime/packages/agenticros/src/tools/ros2-introspect.ts +62 -0
- package/runtime/packages/agenticros/src/tools/ros2-memory.ts +158 -0
- package/runtime/packages/agenticros/src/tools/ros2-param.ts +87 -0
- package/runtime/packages/agenticros/src/tools/ros2-publish.ts +52 -0
- package/runtime/packages/agenticros/src/tools/ros2-service.ts +46 -0
- package/runtime/packages/agenticros/src/tools/ros2-subscribe.ts +71 -0
- package/runtime/packages/agenticros/tsconfig.json +9 -0
- package/runtime/packages/agenticros-claude-code/README.md +260 -0
- package/runtime/packages/agenticros-claude-code/config.example.json +9 -0
- package/runtime/packages/agenticros-claude-code/dist/config.d.ts +8 -0
- package/runtime/packages/agenticros-claude-code/dist/config.d.ts.map +1 -0
- package/runtime/packages/agenticros-claude-code/dist/config.js +93 -0
- package/runtime/packages/agenticros-claude-code/dist/config.js.map +1 -0
- package/runtime/packages/agenticros-claude-code/dist/depth.d.ts +20 -0
- package/runtime/packages/agenticros-claude-code/dist/depth.d.ts.map +1 -0
- package/runtime/packages/agenticros-claude-code/dist/depth.js +126 -0
- package/runtime/packages/agenticros-claude-code/dist/depth.js.map +1 -0
- package/runtime/packages/agenticros-claude-code/dist/find-object/coco-classes.d.ts +6 -0
- package/runtime/packages/agenticros-claude-code/dist/find-object/coco-classes.d.ts.map +1 -0
- package/runtime/packages/agenticros-claude-code/dist/find-object/coco-classes.js +36 -0
- package/runtime/packages/agenticros-claude-code/dist/find-object/coco-classes.js.map +1 -0
- package/runtime/packages/agenticros-claude-code/dist/find-object/find-object.d.ts +33 -0
- package/runtime/packages/agenticros-claude-code/dist/find-object/find-object.d.ts.map +1 -0
- package/runtime/packages/agenticros-claude-code/dist/find-object/find-object.js +134 -0
- package/runtime/packages/agenticros-claude-code/dist/find-object/find-object.js.map +1 -0
- package/runtime/packages/agenticros-claude-code/dist/follow-me/controller.d.ts +43 -0
- package/runtime/packages/agenticros-claude-code/dist/follow-me/controller.d.ts.map +1 -0
- package/runtime/packages/agenticros-claude-code/dist/follow-me/controller.js +73 -0
- package/runtime/packages/agenticros-claude-code/dist/follow-me/controller.js.map +1 -0
- package/runtime/packages/agenticros-claude-code/dist/follow-me/detector.d.ts +58 -0
- package/runtime/packages/agenticros-claude-code/dist/follow-me/detector.d.ts.map +1 -0
- package/runtime/packages/agenticros-claude-code/dist/follow-me/detector.js +251 -0
- package/runtime/packages/agenticros-claude-code/dist/follow-me/detector.js.map +1 -0
- package/runtime/packages/agenticros-claude-code/dist/follow-me/loop.d.ts +61 -0
- package/runtime/packages/agenticros-claude-code/dist/follow-me/loop.d.ts.map +1 -0
- package/runtime/packages/agenticros-claude-code/dist/follow-me/loop.js +268 -0
- package/runtime/packages/agenticros-claude-code/dist/follow-me/loop.js.map +1 -0
- package/runtime/packages/agenticros-claude-code/dist/index.d.ts +3 -0
- package/runtime/packages/agenticros-claude-code/dist/index.d.ts.map +1 -0
- package/runtime/packages/agenticros-claude-code/dist/index.js +111 -0
- package/runtime/packages/agenticros-claude-code/dist/index.js.map +1 -0
- package/runtime/packages/agenticros-claude-code/dist/memory.d.ts +17 -0
- package/runtime/packages/agenticros-claude-code/dist/memory.d.ts.map +1 -0
- package/runtime/packages/agenticros-claude-code/dist/memory.js +44 -0
- package/runtime/packages/agenticros-claude-code/dist/memory.js.map +1 -0
- package/runtime/packages/agenticros-claude-code/dist/safety.d.ts +10 -0
- package/runtime/packages/agenticros-claude-code/dist/safety.d.ts.map +1 -0
- package/runtime/packages/agenticros-claude-code/dist/safety.js +34 -0
- package/runtime/packages/agenticros-claude-code/dist/safety.js.map +1 -0
- package/runtime/packages/agenticros-claude-code/dist/tools.d.ts +36 -0
- package/runtime/packages/agenticros-claude-code/dist/tools.d.ts.map +1 -0
- package/runtime/packages/agenticros-claude-code/dist/tools.js +777 -0
- package/runtime/packages/agenticros-claude-code/dist/tools.js.map +1 -0
- package/runtime/packages/agenticros-claude-code/dist/transport.d.ts +17 -0
- package/runtime/packages/agenticros-claude-code/dist/transport.d.ts.map +1 -0
- package/runtime/packages/agenticros-claude-code/dist/transport.js +46 -0
- package/runtime/packages/agenticros-claude-code/dist/transport.js.map +1 -0
- package/runtime/packages/agenticros-claude-code/dist/zero-shot/detector.d.ts +42 -0
- package/runtime/packages/agenticros-claude-code/dist/zero-shot/detector.d.ts.map +1 -0
- package/runtime/packages/agenticros-claude-code/dist/zero-shot/detector.js +114 -0
- package/runtime/packages/agenticros-claude-code/dist/zero-shot/detector.js.map +1 -0
- package/runtime/packages/agenticros-claude-code/package.json +29 -0
- package/runtime/packages/agenticros-claude-code/src/config.ts +96 -0
- package/runtime/packages/agenticros-claude-code/src/depth.ts +173 -0
- package/runtime/packages/agenticros-claude-code/src/find-object/coco-classes.ts +38 -0
- package/runtime/packages/agenticros-claude-code/src/find-object/find-object.ts +190 -0
- package/runtime/packages/agenticros-claude-code/src/follow-me/controller.ts +109 -0
- package/runtime/packages/agenticros-claude-code/src/follow-me/depth-loop.ts +420 -0
- package/runtime/packages/agenticros-claude-code/src/follow-me/detector.ts +303 -0
- package/runtime/packages/agenticros-claude-code/src/follow-me/loop.ts +330 -0
- package/runtime/packages/agenticros-claude-code/src/index.ts +125 -0
- package/runtime/packages/agenticros-claude-code/src/memory.ts +51 -0
- package/runtime/packages/agenticros-claude-code/src/safety.ts +44 -0
- package/runtime/packages/agenticros-claude-code/src/tools.ts +891 -0
- package/runtime/packages/agenticros-claude-code/src/transport.ts +58 -0
- package/runtime/packages/agenticros-claude-code/src/zero-shot/detector.ts +169 -0
- package/runtime/packages/agenticros-claude-code/tsconfig.json +9 -0
- package/runtime/packages/agenticros-claude-code/yolo-debug.mjs +106 -0
- package/runtime/packages/agenticros-gemini/README.md +139 -0
- package/runtime/packages/agenticros-gemini/package.json +28 -0
- package/runtime/packages/agenticros-gemini/scripts/smoke-api.mjs +42 -0
- package/runtime/packages/agenticros-gemini/src/chat.ts +139 -0
- package/runtime/packages/agenticros-gemini/src/config.ts +92 -0
- package/runtime/packages/agenticros-gemini/src/depth.ts +173 -0
- package/runtime/packages/agenticros-gemini/src/index.ts +58 -0
- package/runtime/packages/agenticros-gemini/src/memory.ts +32 -0
- package/runtime/packages/agenticros-gemini/src/safety.ts +44 -0
- package/runtime/packages/agenticros-gemini/src/tools.ts +516 -0
- package/runtime/packages/agenticros-gemini/src/transport.ts +58 -0
- package/runtime/packages/agenticros-gemini/tsconfig.json +8 -0
- package/runtime/packages/core/package.json +47 -0
- package/runtime/packages/core/src/banner.ts +32 -0
- package/runtime/packages/core/src/cmd-vel-twist.ts +31 -0
- package/runtime/packages/core/src/config.ts +279 -0
- package/runtime/packages/core/src/index.ts +54 -0
- package/runtime/packages/core/src/memory/__tests__/factory.test.ts +70 -0
- package/runtime/packages/core/src/memory/__tests__/local-provider.test.ts +195 -0
- package/runtime/packages/core/src/memory/__tests__/mem0-provider.test.ts +192 -0
- package/runtime/packages/core/src/memory/__tests__/smart-defaults.test.ts +46 -0
- package/runtime/packages/core/src/memory/factory.ts +63 -0
- package/runtime/packages/core/src/memory/index.ts +10 -0
- package/runtime/packages/core/src/memory/local/provider.ts +229 -0
- package/runtime/packages/core/src/memory/mem0/provider.ts +379 -0
- package/runtime/packages/core/src/memory/types.ts +96 -0
- package/runtime/packages/core/src/topic-utils.ts +95 -0
- package/runtime/packages/core/src/transport/factory.ts +47 -0
- package/runtime/packages/core/src/transport/local/conversion.ts +333 -0
- package/runtime/packages/core/src/transport/local/entities.ts +129 -0
- package/runtime/packages/core/src/transport/local/transport.ts +406 -0
- package/runtime/packages/core/src/transport/rosbridge/actions.ts +81 -0
- package/runtime/packages/core/src/transport/rosbridge/adapter.ts +157 -0
- package/runtime/packages/core/src/transport/rosbridge/client.ts +438 -0
- package/runtime/packages/core/src/transport/rosbridge/services.ts +41 -0
- package/runtime/packages/core/src/transport/rosbridge/topics.ts +60 -0
- package/runtime/packages/core/src/transport/rosbridge/types.ts +118 -0
- package/runtime/packages/core/src/transport/transport.ts +77 -0
- package/runtime/packages/core/src/transport/types.ts +137 -0
- package/runtime/packages/core/src/transport/webrtc/signaling-client.ts +196 -0
- package/runtime/packages/core/src/transport/webrtc/signaling-types.ts +130 -0
- package/runtime/packages/core/src/transport/webrtc/transport.ts +516 -0
- package/runtime/packages/core/src/transport/zenoh/adapter.ts +357 -0
- package/runtime/packages/core/src/transport/zenoh/cdr.ts +183 -0
- package/runtime/packages/core/src/transport/zenoh/keys.ts +51 -0
- package/runtime/packages/core/tsconfig.json +9 -0
- package/runtime/packages/ros-camera/package.json +30 -0
- package/runtime/packages/ros-camera/src/index.ts +13 -0
- package/runtime/packages/ros-camera/src/snapshot.ts +372 -0
- package/runtime/packages/ros-camera/tsconfig.json +9 -0
- package/runtime/pnpm-lock.yaml +5260 -0
- package/runtime/pnpm-workspace.yaml +2 -0
- package/runtime/ros2_ws/src/agenticros_agent/agenticros_agent/__init__.py +0 -0
- package/runtime/ros2_ws/src/agenticros_agent/agenticros_agent/agent_node.py +561 -0
- package/runtime/ros2_ws/src/agenticros_agent/package.xml +25 -0
- package/runtime/ros2_ws/src/agenticros_agent/resource/agenticros_agent +0 -0
- package/runtime/ros2_ws/src/agenticros_agent/setup.cfg +4 -0
- package/runtime/ros2_ws/src/agenticros_agent/setup.py +25 -0
- package/runtime/ros2_ws/src/agenticros_bringup/README.md +128 -0
- package/runtime/ros2_ws/src/agenticros_bringup/agenticros_bringup/__init__.py +1 -0
- package/runtime/ros2_ws/src/agenticros_bringup/agenticros_bringup/cmd_vel_relay.py +33 -0
- package/runtime/ros2_ws/src/agenticros_bringup/launch/cmd_vel_bridge.launch.py +58 -0
- package/runtime/ros2_ws/src/agenticros_bringup/launch/gazebo_turtlebot3.launch.py +69 -0
- package/runtime/ros2_ws/src/agenticros_bringup/launch/mode_a_gazebo.launch.py +55 -0
- package/runtime/ros2_ws/src/agenticros_bringup/launch/mode_a_gazebo_rviz.launch.py +48 -0
- package/runtime/ros2_ws/src/agenticros_bringup/launch/realsense_rosbridge.launch.py +154 -0
- package/runtime/ros2_ws/src/agenticros_bringup/launch/rosbridge_gazebo.launch.py +54 -0
- package/runtime/ros2_ws/src/agenticros_bringup/launch/rviz.launch.py +38 -0
- package/runtime/ros2_ws/src/agenticros_bringup/launch/turtlebot3_gazebo_rviz.launch.py +42 -0
- package/runtime/ros2_ws/src/agenticros_bringup/package.xml +24 -0
- package/runtime/ros2_ws/src/agenticros_bringup/resource/agenticros_bringup +0 -0
- package/runtime/ros2_ws/src/agenticros_bringup/rviz/turtlebot3_agenticros.rviz +174 -0
- package/runtime/ros2_ws/src/agenticros_bringup/setup.cfg +4 -0
- package/runtime/ros2_ws/src/agenticros_bringup/setup.py +28 -0
- package/runtime/ros2_ws/src/agenticros_discovery/agenticros_discovery/__init__.py +0 -0
- package/runtime/ros2_ws/src/agenticros_discovery/agenticros_discovery/discovery_node.py +172 -0
- package/runtime/ros2_ws/src/agenticros_discovery/package.xml +22 -0
- package/runtime/ros2_ws/src/agenticros_discovery/resource/agenticros_discovery +0 -0
- package/runtime/ros2_ws/src/agenticros_discovery/setup.cfg +5 -0
- package/runtime/ros2_ws/src/agenticros_discovery/setup.py +25 -0
- package/runtime/ros2_ws/src/agenticros_follow_me/README.md +66 -0
- package/runtime/ros2_ws/src/agenticros_follow_me/agenticros_follow_me/__init__.py +1 -0
- package/runtime/ros2_ws/src/agenticros_follow_me/agenticros_follow_me/__main__.py +5 -0
- package/runtime/ros2_ws/src/agenticros_follow_me/agenticros_follow_me/follow_me_node.py +278 -0
- package/runtime/ros2_ws/src/agenticros_follow_me/agenticros_follow_me/follower_controller.py +631 -0
- package/runtime/ros2_ws/src/agenticros_follow_me/agenticros_follow_me/person_tracker.py +635 -0
- package/runtime/ros2_ws/src/agenticros_follow_me/package.xml +22 -0
- package/runtime/ros2_ws/src/agenticros_follow_me/resource/agenticros_follow_me +0 -0
- package/runtime/ros2_ws/src/agenticros_follow_me/setup.py +25 -0
- package/runtime/ros2_ws/src/agenticros_msgs/CMakeLists.txt +26 -0
- package/runtime/ros2_ws/src/agenticros_msgs/msg/CapabilityManifest.msg +9 -0
- package/runtime/ros2_ws/src/agenticros_msgs/package.xml +22 -0
- package/runtime/ros2_ws/src/agenticros_msgs/srv/FollowMeGetStatus.srv +11 -0
- package/runtime/ros2_ws/src/agenticros_msgs/srv/FollowMeSetDistance.srv +4 -0
- package/runtime/ros2_ws/src/agenticros_msgs/srv/FollowMeSetTarget.srv +6 -0
- package/runtime/ros2_ws/src/agenticros_msgs/srv/FollowMeStart.srv +5 -0
- package/runtime/ros2_ws/src/agenticros_msgs/srv/FollowMeStop.srv +3 -0
- package/runtime/ros2_ws/src/agenticros_msgs/srv/GetCapabilities.srv +5 -0
- package/runtime/ros2_ws/src/agenticros_sim/CMakeLists.txt +24 -0
- package/runtime/ros2_ws/src/agenticros_sim/README.md +120 -0
- package/runtime/ros2_ws/src/agenticros_sim/config/agenticros-sim.config.json +28 -0
- package/runtime/ros2_ws/src/agenticros_sim/config/amr_bridge.yaml +111 -0
- package/runtime/ros2_ws/src/agenticros_sim/config/amr_view.rviz +172 -0
- package/runtime/ros2_ws/src/agenticros_sim/env-hooks/gz_resource_path.dsv.in +3 -0
- package/runtime/ros2_ws/src/agenticros_sim/env-hooks/gz_resource_path.sh.in +7 -0
- package/runtime/ros2_ws/src/agenticros_sim/launch/sim_amr.launch.py +159 -0
- package/runtime/ros2_ws/src/agenticros_sim/models/agenticros_amr/model.config +17 -0
- package/runtime/ros2_ws/src/agenticros_sim/models/agenticros_amr/model.sdf +244 -0
- package/runtime/ros2_ws/src/agenticros_sim/package.xml +27 -0
- package/runtime/ros2_ws/src/agenticros_sim/worlds/agenticros_indoor.sdf +183 -0
- package/runtime/scripts/activate_workspace.sh +285 -0
- package/runtime/scripts/agenticros-describer.policy.yaml +96 -0
- package/runtime/scripts/agenticros-proxy.cjs +99 -0
- package/runtime/scripts/agenticros-rosbridge.policy.yaml +62 -0
- package/runtime/scripts/check-cli-tarball-size.mjs +42 -0
- package/runtime/scripts/configure_agenticros.sh +200 -0
- package/runtime/scripts/configure_for_sim.sh +64 -0
- package/runtime/scripts/fix-openclaw-control-ui-path.sh +20 -0
- package/runtime/scripts/install_cli.sh +94 -0
- package/runtime/scripts/install_rosbridge_from_source.sh +67 -0
- package/runtime/scripts/lib/agenticros-banner.sh +28 -0
- package/runtime/scripts/onboard_robot.sh +75 -0
- package/runtime/scripts/openai.policy.yaml +77 -0
- package/runtime/scripts/openclaw-dashboard-url.cjs +49 -0
- package/runtime/scripts/pack-runtime.mjs +245 -0
- package/runtime/scripts/run_demo_native.sh +43 -0
- package/runtime/scripts/run_nemoclaw_host_stack.sh +91 -0
- package/runtime/scripts/run_robot_rosbridge.sh +36 -0
- package/runtime/scripts/sandbox_rosbridge_relay.py +137 -0
- package/runtime/scripts/setup-openclaw-local.cjs +75 -0
- package/runtime/scripts/setup_gateway_plugin.sh +329 -0
- package/runtime/scripts/setup_robot.sh +113 -0
- package/runtime/scripts/setup_workspace.sh +484 -0
- package/runtime/scripts/sim/run_sim.sh +146 -0
- package/runtime/scripts/smoke_test_nemoclaw.sh +123 -0
- package/runtime/scripts/start_demo.sh +55 -0
- package/runtime/scripts/sync-skill-tools.mjs +335 -0
- package/runtime/scripts/test-follow-me-sim.mjs +135 -0
- package/runtime/scripts/test-mcp-e2e.mjs +184 -0
- package/runtime/scripts/test-rclnodejs.mts +129 -0
- package/runtime/scripts/use-openclaw-2026.2.26.sh +19 -0
- package/runtime/scripts/use-openclaw-2026.3.11.sh +19 -0
- package/runtime/scripts/zenoh-bridge-ros2dds-robot.json5 +30 -0
- package/runtime/scripts/zenohd-agenticros.json5 +11 -0
- package/runtime/scripts/zenohd-rosclaw.json5 +11 -0
- package/runtime/tsconfig.base.json +19 -0
- package/index.js +0 -6
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Rotate the robot in place until a target COCO class is detected in the
|
|
3
|
+
* camera feed, then stop. Used by the ros2_find_object MCP tool.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import type { AgenticROSConfig, RosTransport } from "@agenticros/core";
|
|
7
|
+
import { resolveCameraSubscribeTopic, toNamespacedTopic } from "@agenticros/core";
|
|
8
|
+
import {
|
|
9
|
+
ROS_MSG_COMPRESSED_IMAGE,
|
|
10
|
+
cameraSnapshotFromPlainMessage,
|
|
11
|
+
} from "@agenticros/ros-camera";
|
|
12
|
+
import { PersonDetector } from "../follow-me/detector.js";
|
|
13
|
+
import { resolveCocoClassId, COCO_CLASSES } from "./coco-classes.js";
|
|
14
|
+
|
|
15
|
+
const DEFAULT_COLOR_TOPIC = "/camera/camera/color/image_raw/compressed";
|
|
16
|
+
const DEFAULT_ANGULAR_SPEED = 0.3; // rad/s
|
|
17
|
+
const DEFAULT_TIMEOUT_SEC = 30;
|
|
18
|
+
const DEFAULT_MIN_CONFIDENCE = 0.5;
|
|
19
|
+
const POLL_INTERVAL_MS = 500;
|
|
20
|
+
const SNAPSHOT_TIMEOUT_MS = 3000;
|
|
21
|
+
|
|
22
|
+
export interface FindObjectOptions {
|
|
23
|
+
target: string;
|
|
24
|
+
angularSpeed?: number;
|
|
25
|
+
timeoutSeconds?: number;
|
|
26
|
+
minConfidence?: number;
|
|
27
|
+
clockwise?: boolean;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface FindObjectResult {
|
|
31
|
+
found: boolean;
|
|
32
|
+
target: string;
|
|
33
|
+
classId: number;
|
|
34
|
+
elapsedSeconds: number;
|
|
35
|
+
rotationDirection: "clockwise" | "counterclockwise";
|
|
36
|
+
angularSpeed: number;
|
|
37
|
+
detection?: {
|
|
38
|
+
confidence: number;
|
|
39
|
+
cx: number;
|
|
40
|
+
cy: number;
|
|
41
|
+
width: number;
|
|
42
|
+
height: number;
|
|
43
|
+
imageWidth: number;
|
|
44
|
+
imageHeight: number;
|
|
45
|
+
horizontalOffset: number;
|
|
46
|
+
};
|
|
47
|
+
error?: string;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export async function findObject(
|
|
51
|
+
config: AgenticROSConfig,
|
|
52
|
+
transport: RosTransport,
|
|
53
|
+
opts: FindObjectOptions,
|
|
54
|
+
): Promise<FindObjectResult> {
|
|
55
|
+
const classId = resolveCocoClassId(opts.target);
|
|
56
|
+
if (classId === null) {
|
|
57
|
+
return {
|
|
58
|
+
found: false,
|
|
59
|
+
target: opts.target,
|
|
60
|
+
classId: -1,
|
|
61
|
+
elapsedSeconds: 0,
|
|
62
|
+
rotationDirection: "clockwise",
|
|
63
|
+
angularSpeed: 0,
|
|
64
|
+
error:
|
|
65
|
+
`Unknown target "${opts.target}". Must be a COCO class name (e.g., "cell phone", "chair", "bottle"). ` +
|
|
66
|
+
`Supported: ${COCO_CLASSES.join(", ")}.`,
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
const safety = config.safety ?? {};
|
|
71
|
+
const maxAngular = safety.maxAngularVelocity ?? 1.5;
|
|
72
|
+
const requestedSpeed = Math.max(0.05, Math.min(maxAngular, opts.angularSpeed ?? DEFAULT_ANGULAR_SPEED));
|
|
73
|
+
const clockwise = opts.clockwise ?? true;
|
|
74
|
+
const angularZ = clockwise ? -requestedSpeed : requestedSpeed;
|
|
75
|
+
const timeoutMs = Math.max(1000, (opts.timeoutSeconds ?? DEFAULT_TIMEOUT_SEC) * 1000);
|
|
76
|
+
const minConfidence = opts.minConfidence ?? DEFAULT_MIN_CONFIDENCE;
|
|
77
|
+
|
|
78
|
+
const detector = new PersonDetector({ scoreThreshold: minConfidence });
|
|
79
|
+
await detector.load();
|
|
80
|
+
|
|
81
|
+
const cmdVelTopic = resolveCmdVelTopic(config);
|
|
82
|
+
const colorTopic = resolveCameraSubscribeTopic(
|
|
83
|
+
config,
|
|
84
|
+
(config.robot?.cameraTopic ?? "").trim() || DEFAULT_COLOR_TOPIC,
|
|
85
|
+
);
|
|
86
|
+
|
|
87
|
+
const startedAt = Date.now();
|
|
88
|
+
let rotating = false;
|
|
89
|
+
let result: FindObjectResult["detection"] | undefined;
|
|
90
|
+
|
|
91
|
+
const publishTwist = async (linearX: number, angZ: number) => {
|
|
92
|
+
try {
|
|
93
|
+
await transport.publish({
|
|
94
|
+
topic: cmdVelTopic,
|
|
95
|
+
type: "geometry_msgs/msg/Twist",
|
|
96
|
+
msg: { linear: { x: linearX, y: 0, z: 0 }, angular: { x: 0, y: 0, z: angZ } },
|
|
97
|
+
});
|
|
98
|
+
} catch {
|
|
99
|
+
// best-effort; loop will retry
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
try {
|
|
104
|
+
await publishTwist(0, angularZ);
|
|
105
|
+
rotating = true;
|
|
106
|
+
|
|
107
|
+
const deadline = startedAt + timeoutMs;
|
|
108
|
+
while (Date.now() < deadline && !result) {
|
|
109
|
+
// Keep the rotation alive in case the robot times out cmd_vel commands.
|
|
110
|
+
await publishTwist(0, angularZ);
|
|
111
|
+
|
|
112
|
+
const frame = await snapshotOnce(transport, colorTopic).catch(() => null);
|
|
113
|
+
if (frame) {
|
|
114
|
+
const det = await detector.detectClass(frame.buffer, classId);
|
|
115
|
+
if (det.detections.length > 0) {
|
|
116
|
+
const best = det.detections.reduce((a, b) => (a.confidence > b.confidence ? a : b));
|
|
117
|
+
result = {
|
|
118
|
+
confidence: best.confidence,
|
|
119
|
+
cx: best.cx,
|
|
120
|
+
cy: best.cy,
|
|
121
|
+
width: best.width,
|
|
122
|
+
height: best.height,
|
|
123
|
+
imageWidth: det.width,
|
|
124
|
+
imageHeight: det.height,
|
|
125
|
+
horizontalOffset: (best.cx - det.width / 2) / (det.width / 2),
|
|
126
|
+
};
|
|
127
|
+
break;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
const remaining = deadline - Date.now();
|
|
132
|
+
if (remaining <= 0) break;
|
|
133
|
+
await sleep(Math.min(POLL_INTERVAL_MS, remaining));
|
|
134
|
+
}
|
|
135
|
+
} finally {
|
|
136
|
+
if (rotating) await publishTwist(0, 0);
|
|
137
|
+
await detector.dispose().catch(() => {});
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
const elapsedSeconds = (Date.now() - startedAt) / 1000;
|
|
141
|
+
return {
|
|
142
|
+
found: !!result,
|
|
143
|
+
target: opts.target,
|
|
144
|
+
classId,
|
|
145
|
+
elapsedSeconds,
|
|
146
|
+
rotationDirection: clockwise ? "clockwise" : "counterclockwise",
|
|
147
|
+
angularSpeed: requestedSpeed,
|
|
148
|
+
detection: result,
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
async function snapshotOnce(
|
|
153
|
+
transport: RosTransport,
|
|
154
|
+
topic: string,
|
|
155
|
+
): Promise<{ buffer: Buffer } | null> {
|
|
156
|
+
return new Promise((resolve) => {
|
|
157
|
+
const sub = transport.subscribe(
|
|
158
|
+
{ topic, type: ROS_MSG_COMPRESSED_IMAGE },
|
|
159
|
+
(msg: Record<string, unknown>) => {
|
|
160
|
+
clearTimeout(timer);
|
|
161
|
+
sub.unsubscribe();
|
|
162
|
+
try {
|
|
163
|
+
const payload = cameraSnapshotFromPlainMessage("CompressedImage", msg);
|
|
164
|
+
resolve({ buffer: Buffer.from(payload.dataBase64, "base64") });
|
|
165
|
+
} catch {
|
|
166
|
+
resolve(null);
|
|
167
|
+
}
|
|
168
|
+
},
|
|
169
|
+
);
|
|
170
|
+
const timer = setTimeout(() => {
|
|
171
|
+
sub.unsubscribe();
|
|
172
|
+
resolve(null);
|
|
173
|
+
}, SNAPSHOT_TIMEOUT_MS);
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
function sleep(ms: number): Promise<void> {
|
|
178
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
function resolveCmdVelTopic(config: AgenticROSConfig): string {
|
|
182
|
+
const raw = (config.teleop?.cmdVelTopic ?? "").trim() || "/cmd_vel";
|
|
183
|
+
const namespaced = toNamespacedTopic(config, raw);
|
|
184
|
+
const match = namespaced.match(/^\/([^/]+)\/cmd_vel$/i);
|
|
185
|
+
const segment = match?.[1] ?? "";
|
|
186
|
+
if (match && !segment.toLowerCase().startsWith("robot")) {
|
|
187
|
+
return `/robot${segment.replace(/-/g, "")}/cmd_vel`;
|
|
188
|
+
}
|
|
189
|
+
return namespaced;
|
|
190
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Follower P-controller ported from agenticros_follow_me/follower_controller.py.
|
|
3
|
+
*
|
|
4
|
+
* Given a target person's 3D position (x = lateral metres, z = depth metres),
|
|
5
|
+
* compute a smoothed, deadzoned, clamped Twist command.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
export interface ControllerConfig {
|
|
9
|
+
targetDistance: number;
|
|
10
|
+
maxLinearVel: number;
|
|
11
|
+
maxAngularVel: number;
|
|
12
|
+
kpDistance: number;
|
|
13
|
+
kpAngular: number;
|
|
14
|
+
distanceDeadzone: number;
|
|
15
|
+
angularDeadzone: number;
|
|
16
|
+
smoothingFactor: number;
|
|
17
|
+
watchdogTimeoutMs: number;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export const DEFAULT_CONTROLLER_CONFIG: ControllerConfig = {
|
|
21
|
+
targetDistance: 1.0,
|
|
22
|
+
maxLinearVel: 0.5,
|
|
23
|
+
maxAngularVel: 1.0,
|
|
24
|
+
kpDistance: 0.5,
|
|
25
|
+
kpAngular: 1.5,
|
|
26
|
+
distanceDeadzone: 0.05,
|
|
27
|
+
angularDeadzone: 0.05,
|
|
28
|
+
smoothingFactor: 0.3,
|
|
29
|
+
watchdogTimeoutMs: 500,
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export interface Twist {
|
|
33
|
+
linearX: number;
|
|
34
|
+
angularZ: number;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface TargetSample {
|
|
38
|
+
/** Lateral offset in metres (positive = right of camera centre). */
|
|
39
|
+
x: number;
|
|
40
|
+
/** Forward depth in metres. */
|
|
41
|
+
z: number;
|
|
42
|
+
confidence: number;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export class FollowerController {
|
|
46
|
+
readonly config: ControllerConfig;
|
|
47
|
+
private smoothedLinear = 0;
|
|
48
|
+
private smoothedAngular = 0;
|
|
49
|
+
private lastDetectionMs = 0;
|
|
50
|
+
private lastTwist: Twist = { linearX: 0, angularZ: 0 };
|
|
51
|
+
|
|
52
|
+
constructor(config: Partial<ControllerConfig> = {}) {
|
|
53
|
+
this.config = { ...DEFAULT_CONTROLLER_CONFIG, ...config };
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
setTargetDistance(d: number): void {
|
|
57
|
+
this.config.targetDistance = Math.max(0.3, Math.min(5.0, d));
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
reset(): void {
|
|
61
|
+
this.smoothedLinear = 0;
|
|
62
|
+
this.smoothedAngular = 0;
|
|
63
|
+
this.lastTwist = { linearX: 0, angularZ: 0 };
|
|
64
|
+
this.lastDetectionMs = Date.now();
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/** Compute next twist. Pass null when no person is detected this tick. */
|
|
68
|
+
update(target: TargetSample | null): Twist {
|
|
69
|
+
const now = Date.now();
|
|
70
|
+
if (!target) {
|
|
71
|
+
if (now - this.lastDetectionMs > this.config.watchdogTimeoutMs) {
|
|
72
|
+
this.smoothedLinear = 0;
|
|
73
|
+
this.smoothedAngular = 0;
|
|
74
|
+
this.lastTwist = { linearX: 0, angularZ: 0 };
|
|
75
|
+
return this.lastTwist;
|
|
76
|
+
}
|
|
77
|
+
return this.lastTwist;
|
|
78
|
+
}
|
|
79
|
+
this.lastDetectionMs = now;
|
|
80
|
+
|
|
81
|
+
let distErr = target.z - this.config.targetDistance;
|
|
82
|
+
// angular error: pointing right (positive x) should turn right (negative angular_z)
|
|
83
|
+
let angErr = -Math.atan2(target.x, Math.max(target.z, 0.1));
|
|
84
|
+
|
|
85
|
+
if (Math.abs(distErr) < this.config.distanceDeadzone) distErr = 0;
|
|
86
|
+
if (Math.abs(angErr) < this.config.angularDeadzone) angErr = 0;
|
|
87
|
+
|
|
88
|
+
let linearCmd = this.config.kpDistance * distErr;
|
|
89
|
+
let angularCmd = this.config.kpAngular * angErr;
|
|
90
|
+
|
|
91
|
+
linearCmd = clamp(linearCmd, -this.config.maxLinearVel, this.config.maxLinearVel);
|
|
92
|
+
angularCmd = clamp(angularCmd, -this.config.maxAngularVel, this.config.maxAngularVel);
|
|
93
|
+
|
|
94
|
+
const a = this.config.smoothingFactor;
|
|
95
|
+
this.smoothedLinear = a * linearCmd + (1 - a) * this.smoothedLinear;
|
|
96
|
+
this.smoothedAngular = a * angularCmd + (1 - a) * this.smoothedAngular;
|
|
97
|
+
|
|
98
|
+
this.lastTwist = { linearX: this.smoothedLinear, angularZ: this.smoothedAngular };
|
|
99
|
+
return this.lastTwist;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
getLastTwist(): Twist {
|
|
103
|
+
return this.lastTwist;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
function clamp(v: number, lo: number, hi: number): number {
|
|
108
|
+
return Math.max(lo, Math.min(hi, v));
|
|
109
|
+
}
|