This module is a working example for building a YARP device that exploits the iMotor YARP interfaces to interact with the motion control module.
Specifically to this example, we are defining a PolyDriver
device that interacts with the pointer to the iMotor
yarp interface and prints the motor temperatures to an output port. Those temperatures value can be obtained exploiting the interface method getTemperatures()
and saved to a c-array of doubles.
Considering that a properly built yarp module should derive from the public interface yarp::os::RFModule
, whose complete explanation is available at this link, the following methods should be overridden:
- configure()
- getPeriod()
- updateModule()
- close()
In order to use this module, whose final target is to print at the port called: /5-setup/motor_temperatures:o
the temperatures of the motors connected, the following steps should be done:
-
create inside the project the
build
directory -
run the commands in order:
cd build ccmake ../ make make install
-
supposed to have the correct setup running on the
yarpserver
sending data to state ports, this module can be run with the following command:./build/TemperatureManager --from app/conf/config.ini
This will instantiate the aformentioned port, where with a frequence of
_updatePeriod
time, the following values will be streamed on the port:|timeStamp | temperature_motor_0 | ... | temperature_motor_N | boolean_limit_overcame_0 | ... | boolean_limit_overcame_N
- the
config.ini
file should be filled in with the following data:robotname
: name of the robot as set in the configuration filesperiod
: times used for streaming the data to the portlistofjoints
: joints, as list a list, i.e. (0 1 2), which you wanna get the temperatures
- the