# Configuration

## Modify Configuration Files

To make sure the system works well, you need to configure the settings of `magiclaw` on the control box. Several configuration files under the `configs/` directory need to be modified , including:

```
configs/
├── camera/
│   ├── maixcam-xxxx.yaml
│   └── ...
├── claw/
│   ├── claw_0.yaml
│   └── claw_1.yaml
├── phone/
│   ├── phone_0.yaml
│   └── phone_1.yaml
├── bilateral.yaml
├── magiclaw_0.yaml
└── magiclaw_1.yaml
```

&#x20;You can follow the example files under the `configs_example/` directory to modify your configuration.

## Camera Configuration

The configuration files of cameras are under `configs/camera/`, and mainly contain the host address, the size of image, the intrinsic parameters, the size of marker, etc.

```yaml
mode: web
host: "xx.xx.xx.xx"
width: 320
height: 240
dist:
  - - -0.176026
    - 0.138516
    - 0.000000
    - 0.000000
    - -0.156883
mtx:
  - - 183.481081
    - 0.000000
    - 150.391482
  - - 0.000000
    - 183.275631
    - 126.520417
  - - 0.000000
    - 0.000000
    - 1.000000
marker_size: 0.009
filter_on: True
filter_frame: 5
marker2global_tvec:
  - - 0.0
    - 0.0
    - -25.0
marker2global_rmat:
  - - - 1.0
      - 0.0
      - 0.0
    - - 0.0
      - -1.0
      - 0.0
    - - 0.0
      - 0.0
      - -1.0
```

* Host address:&#x20;
* Size of image:
* Intrinsic parameters:
* Size of marker:

## Claw Configuration

The configuration files of claws are under `configs/claw/`, and mainly contain the motor parameters, the value of the lead, and the radius of the gear, etc.

```yaml
motor:
  Kp_b: 5.0e-4
  Kp_s: 5.0e-5
  Kd_b: 7.0e-4
  Kd_s: 1.0e-4
  angle_range: 330
  bus_channel: can0
  bus_interface: socketcan
  iq_max: 10
  motor_id: 1
lead: 15.0
gear_radius: 15.0
```

* Motor parameters:
* Value of lead:
* Radius of gear:

## Phone Configuration

The configuration files of phones are under `configs/phone/`, and mainly contain the host address, the size of color image, the size of depth image, etc.

```yaml
phone_host: "xx.xx.xx.xx"

color_img:
  width: 640
  height: 480

depth_img:
  width: 256
  height: 192

init_pose:
  - 0.0
  - 0.0
  - 0.0
  - -0.028827
  - 0.964070
  - 0.211908
  - 0.305085
```

* Host address:
* Size of color image:
* Size of depth image:

## Bilateral Control Configuration

The configuration file of bilateral control is used for teleoperation, and contains the host address, and the mode.

```yaml
host: "xx.xx.xx.xx"
mode: "leader"
```

* Host address:
* Mode:

## MagiClaw Configuration

The configuration files of MagiClaws contain the path of all device configuration files, and also of the `FingerNet` model.

```yaml
claw: configs/claw/claw_0.yaml
phone: configs/phone/phone_0.yaml
camera_0: configs/camera/maixcam-xxxx.yaml
camera_1: configs/camera/maixcam-xxxx.yaml
fingernet: models/FingerNet_surf.onnx
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://magiclaw.gitbook.io/magiclaw-docs/documentation/getting-started/configuration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
