Skip to content

Commit 6df054e

Browse files
Update FineCalibrationChecker documentation (#1048)
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent 0d65030 commit 6df054e

4 files changed

Lines changed: 59 additions & 129 deletions

File tree

src/libraries/icubmod/fineCalibrationChecker/README.md

Lines changed: 41 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,56 @@
1-
# Fine Calibration Checker Tool
1+
# Fine Calibration Checker Device
22

33
## Overview
44

5-
This is a tool designed for ergoCub and iCub platforms aimed at giving to the user information about the accuracy of the joints calibration procedure, allowing to collect data that might help in analyzing miscalibration errors on a specific system.
6-
It has been thought to interface with **YARP** devices and robot **control boards**.
7-
The tool is made of two main parts:
8-
- a **module** that does not much other than managing a thread, which contains all the core functionalities of the application
9-
- a **thread** that does all the job for collecting the desired data about the joint calibration
5+
This is a YARP device designed for `ergoCub` and `iCub` platforms that provides information about the accuracy of the joints calibration procedure. It helps collect and analyze data related to miscalibration errors on specific systems.
6+
The device interfaces with robot **control boards** and **raw encoder data** streams through YARP.
107

11-
## FineCalibrationChecker Module
8+
The device performs calibration checking by:
9+
- Connecting to remote control boards and raw encoder data ports
10+
- Reading and comparing joint positions with expected golden positions (in degrees)
11+
- Analyzing calibration accuracy and generating detailed reports
12+
- Providing visual and numerical output for calibration analysis
1213

13-
The module is built on the inheritance of the `YARP` interface `yarp::os::RFModule` and does not much other than managing a `yarp::os::Thread` and keep it running with a specific period until the user decides to stop the whole process.
14+
## Main Features
1415

15-
## FineCalibrationChcker Thread
16+
The main features of this device include:
17+
- Configuration through XML files containing joint information and parameters
18+
- Integration with motion control and raw values publisher network wrappers
19+
- Remote control board connectivity for joint and encoder data access
20+
- Comparison of golden hard-stop positions with live encoder readings
21+
- Analysis of differences between expected and measured joint positions
22+
- Generation of CSV output files and optional visual feedback
23+
- Asynchronous operation as a threaded YARP device
1624

17-
The thread is basically just an implementation of a `yarp::os::Thread` but it contains all the core implementations of this tool.
18-
Specifically it does the following actions:
19-
- parse the configuration data given by the file `config.ini`
20-
- initialize all the data structures needed for storing the data
21-
- parse the `.csv` file that stores the input position data, which must be present in the `app/fineCalibrationChecker` directory named as `zeroPositionsData.csv` (an example file is already installed in the repo)
22-
- open devices and connect to remote control boards and ports
23-
- run the calibration check
24-
- give in output the requested results
25+
This device helps developers and technicians verify and fine-tune the mechanical calibration of robot joints, ensuring accurate and reliable operation.
2526

26-
## Main Features
27+
## Configuration Parameters
28+
29+
The device requires the following parameters in its configuration file:
30+
- `devicename`: Name of the device instance (default: "fineCalibrationChecker")
31+
- `robotname`: Name of the robot matching configuration files
32+
- `remoteRawValuesPort`: Port name for raw values data (e.g., "/setup/raw_data")
33+
- `axesNamesList`: List of joint names matching remapper configuration
34+
- `goldPositions`: Encoder positions in iCubDegrees at chosen zero positions
35+
- `calibrationDeltas`: Calibration deltas from calibration files
36+
- `encoderResolutions`: Full encoder resolutions (e.g., 16384 for AEA)
37+
- `axesSigns`: Encoder signs based on primary encoder resolution
38+
- `withGui`: Enable/disable visual output display
39+
40+
## Setup and Usage
2741

28-
Therefore the main features of this tool can be summarized as follows:
29-
- Reads configuration parameters and joint information from a configuration file.
30-
- Connects to remote control boards and a raw values publisher to access joint and encoder data.
31-
- Executes a calibration routine, including checking golden hard-stop positions and comparing them with live encoder readings.
32-
- Evaluates the difference (delta) between expected and measured joint positions, logs the results, and generates output files and images for analysis.
33-
- Runs as a threaded YARP module, allowing for asynchronous calibration and monitoring.
42+
To use the device:
3443

35-
This tool is useful for developers and technicians who need to verify and fine-tune the mechanical calibration of the robot’s joints, ensuring accurate and reliable operation.
44+
1. Place the configuration XML file in your desired location (e.g., `./checker/fineCalibrationChecker.xml`)
45+
2. Configure the `rawvaluespublisherremapper` and `rawValuesPublisherServer` devices
46+
3. Add the device wrappers to the main robot configuration file
47+
4. Start the `yarprobotinterface` application
48+
5. The device will automatically execute if properly configured
49+
6. Results are saved to a CSV file in the `yarprobotinterface` working directory
50+
7. If `withGui` is enabled, a visualization of the output data will be displayed
3651

37-
## Commands and files
52+
For configuration examples, refer to `fineCalibrationCheckerConfig.xml`.
3853

39-
In order to correctly run the module one should type the following command from the directory that stores `config.ini` file and the `zeroPositionData.csv` file:
4054

41-
```
42-
fineCalibrationChecker --from conf/config.ini
43-
```
4455

45-
It should be noted then, that in the same directory the aforementioned file for the ground truth positions should be stored and it should have the defined name.
46-
It has to contain the data organized line by line and with the following structure:
4756

48-
```
49-
axes_name,gold_position,joint_encoder_full_resolution
50-
```

src/libraries/icubmod/fineCalibrationChecker/fineCalibrationChecker.xml

Lines changed: 0 additions & 76 deletions
This file was deleted.
Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
11
<?xml version="1.0" encoding="UTF-8" ?>
22
<!DOCTYPE devices PUBLIC "-//YARP//DTD yarprobotinterface 3.0//EN" "http://www.yarp.it/DTD/yarprobotinterfaceV3.0.dtd">
33

4+
<device xmlns:xi="http://www.w3.org/2001/XInclude" name="fineCalibrationChecker" type="fineCalibrationChecker">
5+
<param name="devicename">fineCalibrationChecker</param> <!-- this is the device name to keep -->
6+
<param name="robotname">setup</param> <!-- robot name that should match with the value stated in the configuration files -->
7+
<param name="remoteRawValuesPort">/setup/raw_data</param> <!-- raw values port name, which should match with the one defined in the raw values nws wrapper-->
8+
<param name="axesNamesList">(joint1 joint2)</param> <!-- List of axes names, which should match with what defined in the remappers -->
9+
<param name="goldPositions">(0 0)</param> <!-- gold positions are encoder position in iCubDegrees at chosen zero-->
10+
<param name="calibrationDeltas">(0 0)</param> <!-- calibration delta are copied from the calibration files (since there are no API for getting them)-->
11+
<param name="encoderResolutions">(16384 16384)</param> <!--encoder full resolution e.g. for AEA is 2^18 -->
12+
<param name="axesSigns">(1 -1)</param> <!-- encoder signs are taken by checking the sign of primary encoder resolution in the mc_service configuration file for the related board -->
13+
<param name="withGui">true</param> <!-- if set to true an image showing the output data is shown otherwise no -->
414

5-
<device xmlns:xi="http://www.w3.org/2001/XInclude" name="fineCalibrationChecker" type="fineCalibrationChecker">
6-
<param name="devicename">fineCalibrationChecker</param>
7-
<param name="robotname">setup</param>
8-
<param name="remoteRawValuesPort">/setup_mc/raw_data</param>
9-
<param name="axesNamesList">(lego_setup)</param>
10-
<param name="goldPositions">(0)</param>
11-
<param name="encoderResolutions">(16384)</param>
15+
<action phase="startup" level="15" type="attach">
16+
<paramlist name="networks"> <!-- control boards to be attached, which should match with the values in the remappers -->
17+
<elem name="setup_joint_0">setup-mc-board1</elem>
18+
<elem name="setup_joint_1">setup-mc-board2</elem>
19+
</paramlist>
20+
</action>
1221

13-
14-
<action phase="startup" level="15" type="attach">
15-
<paramlist name="networks">
16-
<elem name="setup_joint_0">setup-eb2-j0_2-mc</elem>
17-
</paramlist>
18-
</action>
19-
20-
<action phase="shutdown" level="2" type="detach" />
21-
22-
</device>
22+
<action phase="shutdown" level="2" type="detach" />
23+
</device>

src/libraries/icubmod/fineCalibrationChecker/zeroPositionsData.csv

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)