|
|
||
|---|---|---|
| test | ||
| README.md | ||
README.md
Complete Calibration and Detection Procedure
Step 1: Setup Configuration Files
-
Create
arena_config.ymlwith fixed marker positions:markers: - id: 1 position: [0, 0] - id: 2 position: [0, 1] - id: 3 position: [0, 2] -
Create
arena_transformation.ymlwith an initial transformation matrix (example identity matrix):transformation_matrix: !!opencv-matrix rows: 3 cols: 3 dt: d data: [1, 0, 0, 0, 1, 0, 0, 0, 1]
Step 2: Calibrate the Camera
-
Run the
calibration_webcamnode to capture frames and calibrate the camera:rosrun your_package calibration_webcam -
Follow the on-screen instructions to capture at least 10 frames of the chessboard pattern from different angles and positions.
-
The calibration parameters will be saved to
camera_parameters.yml.
Step 3: Calibrate the Arena
-
Run the
arena_calibrationnode to detect ArUco markers and calibrate the arena:rosrun your_package arena_calibration -
The detected marker positions and transformation matrix will be saved to
arena_config.ymlandarena_transformation.ymlrespectively.
Step 4: Run the Main Node
-
Run the
aruco_detectornode to detect ArUco markers and display their positions in the arena:rosrun your_package aruco_detector -
The node will process frames from the camera, detect ArUco markers, and display their positions in the arena frame.
Additional Information
Dependencies
Ensure you have the following dependencies installed:
- ROS
- OpenCV
- yaml-cpp
Building the Package
-
Navigate to your catkin workspace:
cd ~/catkin_ws -
Build the package:
catkin build test -
Source the workspace:
source devel/setup.bash
Running the Nodes
-
Start the ROS master node:
roscore -
In a new terminal, run the desired node as described in the steps above.
Troubleshooting
- If the camera is not detected, ensure it is properly connected and recognized by the system.
- If not enough markers are detected, try adjusting the lighting conditions or the camera position.
- Ensure all configuration files (
camera_parameters.yml,arena_config.yml,arena_transformation.yml) are correctly formatted and located in the appropriate directory.
Example Configuration Files
camera_parameters.yml:
camera_matrix: !!opencv-matrix
rows: 3
cols: 3
dt: d
data: [fx, 0, cx, 0, fy, cy, 0, 0, 1]
distortion_coefficients: !!opencv-matrix
rows: 1
cols: 5
dt: d
data: [k1, k2, p1, p2, k3]
arena_config.yml:
markers:
- id: 1
position: [0, 0]
- id: 2
position: [0, 1]
- id: 3
position: [0, 2]
arena_transformation.yml:
transformation_matrix: !!opencv-matrix
rows: 3
cols: 3
dt: d
data: [1, 0, 0, 0, 1, 0, 0, 0, 1]