Repository navigation
Add a doctor view camera feed with delay monitoring - #36
Conversation
Reviewed in #24, which was merged into its stacked base after #23 had already been squash-merged into main, so it never reached main. This is the same change, applied to main. Drive the five joints with an Xbox controller through placeholder MKS SERVO42D/57D CAN drives, simulated until the real drives are connected. On Windows, a Python-only XInput bridge sends the controller state to the new wslg-teleop Compose service over UDP. The RViz camera follows the tool so the end of the arm stays in view; follow_camera:=false keeps a fixed view. teleop and joy_source use And/Or/Equals substitutions, so teleop:=True works like IfCondition. The new nodes receive use_sim_time, and the UDP receiver reads at most 100 packets per poll so a flood cannot starve its other callbacks.
A USB webcam stands in for the doctor's camera. camera_bridge captures it with OpenCV on the computer it is plugged into, which works on Windows as well, where Docker can't reach USB. It sends JPEG frames stamped with their capture time over TCP. In the ground station, camera_receiver publishes them still compressed on /doctor_view/left/image_raw/compressed with camera_info, following Gianna's proposed topic names. latency_monitor reports the frame rate and the capture-to-arrival delay (mean, min, max, jitter) as camera.doctor_view, and can log every frame to CSV. latency_monitor works for any image topic, so it can measure the chosen camera's driver too. camera:=true starts both from the ground station launch, the panel then uses live diagnostics, and RViz has a Doctor View image display that is off by default.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 27 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The RViz transport configuration prevents display of the feed, and stream URL handling can stall or distort latency.
Review effort: Balanced
Findings: 2
Open (2)
What changed in this PR
Adds a doctor-view camera pipeline with ROS publishing, latency diagnostics, RViz integration, and setup documentation.
Changes:
- Adds TCP camera bridge, receiver, and latency monitoring.
- Integrates camera launch and diagnostics into the ground station.
- Adds tests and Windows/Linux usage guidance.
| File | Description |
|---|---|
BuildInstructions.md |
Documents camera setup and latency measurement. |
waybionic_bringup/launch/ground_station.launch.py |
Adds camera launch controls. |
waybionic_bringup/package.xml |
Adds camera package dependency. |
waybionic_bringup/rviz/waybionic_unified.rviz |
Adds Doctor View display. |
waybionic_camera/launch/camera.launch.py |
Launches receiver and monitor. |
waybionic_camera/package.xml |
Defines ROS dependencies. |
waybionic_camera/resource/waybionic_camera |
Registers the package. |
waybionic_camera/setup.cfg |
Configures script installation. |
waybionic_camera/setup.py |
Defines package metadata and executables. |
waybionic_camera/test/test_camera_nodes.py |
Tests end-to-end ROS behavior. |
waybionic_camera/test/test_flake8.py |
Adds style checks. |
waybionic_camera/test/test_frames.py |
Tests frame protocol handling. |
waybionic_camera/test/test_latency.py |
Tests latency statistics. |
waybionic_camera/test/test_pep257.py |
Adds docstring checks. |
waybionic_camera/waybionic_camera/__init__.py |
Initializes the Python package. |
waybionic_camera/waybionic_camera/camera_bridge.py |
Captures and streams camera frames. |
waybionic_camera/waybionic_camera/camera_receiver.py |
Publishes received frames to ROS. |
waybionic_camera/waybionic_camera/frames.py |
Implements TCP frame encoding. |
waybionic_camera/waybionic_camera/latency.py |
Calculates sliding-window statistics. |
waybionic_camera/waybionic_camera/latency_monitor.py |
Publishes diagnostics and CSV logs. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
A camera, or a stream URL, that stops sending frames now ends the bridge with an error instead of retrying a seek forever. Only a local video file is rewound and paced at --fps.

Covers item 9 from the Oct 3 list: a camera feed in the ground station with measured delay, ready for whatever camera Gianna's research (#33) settles on. A USB webcam stands in for the doctor's camera until then. Stacked on #28, because RViz's Doctor View display goes after #28's teleop display.
What changes
waybionic_camera:camera_bridge: plain Python plus OpenCV, run on the computer the camera is plugged into. It captures with MJPG at 1080p30 by default, stamps each frame with its capture time, and sends JPEG frames over TCP (port 47310). This also covers Windows, where Docker can't reach USB cameras. A video file or stream URL can stand in for a camera.camera_receiver: publishes the frames still compressed on/doctor_view/left/image_raw/compressed, with/doctor_view/left/camera_info. Frames carry their capture stamp anddoctor_view_left_optical_frame, following Camera and Controller Research/Recommendation #33's topic and frame names.latency_monitor: reportscamera.doctor_viewon/diagnosticswith the frame rate and the capture-to-arrival delay (mean, min, max, jitter) over 5 s. It warns below 25 fps or above 100 ms. Withlog_csv, it logs every frame (number, capture time, arrival time, delay, size), the fields Camera and Controller Research/Recommendation #33 lists for the benchtop test. It takes any image topic, compressed or raw, so it can measure the chosen camera's ROS driver later.camera:=trueincludes the camera launch. Related arguments:camera_bind, which must be0.0.0.0in Docker, andcamera_log.compressed_image_transportis now a dependency.How I tested it
CompressedImagemessages and acamera.doctor_viewreport.30.0 fps, delay 2 ms (min 2, max 5, jitter 0.3) at 1280x720.ros2 topic hz: 29.99 Hz.docker compose --progress plain build test: all 329 tests pass.The reported delay covers bridge to ROS. Time spent inside the camera and on the display needs the stopwatch method in the docs.