Commit 7422bb4
Feature/pnp solver develop (#12)
* feat(solve_pnp): add OpenCV to ROS camera coordinate system conversion
Implement transformation logic to convert camera coordinates from the OpenCV standard (Z forward, X right, Y down) to the ROS standard (X forward, Y left, Z up).
- The PnP solver output (relative pose) is now consistently converted and reported in the ROS camera frame.
- Add unit tests for the coordinate transformation function.
- Integrate simulated dynamic transforms to test and verify the robustness of the coordinate frame transformations during runtime.
* feat(aim): implement inter-system communication and PnP pipeline visualization
Successfully established communication link between the control system and the aiming module. This enables data exchange for target tracking and control.
The full PnP (Perspective-n-Point) solving pipeline has been integrated and is running. The resulting pose (translation and rotation) is now visualized in the debugging interface to assist in development.
Note: The output coordinate frame for the PnP solution is currently uncalibrated and requires further refinement/tuning to align with the world coordinate system.
* feat(capturer): implement local video stream acquisition
Successfully implemented the functionality to acquire and process video streams from local storage or device.
* fix(video, pnp): resolve LocalVideo bug and correct PnP point ordering
- Corrected a critical bug in the `LocalVideo` module .
- Fixed an issue in the `SolvePnp` function where the ordering of 2D image points and their corresponding 3D object points was mismatched, leading to incorrect pose estimation results.
The PnP output is now using the correct point correspondence. Further dedicated unit tests for the `SolvePnp` function need to be added in the next step to ensure robustness.
* test(pnp): SolvePnp verified and accuracy meets specification
The PnP (Perspective-n-Point) solver has passed comprehensive unit testing for various target poses and input data sets.
The measured positional and rotational errors are consistently maintained within the required 5% tolerance, confirming the numerical stability and accuracy of the current PnP implementation.
* docs(utility): update documentation for utility functions
* fix(deps, pnp): resolve cv2eigen dependency and correct identifier point ordering
- Corrected the dependency issue related to conversion functions, ensuring seamless data exchange between OpenCV and Eigen types.
- Rectified the misplacement/misordering issue with the four identifier points used in the pose estimation pipeline. This ensures that the 2D image points and their corresponding 3D object points are correctly matched.
Note: The core PnP (Perspective-n-Point) pose estimation accuracy issue is still under investigation and has not yet been resolved in this commit.
* fix(coords, pnp): correct coordinate system transformation error
Resolved the critical issue in coordinate system transformation logic that was causing inaccuracies in pose estimation.
The fix ensures the proper conversion between the OpenCV and ROS camera coordinate definitions, resulting in a correct and stable output from the PnP (Perspective-n-Point) solver. The PnP pipeline is now fully operational and yielding expected results.
* refactor(pnp): decouple PnP solver implementation and visualization
The PnP (Perspective-n-Point) solver implementation has been separated from its visualization logic.
- The `solve_pnp` module now strictly focuses on calculating the 3D pose (rotation and translation) and returns the numerical result.
- All drawing, rendering, and coordinate frame visualization code has been moved to a dedicated `visualization` or `debug` module.
* test(pnp): add test file with real-world data and establish performance baseline
Implemented a dedicated test file utilizing actual captured data to validate the PnP (Perspective-n-Point) solver's output.
The current performance baseline using this real-world data is recorded as:
- **Distance Error (within 3m):** 8%
- **Angular Error:** 15%
* Update utils
* Update doc and fix init bug of shared memory util
* Update doc
* feat(solve_pnp): add OpenCV to ROS camera coordinate system conversion
Implement transformation logic to convert camera coordinates from the OpenCV standard (Z forward, X right, Y down) to the ROS standard (X forward, Y left, Z up).
- The PnP solver output (relative pose) is now consistently converted and reported in the ROS camera frame.
- Add unit tests for the coordinate transformation function.
- Integrate simulated dynamic transforms to test and verify the robustness of the coordinate frame transformations during runtime.
* feat(aim): implement inter-system communication and PnP pipeline visualization
Successfully established communication link between the control system and the aiming module. This enables data exchange for target tracking and control.
The full PnP (Perspective-n-Point) solving pipeline has been integrated and is running. The resulting pose (translation and rotation) is now visualized in the debugging interface to assist in development.
Note: The output coordinate frame for the PnP solution is currently uncalibrated and requires further refinement/tuning to align with the world coordinate system.
* feat(capturer): implement local video stream acquisition
Successfully implemented the functionality to acquire and process video streams from local storage or device.
* fix(video, pnp): resolve LocalVideo bug and correct PnP point ordering
- Corrected a critical bug in the `LocalVideo` module .
- Fixed an issue in the `SolvePnp` function where the ordering of 2D image points and their corresponding 3D object points was mismatched, leading to incorrect pose estimation results.
The PnP output is now using the correct point correspondence. Further dedicated unit tests for the `SolvePnp` function need to be added in the next step to ensure robustness.
* refactor(pnp): decouple PnP solver implementation and visualization
The PnP (Perspective-n-Point) solver implementation has been separated from its visualization logic.
- The `solve_pnp` module now strictly focuses on calculating the 3D pose (rotation and translation) and returns the numerical result.
- All drawing, rendering, and coordinate frame visualization code has been moved to a dedicated `visualization` or `debug` module.
* test(pnp): add test file with real-world data and establish performance baseline
Implemented a dedicated test file utilizing actual captured data to validate the PnP (Perspective-n-Point) solver's output.
The current performance baseline using this real-world data is recorded as:
- **Distance Error (within 3m):** 8%
- **Angular Error:** 15%
* chore(deps): synchronize with upstream main branch
Pulled latest changes from the main branch to ensure the current feature branch is up-to-date with recent bug fixes and dependencies updates.
* Update doc/utility.md
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
* Update src/kernel/visualization.cpp
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
* fix(pose): remove redundant visual_armors variable
* fix(video): modify LocalVideo function signatures for interface compatibility
* Update src/module/debug/visualization/armor_visualizer.cpp
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
* fix(visual):reuse publisher creation function and remove redundancy
* chore(deps): synchronize with upstream main branch
* chore(cmake): remove redundant module from test/CMakeLists.txt
* feat(pnp): implement failure handling logic for PnP solver
* chore(tooling): add resource download script for testing assets
* feat(test): implement YAML configuration for test resources and integrate into CI
Implemented a robust configuration system using YAML files to specify all necessary test resources.
- **Resource Configuration:** Resources for testing `model_infer` and `solve_pnp` are now loaded dynamically from a centralized YAML configuration file.
- **Test Adaptation:** Adapted `model_infer` and `solve_pnp` tests to consume resources based on the new configuration.
- **CI Integration:** The new configuration-driven tests have been integrated into the automated testing pipeline (CI/CD process).
- **Environment Support:** The configuration supports loading environment variables for sensitive paths or using pre-defined default values, enhancing deployment flexibility.
* chore(ci): supply missing dependencies in CI/CD pipeline
* fix(visual_armor,test,utility): minor fixes and general cleanup
* fix(pnp): correct 4-point order and decouple PnP failure handling & visualization
* refactor(visualization): remove redundant visualization variables
* fix(test): correct visualization test by assigning unique armor IDs
* refactor(cleanup): extensive cleanup of documentation, interfaces, and build configs
Performed an extensive refactoring pass across the repository to improve code hygiene, interface consistency, and dependency management:
1. **Documentation Cleanup:** Removed the redundant documentation file `doc/utility.md` and updated related comments referencing its content.
2. **Interface Simplification:** Simplified the interface of the PnP solver (`solve_pnp`) by streamlining its method signatures and inputs.
3. **Code Consistency:** Unified constructor signatures across related classes for improved consistency and ease of use.
4. **Dependency Fix:** Corrected instances of superfluous dependency leakage, ensuring modules only link required libraries.
5. **Build Config Correction:** Extracted incorrectly merged/included content from `test/CMakeLists.txt` that did not belong to the test configuration.
* feat(test): introduce AssetsManager and update resource URLs
* fix(pnp): add error handling for solver failures and resolve minor issues
* Update test/assets_manager.hpp
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
* Cleanup code
* Cleanup script
---------
Co-authored-by: heyeuu
Co-authored-by: creeper5820
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>1 parent 8687c42 commit 7422bb4
39 files changed
Lines changed: 1262 additions & 570 deletions
File tree
- .github/workflows
- config
- src
- kernel
- module
- capturer
- debug/visualization
- identifier
- utility
- math
- solve_pnp
- model
- rclcpp
- visual
- robot
- tf
- test
- tool
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
| 19 | + | |
21 | 20 | | |
22 | 21 | | |
23 | 22 | | |
| |||
26 | 25 | | |
27 | 26 | | |
28 | 27 | | |
29 | | - | |
| 28 | + | |
30 | 29 | | |
31 | | - | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
32 | 38 | | |
33 | 39 | | |
34 | 40 | | |
| |||
49 | 55 | | |
50 | 56 | | |
51 | 57 | | |
52 | | - | |
| 58 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
250 | 250 | | |
251 | 251 | | |
252 | 252 | | |
253 | | - | |
| 253 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
25 | 29 | | |
| 30 | + | |
| 31 | + | |
26 | 32 | | |
27 | 33 | | |
28 | 34 | | |
| |||
41 | 47 | | |
42 | 48 | | |
43 | 49 | | |
44 | | - | |
45 | | - | |
| 50 | + | |
| 51 | + | |
46 | 52 | | |
47 | 53 | | |
48 | 54 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
21 | | - | |
| 22 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
24 | 39 | | |
25 | 40 | | |
26 | 41 | | |
| |||
33 | 48 | | |
34 | 49 | | |
35 | 50 | | |
| 51 | + | |
| 52 | + | |
36 | 53 | | |
37 | 54 | | |
38 | 55 | | |
| |||
46 | 63 | | |
47 | 64 | | |
48 | 65 | | |
| 66 | + | |
49 | 67 | | |
50 | 68 | | |
51 | 69 | | |
| |||
67 | 85 | | |
68 | 86 | | |
69 | 87 | | |
70 | | - | |
71 | | - | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
72 | 91 | | |
73 | 92 | | |
74 | 93 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | | - | |
| 5 | + | |
| 6 | + | |
5 | 7 | | |
6 | 8 | | |
7 | 9 | | |
| |||
16 | 18 | | |
17 | 19 | | |
18 | 20 | | |
19 | | - | |
20 | 21 | | |
21 | | - | |
22 | | - | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
23 | 26 | | |
24 | | - | |
25 | 27 | | |
| 28 | + | |
26 | 29 | | |
| 30 | + | |
27 | 31 | | |
28 | 32 | | |
29 | 33 | | |
30 | | - | |
31 | | - | |
32 | 34 | | |
33 | 35 | | |
34 | 36 | | |
35 | 37 | | |
36 | 38 | | |
37 | | - | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| |||
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
46 | 53 | | |
47 | 54 | | |
48 | 55 | | |
49 | 56 | | |
50 | 57 | | |
51 | 58 | | |
52 | | - | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
53 | 100 | | |
54 | 101 | | |
55 | 102 | | |
56 | 103 | | |
57 | 104 | | |
58 | 105 | | |
59 | 106 | | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
60 | 112 | | |
61 | 113 | | |
62 | 114 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
| 5 | + | |
| 6 | + | |
4 | 7 | | |
5 | 8 | | |
6 | 9 | | |
| |||
10 | 13 | | |
11 | 14 | | |
12 | 15 | | |
| 16 | + | |
| 17 | + | |
13 | 18 | | |
14 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
15 | 24 | | |
16 | 25 | | |
17 | 26 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
4 | 7 | | |
5 | 8 | | |
6 | 9 | | |
7 | 10 | | |
8 | | - | |
9 | | - | |
10 | 11 | | |
| 12 | + | |
11 | 13 | | |
12 | 14 | | |
13 | 15 | | |
| |||
47 | 49 | | |
48 | 50 | | |
49 | 51 | | |
50 | | - | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
51 | 58 | | |
52 | | - | |
| 59 | + | |
53 | 60 | | |
54 | 61 | | |
55 | 62 | | |
| |||
67 | 74 | | |
68 | 75 | | |
69 | 76 | | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
70 | 80 | | |
71 | 81 | | |
72 | 82 | | |
| |||
114 | 124 | | |
115 | 125 | | |
116 | 126 | | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
117 | 131 | | |
118 | 132 | | |
119 | | - | |
| 133 | + | |
120 | 134 | | |
121 | | - | |
| 135 | + | |
122 | 136 | | |
123 | 137 | | |
124 | 138 | | |
| |||
127 | 141 | | |
128 | 142 | | |
129 | 143 | | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
130 | 148 | | |
131 | 149 | | |
132 | 150 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
3 | 5 | | |
4 | 6 | | |
5 | 7 | | |
| |||
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
20 | | - | |
| 22 | + | |
| 23 | + | |
21 | 24 | | |
22 | 25 | | |
23 | 26 | | |
24 | 27 | | |
| 28 | + | |
| 29 | + | |
25 | 30 | | |
26 | 31 | | |
27 | 32 | | |
0 commit comments