GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing selfpatch.github.io — Getting Started — ros2_medkit Documentation Getting StartedThis tutorial will walk you through using ros2_medkit to discover and interact with ROS 2 nodes through the REST API gateway. Overviewros2_medkit provides a REST API gateway that exposes your ROS 2 system for external tools, web interfaces, and remote diagnostics. In this tutorial, you will:
Prerequisites
Step 1: Launch the GatewayOpen three terminals. In each, source your workspace: source ~/ros2_medkit/install/setup.bash Terminal 1 - Start the gateway: ros2 launch ros2_medkit_gateway gateway.launch.py You should see: [ros2_medkit_gateway]: Configuration: REST API at 127.0.0.1:8080, backstop refresh interval: 30000ms [ros2_medkit_gateway]: ROS 2 Medkit Gateway ready on HTTP://127.0.0.1:8080 Terminal 2 - Start demo nodes: ros2 launch ros2_medkit_integration_tests demo_nodes.launch.py This launches automotive demo nodes from the integration tests package that we’ll use to explore the API.
Note In runtime-only discovery mode, entity IDs are derived from the namespace path.
Use the Terminal 3 - (Optional) Start fault manager: mkdir -p $HOME/.ros2_medkit ros2 run ros2_medkit_fault_manager fault_manager_node --ros-args -p database_path:=$HOME/.ros2_medkit/faults.db Required if you want to test the Faults API. Note The ✅ Checkpoint At this point you should have:
Step 2: Explore the APIThe gateway exposes all endpoints under Check gateway health: curl http://localhost:8080/api/v1/health
Get gateway capabilities: curl http://localhost:8080/api/v1/
Response shows available endpoints and version info. ✅ Checkpoint Health check should return: If you see connection refused, verify gateway is running. Step 3: Discover Areas and Componentsros2_medkit organizes ROS 2 nodes into a SOVD-aligned entity hierarchy:
Note Discovery Modes
Areas are created from manifest only - they are never auto-generated in
runtime mode. Omit the See Manifest-Based Discovery for details on manifest mode. Important If you are upgrading from a previous version, the entity model has changed significantly. Synthetic Areas and per-namespace Components are no longer created. See Breaking Changes for details and migration guidance. In this tutorial, we use runtime-only mode with List all functions: curl http://localhost:8080/api/v1/functions
With List all components: curl http://localhost:8080/api/v1/components
In runtime mode, you’ll see a single host-level Component. List all areas: curl http://localhost:8080/api/v1/areas
In runtime mode, this returns an empty list. Areas require a manifest definition (see Manifest-Based Discovery). Step 4: Read Sensor DataThe data endpoints let you read topic data from apps. Read all data from an app: curl http://localhost:8080/api/v1/apps/temp_sensor/data
Response structure (showing one topic): { "items": [ { "category": "currentData", "id": "/powertrain/engine/temperature", "name": "/powertrain/engine/temperature", "x-medkit": { "ros2": { "direction": "publish", "topic": "/powertrain/engine/temperature", "type": "sensor_msgs/msg/Temperature" }, "type_info": { "default_value": { "header": {}, "temperature": 0, "variance": 0 }, "schema": { "properties": { "header": {}, "temperature": {"type": "number"}, "variance": {"type": "number"} }, "type": "object" } } } } ], "x-medkit": { "entity_id": "temp_sensor", "total_count": 3 } } Each data item includes:
Read a specific topic: curl http://localhost:8080/api/v1/apps/temp_sensor/data/powertrain%2Fengine%2Ftemperature
Response with live data: { "data": { "header": { "frame_id": "engine", "stamp": {"sec": 1769955040, "nanosec": 286555163} }, "temperature": 93.5, "variance": 0.5 }, "id": "/powertrain/engine/temperature", "x-medkit": { "entity_id": "temp_sensor", "timestamp": 1769955039964403368, "ros2": { "topic": "/powertrain/engine/temperature", "type": "sensor_msgs/msg/Temperature" }, "publisher_count": 1, "subscriber_count": 0, "status": "data" } } Notice:
Note Topic paths use URL encoding: ✅ Checkpoint You should see:
Step 5: Call Services and ActionsThe operations endpoints let you call ROS 2 services and actions. List available operations: curl http://localhost:8080/api/v1/apps/calibration/operations
Call a service (synchronous execution): Services return immediately with status curl -X POST http://localhost:8080/api/v1/apps/calibration/operations/calibrate/executions \ -H "Content-Type: application/json" \ -d '{}' Response (200 OK): { "parameters": { "success": true, "message": "Engine calibrated successfully (count: 1)" } } The Send an action goal (asynchronous execution): Actions return curl -X POST http://localhost:8080/api/v1/apps/long_calibration/operations/long_calibration/executions \ -H "Content-Type: application/json" \ -d '{"parameters": {"order": 5}}' Response (202 Accepted): { "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "status": "running" } Poll action status: curl http://localhost:8080/api/v1/apps/long_calibration/operations/long_calibration/executions/a1b2c3d4-e5f6-7890-abcd-ef1234567890
Cancel a running action: curl -X DELETE http://localhost:8080/api/v1/apps/long_calibration/operations/long_calibration/executions/a1b2c3d4-e5f6-7890-abcd-ef1234567890 Returns Step 6: Manage ParametersThe configurations endpoints expose ROS 2 parameters. List all parameters: curl http://localhost:8080/api/v1/apps/temp_sensor/configurations
Get a specific parameter: curl http://localhost:8080/api/v1/apps/temp_sensor/configurations/publish_rate
Set a parameter value: curl -X PUT http://localhost:8080/api/v1/apps/temp_sensor/configurations/publish_rate \ -H "Content-Type: application/json" \ -d '{"value": 5.0}' Reset to default: curl -X DELETE http://localhost:8080/api/v1/apps/temp_sensor/configurations/publish_rate Step 7: Monitor FaultsNote Requires List all system faults: curl http://localhost:8080/api/v1/faults
List faults for a specific component: curl http://localhost:8080/api/v1/apps/lidar_sensor/faults
Clear a fault: curl -X DELETE http://localhost:8080/api/v1/apps/lidar_sensor/faults/LIDAR_CALIBRATION_REQUIRED ✅ Checkpoint At this point you’ve successfully:
🎉 You’re ready to explore the web UI and advanced features! Using with Web UIA companion web UI is available for visual entity browsing: docker pull ghcr.io/selfpatch/ros2_medkit_web_ui:latest docker run -p 3000:80 ghcr.io/selfpatch/ros2_medkit_web_ui:latest Open http://localhost:3000 and connect to the gateway at http://localhost:8080. See Web UI (ros2_medkit_web_ui) for more details. Using with LLMs (MCP)Connect your LLM to the gateway using ros2_medkit_mcp: Option 1: Docker (recommended) # Pull and run HTTP server on port 8765 docker run -p 8765:8765 \ -e ROS2_MEDKIT_BASE_URL=http://host.docker.internal:8080/api/v1 \ ghcr.io/selfpatch/ros2_medkit_mcp:latest # Or run with stdio transport docker run -i \ -e ROS2_MEDKIT_BASE_URL=http://host.docker.internal:8080/api/v1 \ ghcr.io/selfpatch/ros2_medkit_mcp:latest stdio Option 2: Poetry (for development) git clone https://github.com/selfpatch/ros2_medkit_mcp.git cd ros2_medkit_mcp poetry install poetry run ros2-medkit-mcp-stdio See MCP Server for LLM Integration for Claude Desktop and VS Code integration. Next StepsConfiguration:
Tutorials:
Companion Projects:
Reference:
| ||||||||||||||||||||||||||||||||||||||||
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |