YARP CiA-402 EtherCAT Device 0.6.0
YARP device plugin for EtherCAT CiA-402 drives
Loading...
Searching...
No Matches
CiA402::CheckEncoderCalibration Class Reference

Encoder calibration checker: compare live encoder readings against a reference TOML file. More...

#include <CheckEncoderCalibration/CheckEncoderCalibration.h>

Classes

class  Impl
 

Public Member Functions

 CheckEncoderCalibration ()
 Default constructor.
 
 ~CheckEncoderCalibration ()
 Destructor.
 
bool run (yarp::os::ResourceFinder &rf)
 Run the full encoder check and produce a Markdown report.
 

Detailed Description

Encoder calibration checker: compare live encoder readings against a reference TOML file.

This utility connects to all EtherCAT slaves on the specified network interface using SDO communication and reads back the current encoder positions (raw and adjusted) and resolutions for both encoder channels. It then compares these live values against a reference TOML file previously written by CiA402::StoreHome37 (store-home-position application) immediately after calibration.

The result is a human-readable Markdown report containing one table per slave, showing:

  • The reference value from the TOML file.
  • The current live value read from the drive.
  • The difference (delta) between the two.

This allows an operator to quickly verify whether the encoder state has drifted since the last calibration, without re-running the full homing procedure.

Note
Only SDO communication is used; the ring stays in SAFE-OP/PRE-OP throughout.
SOEM uses 1-based slave indices; the TOML file must follow the same convention (slave_1, slave_2, …).

Definition at line 36 of file CheckEncoderCalibration.h.

Constructor & Destructor Documentation

◆ CheckEncoderCalibration()

CheckEncoderCalibration::CheckEncoderCalibration ( )

Default constructor.

Allocates the internal implementation object. No EtherCAT communication is started.

Definition at line 401 of file CheckEncoderCalibration.cpp.

◆ ~CheckEncoderCalibration()

CheckEncoderCalibration::~CheckEncoderCalibration ( )
default

Destructor.

Releases all resources owned by the implementation. If the EtherCAT master was initialised, it is cleanly shut down.

Member Function Documentation

◆ run()

bool CheckEncoderCalibration::run ( yarp::os::ResourceFinder & rf)

Run the full encoder check and produce a Markdown report.

Reads configuration from the provided ResourceFinder, discovers all EtherCAT slaves on the specified network interface, reads each slave's encoder data, compares it against the reference TOML file, and writes a Markdown report to disk.

Parameters
rfResourceFinder populated with the parameters listed below.
Returns
true if the check completed successfully and the report was written; false on any error (initialisation failure, TOML parse error, SDO read failure, file I/O error).
Note
Expected keys in the ResourceFinder:
Key Type Description Default
ifname string Network interface name (e.g. "eth0") "eth0"
toml-input string Path of the reference TOML file (from StoreHome37) (required)
report-output string Path of the Markdown report to write "encoder_calibration_check_YYYY_MM_DD_HH_MM_SS.md"

Definition at line 408 of file CheckEncoderCalibration.cpp.


The documentation for this class was generated from the following files: