robometry::TelemetryDeviceDumper class

The telemetryDeviceDumper is a yarp device that has to be launched through the yarprobotinterface for dumping quantities from your robot(for example encoders, velocities etc) in base of what specified in the configuration.

Parameters

Parameter nameTypeUnitsDefaultRequiredDescription
axesNamesList of strings--YesThe axes contained in the axesNames parameter are then mapped to the wrapped controlboard in the attachAll method, using controlBoardRemapper class.
logIEncodersbool-trueNoEnable the log of joints_state::positions, joints_state::velocities and joints_state::accelerations (http://yarp.it/git-master/classyarp_1_1dev_1_1IEncoders.html)
logITorqueControlbool-falseNoEnable the log of joints_state::torques(http://yarp.it/git-master/classyarp_1_1dev_1_1ITorqueControl.html).
logIMotorEncodersbool-falseNoEnable the log of motors_state::positions, motors_state::velocities and motors_state::accelerations (http://yarp.it/git-master/classyarp_1_1dev_1_1IMotorEncoders.html).
logIControlModebool-falseNoEnable the log of joints_state::control_mode (http://yarp.it/git-master/classyarp_1_1dev_1_1IControlMode.html.
logIInteractionModebool-falseNoEnable the log of joints_state::interaction_mode (http://yarp.it/git-master/classyarp_1_1dev_1_1IInteractionMode.html.
logIPidControlbool-falseNoEnable the log of PIDs::position_error, PIDs::position_reference, PIDs::torque_error, PIDs::torque_reference(http://yarp.it/git-master/classyarp_1_1dev_1_1IPidControl.html).
logIAmplifierControlbool-falseNoEnable the log of motors_state::pwm and motors_state::currents (http://yarp.it/git-master/classyarp_1_1dev_1_1IAmplifierControl.html).
logControlBoardQuantitiesbool-falseNoEnable the log of all the quantities that requires the attach to a control board (logIEncoders, logITorqueControl, logIMotorEncoders, logIControlMode, logIInteractionMode, logIPidControl, logIAmplifierControl).
logILocalization2Dbool-falseNoEnable the log of odometry_data (http://yarp.it/git-master/classyarp_1_1dev_1_1Nav2D_1_1ILocalization2D.html).
saveBufferManagerConfigurationbool-falseNoEnable the save of the configuration of the BufferManager into path+ "bufferConfig" + experimentName + ".json"
json_filestring--NoConfigure the robometry::BufferManagers reading from a json file like in Example configuration file. Note that this configuration will overwrite the parameter-by-parameter configuration
experimentNamestring--YesPrefix of the files that will be saved. The files will be named: experimentName+timestamp+ ".mat".
pathstring--NoPath of the folder where the data will be saved.
n_samplessize_t--YesThe max number of samples contained in the circular buffer/s
save_periodicallybool-falseNo(but it has to be set to true if auto_save is set to false)The flag for enabling the periodic save thread.
save_perioddoubleseconds-Yes(if save_periodically is set to true)The period in seconds of the save thread
data_thresholdsize_t-0NoThe save thread saves to a file if there are at least data_threshold samples
auto_savebool-falseNo(but it has to be set to true if save_periodically is set to false)the flag for enabling the save in the destructor of the robometry::BufferManager
yarp_robot_namestring-""NoName of the robot used during the experiment.

Mapping .mat variables -> YARP interfaces

Variable nameYARP interface
joints_state::positionsyarp::dev::IEncoders::getEncoders
joints_state::velocitiesyarp::dev::IEncoders::getEncoderSpeeds
joints_state::accelerationsyarp::dev::IEncoders::getEncoderAccelerations
motors_state::positionsyarp::dev::IMotorEncoders::getMotorEncoders
motors_state::velocitiesyarp::dev::IMotorEncoders::getMotorEncoderSpeeds
motors_state::accelerationsyarp::dev::IMotorEncoders::getMotorEncoderAccelerations
joints_state::control_modeyarp::dev::IControlMode::getControlModes
joints_state::interaction_modeyarp::dev::IInteractionMode::getInteractionModes
PIDs::position_erroryarp::dev::IPidControl::getPidErrors
PIDs::position_referenceyarp::dev::IPidControl::getPidReferences
PIDs::torque_erroryarp::dev::IPidControl::getPidErrors
PIDs::torque_referenceyarp::dev::IPidControl::getPidReferences
PIDs::odometry_datayarp::dev::Nav2D::ILocalization2D::getEstimatedOdometry

Example of xml

Example of xml file for using it on the iCub robot:

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE devices PUBLIC "-//YARP//DTD yarprobotinterface 3.0//EN" "http://www.yarp.it/DTD/yarprobotinterfaceV3.0.dtd">


    <device xmlns:xi="http://www.w3.org/2001/XInclude" name="telemetryDeviceDumper" type="telemetryDeviceDumper">
        <param name="axesNames">(torso_pitch,torso_roll,torso_yaw,neck_pitch, neck_roll,neck_yaw,l_shoulder_pitch,l_shoulder_roll,l_shoulder_yaw,l_elbow,l_wrist_prosup,l_wrist_pitch,l_wrist_yaw,r_shoulder_pitch,r_shoulder_roll,r_shoulder_yaw,r_elbow,r_wrist_prosup,r_wrist_pitch,r_wrist_yaw,l_hip_pitch,l_hip_roll,l_hip_yaw,l_knee,l_ankle_pitch,l_ankle_roll,r_hip_pitch,r_hip_roll,r_hip_yaw,r_knee,r_ankle_pitch,r_ankle_roll)</param>
        <param name="logIEncoders">true</param>
        <param name="logITorqueControl">true</param>
        <param name="logIMotorEncoders">true</param>
        <param name="logIControlMode">true</param>
        <param name="logIInteractionMode">true</param>
        <param name="logIPidControl">false</param>
        <param name="logIAmplifierControl">true</param>
        <param name="saveBufferManagerConfiguration">true</param>
        <param name="experimentName">test_telemetry</param>
        <param name="path">/home/icub/test_telemetry/</param>
        <param name="n_samples">100000</param>
        <param name="save_periodically">true</param>
        <param name="save_period">120.0</param>
        <param name="data_threshold">300</param>
        <param name="auto_save">true</param>

        <action phase="startup" level="15" type="attach">
            <paramlist name="networks">
                <!-- motorcontrol and virtual torque sensors -->
                <elem name="left_lower_leg">left_leg-eb7-j4_5-mc</elem>
                <elem name="right_lower_leg">right_leg-eb9-j4_5-mc</elem>
                <elem name="left_upper_leg">left_leg-eb6-j0_3-mc</elem>
                <elem name="right_upper_leg">right_leg-eb8-j0_3-mc</elem>
                <elem name="torso">torso-eb5-j0_2-mc</elem>
                <elem name="right_lower_arm">right_arm-eb27-j4_7-mc</elem>
                <elem name="left_lower_arm">left_arm-eb24-j4_7-mc</elem>
                <elem name="right_upper_arm">right_arm-eb3-j0_3-mc</elem>
                <elem name="left_upper_arm">left_arm-eb1-j0_3-mc</elem>
                <elem name="head-j0">head-eb20-j0_1-mc</elem>
                <elem name="head-j2">head-eb21-j2_5-mc</elem>
                <!-- ft -->
            </paramlist>
        </action>

        <action phase="shutdown" level="2" type="detach" />

    </device>

Constructors, destructors, conversion operators

TelemetryDeviceDumper()
~TelemetryDeviceDumper() override

Public functions

auto close() -> bool override
auto open(yarp::os::Searchable& config) -> bool override
Configure with a set of options.
auto attachAll(const yarp::dev::PolyDriverList& device2attach) -> bool override
auto detachAll() -> bool override
void run() override

Public variables

yarp::dev::IEncoders* encs
yarp::dev::IMotorEncoders* imotenc
yarp::dev::IPidControl* pid
yarp::dev::IAmplifierControl* amp
yarp::dev::IControlMode* cmod
yarp::dev::IInteractionMode* imod
yarp::dev::ITorqueControl* itrq
yarp::dev::IMultipleWrapper* multwrap

Function documentation

bool robometry::TelemetryDeviceDumper::open(yarp::os::Searchable& config) override

Configure with a set of options.

Parameters
config The options to use
Returns true iff the object could be configured.