iCub-main
|
A basic module for collecting data (position, current, applied voltage, pid errors, ...) from a controlBoard and sending them trough a yarp port.
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):
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.
Yarp libraries.
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:
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:
for example:
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
and the example is:
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:
For each part initalized (e.g. head):
For each part initalized (e.g. head):
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.