smart_gui is a ROS 2 (ament_python) package focused on monitoring and testing ROS systems through a web interface. It combines a FastAPI backend and a Flutter frontend to inspect the ROS graph, stream live topic data, call services, and publish messages (including backend-managed loop publishing) without requiring custom debug scripts.
- Graph inspection:
GET /topicsGET /nodesGET /services
- Service tooling:
GET /service-schemaPOST /service-call
- Topic tooling:
- Create a publisher for a topic/type.
- Publish one message.
- Start/stop backend publish loops (no per-message HTTP traffic from frontend).
- Live topic monitor via WebSocket:
WS /ws/topics/{topic}
- Special handling for
sensor_msgs/msg/Image:- Backend JPEG compression to reduce payload size.
smart_gui/ros2_inspector_api.py: main ROS2 + FastAPI backend node.frontend/: Flutter web application.launch/smart_gui_api.launch.py: launch backend and optional frontend process.smart_gui/random_int8_topics_node.py: test node that publishes randomstd_msgs/msg/Int8on random topics.
- ROS 2 Jazzy (or compatible environment with
rclpy). colcon.- Python 3.
- Flutter (only if you want to run the web frontend with
flutter run).
From your ROS 2 workspace root:
cd ~/colcon_ws
source /opt/ros/jazzy/setup.bash
colcon build --packages-select smart_gui --symlink-install
source install/setup.bashros2 launch smart_gui smart_gui_api.launch.py \
frontend_command:='NO_PROXY=localhost,127.0.0.1 no_proxy=localhost,127.0.0.1 flutter run -d web-server --web-hostname 0.0.0.0 --web-port 3000 --profile'Open:
- Local machine:
http://localhost:3000 - Another device in LAN:
http://<YOUR_MACHINE_IP>:3000
ros2 launch smart_gui smart_gui_api.launch.py run_frontend:=falseros2 run smart_gui smart_gui_api --host 0.0.0.0 --port 8000GET /healthGET /topicsGET /nodesGET /services
GET /topic-message-typesGET /topic-message-template?message_type=<pkg/msg/Type>
POST /topic-publisherPOST /topic-publishPOST /topic-publish-loop/startPOST /topic-publish-loop/stop
GET /service-schema?name=<service>&service_type=<pkg/srv/Type>POST /service-call
WS /ws/topics/{topic}
Loop publishing is handled by the backend (thread per topic/type loop), so the frontend does not send one HTTP request per message.
Example:
curl -X POST http://127.0.0.1:8000/topic-publish-loop/start \
-H 'Content-Type: application/json' \
-d '{
"name": "/demo_int",
"message_type": "std_msgs/msg/Int32",
"message": {"data": 10},
"frequency_hz": 5.0
}'Stop loop:
curl -X POST http://127.0.0.1:8000/topic-publish-loop/stop \
-H 'Content-Type: application/json' \
-d '{
"name": "/demo_int",
"message_type": "std_msgs/msg/Int32"
}'Run a helper node that creates random topic names and publishes random Int8 values:
ros2 run smart_gui random_int8_topicsOptional arguments:
ros2 run smart_gui random_int8_topics --topic-count 5 --hz 5.0- The backend usually runs on port
8000, frontend on3000. - If running inside WSL2, make sure Windows forwards ports (3000/8000) to WSL and firewall rules allow inbound connections.
- Access from phone should use Windows LAN IP, not WSL internal IP.
- Backend health check:
curl http://127.0.0.1:8000/health- Confirm loop endpoints are available:
curl -s http://127.0.0.1:8000/openapi.json | rg 'topic-publish-loop/start|topic-publish-loop/stop'- If frontend looks stale on mobile browser, force refresh or open in private/incognito window.