iCub-main
Loading...
Searching...
No Matches
controlBoardDumper

A basic module for collecting data (position, current, applied voltage, pid errors, ...) from a controlBoard and sending them trough a yarp port.

+ Collaboration diagram for controlBoardDumper:

A basic module for collecting data (position, current, applied voltage, pid errors, ...) from a controlBoard and sending them trough a yarp port.

These data can then be dumped to a file using yarpdatadumper. Time stamp is forwarded if present in the collected data. If not present a time stamp is added. Remark: all collected data are obtained by a remoteControlBoard connected with a controlBoard. Therefore, collected data needs to be available to the controlBoard. When using the iCub canbus protocol this is not necessary guaranteed for all data: data are available only if the corresponding broadcast is enabled. This can be easily done by seeting the proper entry in the controlBoard configuration file (e.g. icub_right_arm_safe.ini):

Description

Data from a control board can be easily accessed trough suitable interfaces (IPositionControl, IAmplifierControl, IPidControl ...) and corresponding functions (getEncoders, getCurrrents, getOutputs, ...). The module (controlBoardDumper) accesses all these data and make them available on the network opening suitable yarp ports. The data are collected at a fixed frequency by a suitable thread whose frequency can be changed.

Libraries

Yarp libraries.

Parameters

The module uses the ResourceFinder class as a way to retrieve its own configuration. In particular, the default config file is controlBoardDumper.ini and it is assumed to be in the app/dumpControlBoardData/conf directory. The file structure is the following:

robot icub //the robot name [default: icub]
part p //the robot part to be dumped [default: head]
rate r //[ms] the sampling time for collected data [default: 500]
joints (i1 i2 i3...iN) //indexes of the joints to be read [default: (0 1)]
dataToDump (data1...dataN) //type of data to be collected [default: all possible data, except debug interface (getRotorxxx)]
dataToDumpAll // will dump all data, including the debug interface (getRotorxxx)
logToFile //if present, this options creates a log file for each data port

If no such file can be found, the application is started with the default parameters. The first parameter ('robot' with default value 'icub') specifies the robot name. The second parameter ('part' with default 'head') specifies the used part. The third parameter ('rate' with default '500') specifies the acquisition rate. The parameter dataToDump can assume the following values:

Other data can be easily added by modyfing the classes in the file genericControlBoardDumper.cpp which contains a class named GetData with a method getData which can be used to instantiate a thread controlBoardDumper which does not depend on the specific interface (e.g. IPositionControl) or function (e.g. getEncoders).

Please note that for dumping the getRototxxx data the debugInterface is required. This means the robot must instantiate the debugInterfaceWrapper in order to have remote access to those data.

The module can also be executed from a command line with the following format:

controlBoardDumper --robot r --part p --rate r --joints "(i1 i2 i3...iN)"

for example:

controlBoardDumper --robot icub --part head --rate 20 --joints "(0 1 2)"

In this case all the following standard data will be dumped: getEncoders getEncoderSpeeds getEncoderAccelerations getPositionErrors getTorqueErrors getOutputs getCurrents getTorques

To dump only specific data you can use the –dataToDump option

controlBoardDumper --robot r --part p --rate r --joints "(i1 i2 i3...iN)" --dataToDump "(data1...dataN)"

and the example is:

controlBoardDumper --robot icub --part head --rate 20 --joints "(0 1 2)" --dataToDump "(getCurrents getOutputs)"

To dump all the data, including the debug ones, you can use the dataToDumpAll option controlBoardDumper –robot r –part p –rate r –joints "(i1 i2 i3...iN)" –dataToDumpAll

and the example is:

controlBoardDumper --robot icub --part head --rate 20 --joints "(0 1 2)" --dataToDumpAll

Ports Accessed

For each part initalized (e.g. head):

Ports Created

For each part initalized (e.g. head):

Author
Francesco Nori

Copyright (C) 2008 RobotCub Consortium

CopyPolicy: Released under the terms of the GNU GPL v2.0.

This file can be edited at src/controlBoardDumper/main.cpp.