Configuration

This page introduces the definition of the configuration files used in magiclaw repository.

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

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.

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: False
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
  • mode: The connection mode of the camera, including web (default) and usb.

  • host: The host address of the web camera, like xx.xx.xx.xx.

  • width and height: The size of the camera image (320 and 240 as default).

  • dist and mtx: The intrinsic parameters of the camera. Please follow the calibration guide to modify these values for each camera.

  • marker_size: The size of the marker (0.009 mm as default).

  • filter_on: Whether filtering the marker's pose (True) or not (False, default).

  • filter_frame: The frame range for filtering pose (5 as default).

  • marker2global_tvec and marker2global_rmat: The translation vector and rotation matrix from the marker frame to the finger global frame.

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.

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: The configuration of the motor.

  • Kp_b: The proportional gain for bilateral mode,

  • Kp_s: The proportional gain for standalone mode,

  • Kd_b: The derivative gain for bilateral mode,

  • Kd_s: The derivative gain for standalone mode,

  • angle_range: The range of the motor angle (330 as default).

  • bus_channel: The channel of the CAN bus, including can0 (default) and can1.

  • bus_interface: The interface of the CAN bus (socketcan as default).

  • iq_max: The maximum value of motor IQ (10 as default).

  • motor_id: The ID of the motor (1 as default).

  • lead: The lead of the screw (15.0 as default, don't change it).

  • gear_radius: The radius of the gear (15.0 as default, don't change it).

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.

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: The host address of the phone, like xx.xx.xx.xx.

  • color_img: The size of the phone's color image, including width (640 as default) and height (480 as default).

  • depth_img: The size of the phone's depth image, including width (256 as default) and height (192 as default).

  • init_pose: The initial pose of the phone under the gripper frame, defined by the mechanical design.

Bilateral Control Configuration

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

host: "xx.xx.xx.xx"
mode: "leader"
  • host: The host address of the other control box, like xx.xx.xx.xx.

  • mode: The bilateral mode of this control box, whether leader or follower.

MagiClaw Configuration

The configuration files of MagiClaws contain the path of all device configuration files, and also of the FingerNet model. For each control box, there are two files, including magiclaw_0.yaml and magiclaw_1.yaml, for MagiClaws connected to the two CAN ports separately.

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
  • claw: The path of the .yaml configuration file for the claw.

  • phone: The path of the .yaml configuration file for the phone.

  • camera_0: The path of the .yaml configuration file for the camera in the left finger.

  • camera_1:The path of the .yaml configuration file for the camera in the right finger.

  • fingernet: The path of the .onnx model file for the FingerNet.

Last updated