Commit Graph

34 Commits

Author SHA1 Message Date
SkyLiCoder ebe3c54818 docs: 完善 README.md,补充视觉处理流水线和标定流程说明 2026-06-07 21:01:28 +08:00
dev01 b7591f7b31 fix: modify calibration parameters 2026-06-07 20:08:18 +08:00
dev01 5ebeb6dd6f fix: scope log level per-node to avoid rcl/rmw debug spam 2026-06-07 14:46:30 +08:00
dev01 1d838aa684 docs: add log_level parameter usage to 使用指南 2026-06-07 14:45:46 +08:00
dev01 dacaeffef3 fix: change default log level from debug to info 2026-06-07 14:43:41 +08:00
dev01 a9dd1d4495 feat: make log level a launch parameter (default: debug) 2026-06-07 14:42:57 +08:00
dev01 0d40e0fabf docs: 文档整理,与前端对接文档.md 替换为 API.md + front-end_ROS.md
- 新增 docs/API.md(HTTP API 数据格式)
- 新增 docs/front-end_ROS.md(前端 ROS 话题格式)
- 新增 docs/底盘通信协议指南.md(底盘串口协议)
- 删除 docs/与前端对接文档.md
- 云台通信协议指南补充 0xA9 前馈帧说明
- 修正 README API 路径及 ROS 话题引用
- .gitignore 添加 workspace/data/
2026-06-07 13:54:07 +08:00
dev01 74c470a8fa fix: restrict PID config serial output to debug mode, default to debug
- gimbal_node: skip 0xA8 frame send when not in debug mode
- chassis_node: skip 0xA8 frame send when not in debug mode
- chassis_node: change default mode from auto to debug
2026-06-07 13:45:15 +08:00
dev01 3f956d5f29 docs: update usage guide for chassis_node, laser topic, and field names
- Add chassis_node to pipeline table and startup instructions
- Fix laser topic from /gimbal/mode to /laser/command
- Add chassis mode switch and PID tuning sections
- Fix gimbal PID field names to match API.md (visual_*/angle_*)
- Fix gimbal baud rate to 921600 in troubleshooting
2026-06-07 13:37:37 +08:00
dev01 415a00cfbe feat: add chassis_node to launch pipeline
Launch chassis_node with /dev/ttyCH341USB0 at 115200 baud.
2026-06-07 13:34:24 +08:00
dev01 00ba38ce11 feat: add /chassis/feedforward subscription to gimbal_node
Receives angle_velocity from chassis_node and sends 0xA9 feedforward
frame to gimbal MCU for yaw motor feedforward control.
2026-06-07 13:34:06 +08:00
dev01 e027c58f67 feat: add chassis_control_pkg with serial communication node
ChassisNode communicates via /dev/ttyCH341USB0 at 115200 bps:
- Send 0xA7 command frames (auto/manual/debug mode switching)
- Send 0xA6 manual control frames (motor_speed_base + angle_velocity)
- Send 0xA8 debug tuning frames (speed/yaw/position PID params)
- Receive 0xA9 feedforward frames from chassis MCU
- Subscribe: /cmd_chassis, /chassis/mode, /web/chassis_pid_config
- Publish: /chassis/feedforward (angle_velocity for gimbal feedforward)
2026-06-07 13:33:14 +08:00
dev01 30565c87cc fix: persist gimbal PID config on POST, separate laser to /laser/command topic, add chassis HTTP API endpoints
- web_node: call _save_gimbal_pid_config() after POST /api/gimbal/pidconfig
- web_node: publish laser commands to /laser/command (was /gimbal/mode)
- web_node: add POST /api/chassis/mode/switch, GET/POST /api/chassis/pidconfig
- web_node: add chassis PID config file management (data/chassis_pid_config.json)
- gimbal_node: subscribe to /laser/command separately from /gimbal/mode
2026-06-07 13:30:57 +08:00
dev01 5752e76576 feat: update laser calibration parameters
- Update laser direction and origin from recalibration
- Set DETECT_INTERVAL=1 for per-frame detection in both calibrate scripts
2026-06-04 20:03:35 +08:00
dev01 04f9529c99 perf: optimize rectangle detection algorithm
- Check only first child contour instead of iterating all siblings
- Add area threshold check on inner contour
- Require inner contour to be rectangular with no deeper nesting
2026-06-04 18:16:05 +08:00
dev01 bb92f905ce feat: add /vision/debug_image topic, inner-rect filter, and NaN guards
- Publish binary+contour debug image to /vision/debug_image
- Require nested rectangular contour with no deeper children
- Add NaN guards after solvePnP and projectPoints to prevent crashes
2026-06-04 17:43:35 +08:00
dev01 c856f91470 fix: change pid_config.json default path to data/ directory 2026-06-04 15:48:50 +08:00
dev01 b5af8d494a feat: add PID config persistence with file storage and HTTP API
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-04 13:41:23 +08:00
dev01 64c93d992d refactor: replace http.server with Microdot framework in web_node
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-04 13:30:50 +08:00
dev01 df02657f1d feat: add PnP pose estimation, laser world coordinate solving, and new 0xA5 protocol
- Replace hardcoded arrays with JSON string format for calibration and laser
  parameters, matching scripts/calibrate/laser_pnp.py
- Apply IMAGE_SCALE to resize factor instead of hardcoded 0.5
- Add rectangle corner ordering (TL/BL/BR/TR) and PnP solving with SOLVEPNP_IPPE
- Compute laser world coordinates on Z=0 plane, normalize by RECT_L/RECT_W
  as measurement values; reference values set to rectangle center (0.5, 0.5)
- Publish Float32MultiArray [measure_x, ref_x, measure_y, ref_y] on /vision/target
- Remove /vision/binary_image publisher
- Add ENABLE_CUDA toggle and CUDA detection log with pipeline breakdown
2026-06-04 11:33:13 +08:00
dev01 fd3d6b7ab5 feat: add PnP laser solving and update 0xA5 frame to 4-float protocol
- Integrate PnP rectangle pose estimation + laser world coordinate computation from scripts/calibrate/laser_pnp.py
- Publish normalized measurement (laser/RECT) and reference (rect center) via Float32MultiArray
- Update gimbal 0xA5 frame to 18-byte format: measure_x, ref_x, measure_y, ref_y
- Add camera calibration, laser line params, and RECT_L/W constants
- Add corner ordering (TL/BL/BR/TR), SOLVEPNP_IPPE, and pose/laser visualization overlay
- Remove standalone vision_example.py (superseded by ROS2 nodes)
- Add scripts/calibrate/ with calibration and PnP tools
2026-06-03 22:38:51 +08:00
dev01 0340d40b84 fix: gate gimbal callbacks by current mode
Add _current_mode state to prevent manual commands during auto
tracking and vice versa. Remove unused auto_tracking_enabled param.
2026-06-03 22:08:14 +08:00
dev01 e8c6957772 feat: add CUDA GPU acceleration to vision_node preprocessing
Move resize, BGR2GRAY, and GaussianBlur to GPU via cv2.cuda, with
graceful CPU fallback when CUDA is unavailable.
2026-06-03 22:08:08 +08:00
dev01 64da9fd848 fix: suppress shutdown errors and align rosbridge params with Jazzy defaults
- Wrap rclpy.shutdown() in try/except across all nodes to avoid
  "rcl_shutdown already called" errors when launched via ros2 launch.
- Replace web_node's server.shutdown() with server_close() to prevent
  the HTTP server from hanging on SIGINT (shutdown() waits on an event
  only set by serve_forever, which the timer-based approach doesn't use).
- Set rosbridge_websocket default_call_service_timeout=5.0,
  call_services_in_new_thread=True, send_action_goals_in_new_thread=True
  to match upcoming Jazzy defaults and silence startup warnings.
2026-06-02 21:23:52 +08:00
dev01 d81558d1be docs: update gimbal protocol and frontend integration specs 2026-06-02 19:54:56 +08:00
dev01 a2acd62e9d fix: align gimbal protocol and API responses with updated docs
- 0xA6 frame: remove zero_force byte, use angular velocity directly (10 bytes)
- PID keys: vision_* -> visual_*, motor_* -> angle_*
- HTTP API responses: use {"code": 0, "message": "ok"} format
2026-06-02 18:07:57 +08:00
dev01 ede16af126 refactor: make port configurable for web_node and explicit in launch 2026-06-02 12:42:14 +08:00
dev01 5159929c01 feat: add rosbridge_websocket and web_video_server to launch file 2026-06-01 22:07:13 +08:00
dev01 3d91a2908a fix: update serial baud rate to 921600 in launch file 2026-06-01 22:01:59 +08:00
dev01 c4bdcd3dda refactor: remove HTTP image preview from web_node, keep API only 2026-06-01 21:11:55 +08:00
dev01 bb8724035f feat: separate laser API endpoint (POST /api/laser) 2026-06-01 20:50:54 +08:00
dev01 a281fd115e docs: add usage guide and README with architecture overview 2026-05-31 22:25:00 +08:00
dev01 19d5e432a4 fix: change serial port from /dev/ttyTHS0 to /dev/ttyTHS1 2026-05-31 22:13:49 +08:00
dev01 d506e01188 feat: initial ROS2 vision pipeline with gimbal control and nginx config
- camera_node (driver_pkg): Hikrobot MvCamera SDK image capture
- vision_node (algorithm_pkg): Otsu threshold + contour detection + target tracking
- web_node (application_pkg): HTTP server with MJPEG preview and mode switch API
- gimbal_node (gimbal_control_pkg): UART serial communication per gimbal protocol
- bringup_pkg: launch file for full pipeline
- config: nginx reverse-proxy for MJPEG streaming and API routing
2026-05-31 22:10:12 +08:00