yarp
yarp copied to clipboard
Desired torque decimals are not displayed in the motorgui if the torque control mode is set
Describe the bug
I noticed that the desired torque are treated as integer in the motorgui
To Reproduce
Start the motorgui and set on joint in torque
Expected behavior
It would be nice to have three decimal as the position control
Screenshots
Configuration (please complete the following information):
- OS:
- yarp version:
- compiler:
Additional context cc @GiulioRomualdi
yarp version: YARP version 3.9.0+8-20240206.2+git27242fd41
If someone can point me the code I should check I can try to fix it
If someone can point me the code I should check I can try to fix it
I guess somewhere around https://github.com/robotology/yarp/blob/bde9cd2b1069d207a77a845935b2c3063c74c58d/src/yarpmotorgui/jointitem.cpp#L1145-L1176 .
Reading the code, I guess there is already a similar functionality if you go in Slider ---> Torque Options.
Cool! Still, according to your picture, the number of slider decimal digits seems to be available oly for position control
So I checked the code and there are three possible solutions:
The easiest solution
Modify the following line
https://github.com/robotology/yarp/blob/bde9cd2b1069d207a77a845935b2c3063c74c58d/src/yarpmotorgui/sliderWithTarget.h#L23
intermediate solution
add a function to change the slide for the torque (and velocity at this point) and modify
void PartItem::onSetVelSliderOptionPI(int mode, double step)
and
void PartItem::onSetTrqSliderOptionPI(int mode, double step)
to set the decimal number to an hardcoded value
complex solution
modify the GUI and all the signal slots to have the possibility to set the number of digits. Indeed they are set only for position control in
https://github.com/robotology/yarp/blob/bde9cd2b1069d207a77a845935b2c3063c74c58d/src/yarpmotorgui/jointitem.cpp#L1050
Hi @traversaro,
Do you have any updates or ideas on how to proceed with this task?
Hi @traversaro,
Do you have any updates or ideas on how to proceed with this task?
I think the easy solution proposed by Giulio Romualdi make sense. I think it make sense to have 1 or 2 as default number of decimal (rather then 0), can you try if that works?
PR here https://github.com/robotology/yarp/pull/3151
Fixed in Yarp4.