53 lines
1.5 KiB
Markdown
53 lines
1.5 KiB
Markdown
## Complete Calibration and Detection Procedure
|
|
|
|
### Step 1: Setup Configuration Files
|
|
|
|
1. Create `arena_config.yml` with fixed marker positions:
|
|
```yaml
|
|
markers:
|
|
- id: 1
|
|
position: [0, 0]
|
|
- id: 2
|
|
position: [0, 1]
|
|
- id: 3
|
|
position: [0, 2]
|
|
```
|
|
|
|
2. Create `arena_transformation.yml` with an initial transformation matrix (example identity matrix):
|
|
```yaml
|
|
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
|
|
|
|
1. Run the `calibration_webcam` node to capture frames and calibrate the camera:
|
|
```bash
|
|
rosrun your_package calibration_webcam
|
|
```
|
|
|
|
2. Follow the on-screen instructions to capture at least 10 frames of the chessboard pattern from different angles and positions.
|
|
|
|
3. The calibration parameters will be saved to `camera_parameters.yml`.
|
|
|
|
### Step 3: Calibrate the Arena
|
|
|
|
1. Run the `arena_calibration` node to detect ArUco markers and calibrate the arena:
|
|
```bash
|
|
rosrun your_package arena_calibration
|
|
```
|
|
|
|
2. The detected marker positions and transformation matrix will be saved to `arena_config.yml` and `arena_transformation.yml` respectively.
|
|
|
|
### Step 4: Run the Main Node
|
|
|
|
1. Run the `aruco_detector` node to detect ArUco markers and display their positions in the arena:
|
|
```bash
|
|
rosrun your_package aruco_detector
|
|
```
|
|
|
|
2. The node will process frames from the camera, detect ArUco markers, and display their positions in the arena frame.
|