robotology / yarp

YARP - Yet Another Robot Platform
http://www.yarp.it
Other
527 stars 195 forks source link

YarpDeviceParserGenerator: glitch in the INFO prints with vectors of double #3099

Closed Nicogene closed 7 months ago

Nicogene commented 8 months ago

Describe the bug A clear and concise description of what the bug is.

Today I wrote a .md file for generating the param parser (https://github.com/icub-tech-iit/ergocub-software/pull/231) and it worked as expected, the only thing that using this ini file:

[LIMITS]
jntPosMax   (100.0  90.0  101.4  15.0  90.0  103.1  90.0  103.1  90.0  103.1  90.0  98.7)
jntPosMin    (0.0   0.0   0.0   0.0   0.0   0.0   0.0   0.0   0.0   0.0   0.0   0.0)

the device printed this

[INFO] |yarp.device.CouplingXCubHandMk5| Parameter 'COUPLING::actuatedAxesPosMin' using value: [, , , , , ]
[INFO] |yarp.device.CouplingXCubHandMk5| Parameter 'COUPLING::actuatedAxesPosMax' using value: [, , , , , ]

and I thought there was something wrong in the ini I was passing but I noticed that the param parser was doing

foo.get(i).asString()

for printing the values parsed, by changing it by hand to

foo.get(i).toString()

I got

[INFO] |yarp.device.CouplingXCubHandMk5| Parameter 'COUPLING::actuatedAxesPosMin' using value: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0]

That was the correct print, so maybe it is better to generate code that uses toString instead of asString?

To Reproduce Generate a parser that handle a list of double and look at the terminal prints

Expected behavior The log prints the parameters correctly

Screenshots If applicable, add screenshots to help explain your problem.

Configuration (please complete the following information):

Additional context Add any other context about the problem here.

Nicogene commented 7 months ago

Actually I just realized that this was due to a misconfiguration on my side, closing