|
YARP CiA-402 EtherCAT Device 0.6.0
YARP device plugin for EtherCAT CiA-402 drives
|
Calibration utility: home all CiA-402 drives on the bus and persist the result to flash. More...
#include <StoreHomePosition/StoreHomePosition.h>
Classes | |
| class | Impl |
Public Member Functions | |
| StoreHome37 () | |
| Default constructor. | |
| ~StoreHome37 () | |
| Destructor. | |
| bool | run (yarp::os::ResourceFinder &rf) |
| Run the full homing and persistence procedure on all slaves, then write encoder data. | |
Calibration utility: home all CiA-402 drives on the bus and persist the result to flash.
This application performs a complete homing sequence on every EtherCAT slave found on the specified network interface using CiA-402 homing methods 37 (current position as home, no index) or 35 (current position as home, with index). The procedure is executed entirely via SDO communication, so the ring never needs to reach OPERATIONAL state and no cyclic motion is commanded.
After all slaves have been homed and the home position has been saved to their non-volatile memory, the application reads back the raw and adjusted encoder positions of both encoder channels together with their resolution parameters and writes the data to a TOML file. This file can subsequently be used by higher-level software to reconstruct the conversion from raw encoder counts to degrees without querying the drives again.
Per-slave homing sequence:
0x65766173 ("evas").Post-calibration encoder snapshot (written to TOML):
restore-on-boot to true causes the drive to boot already referenced, skipping the homing procedure on the next startup. slave_1, slave_2, …). Definition at line 54 of file StoreHomePosition.h.
| StoreHome37::StoreHome37 | ( | ) |
Default constructor.
Allocates the internal implementation object. No EtherCAT communication is started.
Definition at line 312 of file StoreHomePosition.cpp.
|
default |
Destructor.
Releases all resources owned by the implementation. If the EtherCAT master was initialised, it is cleanly shut down.
| bool StoreHome37::run | ( | yarp::os::ResourceFinder & | rf | ) |
Run the full homing and persistence procedure on all slaves, then write encoder data.
Reads configuration from the provided ResourceFinder, discovers all EtherCAT slaves on the specified network interface, executes the per-slave homing sequence described in the class documentation, and finally writes a TOML snapshot of the encoder state to disk.
| rf | ResourceFinder populated with the parameters listed below. |
true if every slave was homed, persisted, and the TOML file was written successfully; false on any error (initialisation failure, slave not found, homing error, homing timeout, SDO write failure, file I/O error).| Key | Type | Description | Default |
|---|---|---|---|
| ifname | string | Network interface name (e.g. "eth0") | "eth0" |
| method | int | CiA-402 homing method: 35 or 37 | 37 |
| home-offset | int32 | Additional home offset written to 0x607C | 0 |
| timeout-ms | int | Maximum time (ms) to wait for homing attained | 2000 |
| restore-on-boot | bool / int | Set drive restore-on-startup flag (0x2005:02) | true |
| toml-output | string | Path of the TOML file written after calibration | "joint_calibration_YYYY_MM_DD_HH_MM_SS.toml" |
Definition at line 319 of file StoreHomePosition.cpp.