How tongjisuperpower/sp_vision_25 works
This repository is a C++ robot-vision application for automatic aiming, rune targeting, and related perception. Its primary loop acquires camera frames and timestamp-aligned gimbal orientation, detects armor, estimates target motion, plans an aim trajectory, decides when to fire, and sends commands to the controller. The README also documents calibration, omnidirectional perception, and optional ROS navigation communication. The sampled application confirms camera, IMU, detection, command, and ROS interactions; some internal stage links follow the documented workflow because their call sites were not sampled.
Main entry points: sentry_debug.cpp Sentry Debug Loop · yolo.cpp Armor Detection · cboard.cpp Controller and IMU · camera.cpp Camera Capture
Components 23
Robot Applications
- Sentry Debug Loop
src/sentry_debug.cpp - Standard Loops
src/standard.cpp
Hardware and Messaging
- Camera Capture
io/camera.cpp - Controller and IMU
io/cboard.cpp - Gimbal Serial
io/gimbal/gimbal.cpp - ROS Navigation
io/ros2/ros2.cpp
Auto Aim
- Armor Detection
tasks/auto_aim/yolo.cpp - Detection Methods
tasks/auto_aim/detector.cpp - Pose and Transforms
tasks/auto_aim/solver.cpp - Target Tracking
tasks/auto_aim/tracker.cpp - Target State
tasks/auto_aim/target.cpp - Trajectory Planner
tasks/auto_aim/planner/planner.cpp - Aim Decision
tasks/auto_aim/aimer.cpp - Fire Decision
tasks/auto_aim/shooter.cpp
Other Tasks
- Rune Targeting
tasks/auto_buff/buff_detector.cpp - Rune Prediction
tasks/auto_buff/buff_aimer.cpp - Omni Perception
tasks/omniperception/decider.cpp
Calibration and Tools
- Camera Calibration
calibration/calibrate_robotworld_handeye.cpp - Shared Math and Filters
tools/math_tools.cpp
Other components
- Robot Controller
- Enemy Targets
- Gimbal and Shooter
- Navigation System
Connections 28
- Robot Controller → Sentry Debug Loop: selects mode
- Sentry Debug Loop → Camera Capture: reads frames
- Sentry Debug Loop → Controller and IMU: reads IMU
- Sentry Debug Loop → Armor Detection: detects armor
- Armor Detection → Detection Methods: runs detection
- Sentry Debug Loop → Pose and Transforms: sets orientation
- Sentry Debug Loop → Omni Perception: updates perception
- Sentry Debug Loop → Controller and IMU: sends command
- Sentry Debug Loop → ROS Navigation: publishes target
- ROS Navigation → Navigation System: exchanges status
- Standard Loops → Camera Capture: reads frames
- Standard Loops → Controller and IMU: reads and commands
- Standard Loops → Armor Detection: detects armor
- Armor Detection → Pose and Transforms: provides detections
- Pose and Transforms → Target Tracking: estimates targets
- Target Tracking → Target State: updates state
- Target State → Trajectory Planner: supplies motion state
- Trajectory Planner → Aim Decision: plans trajectory
- Aim Decision → Fire Decision: provides aim
- Fire Decision → Controller and IMU: forms fire command
- Rune Targeting → Rune Prediction: provides rune detection
- Omni Perception → Armor Detection: requests detections
- Camera Calibration → Camera Capture: calibrates geometry
- Target Tracking → Shared Math and Filters: uses filters and math
- Rune Prediction → Shared Math and Filters: uses math utilities
- Controller and IMU → Gimbal and Shooter: transmits commands
- Camera Capture → Enemy Targets: captures images
- Gimbal Serial → Gimbal and Shooter: communicates state