Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in setParameter method if the parameter is boolean #308

Closed
GiulioRomualdi opened this issue May 24, 2021 · 3 comments · Fixed by #311
Closed

Bug in setParameter method if the parameter is boolean #308

GiulioRomualdi opened this issue May 24, 2021 · 3 comments · Fixed by #311

Comments

@GiulioRomualdi
Copy link
Member

I was trying to implement the python bindings for the YarpImplementation of the ParameterHandler. While I was writing the tests I noticed that there is a bug in the setParameter method when a boolean is passed as parameter.

Indeed when I try to call the getParameter method the following error is thrown

[2021-05-24 15:43:46.880] [thread: 71068] [blf] [error] [BipedalLocomotion::YarpUtilities::getElementFromSearchable] The value named: flag is not a bool.

https://github.com/dic-iit/bipedal-locomotion-framework/blob/baebbb6686585117d8bc3920cd8725416f116f7f/src/YarpUtilities/include/BipedalLocomotion/YarpUtilities/Helper.tpp#L79-L85

I also created a commit where the test in c++ fails 4561cea

Printing the content of the parameters handler I got the following string. Notice that flag is 1 and not True

(answer_to_the_ultimate_question_of_life 42) (pi 3.14000000000000012434) (John Smith) (flag 1) ("Fibonacci Numbers" (1 1 2 3 5 8 13 21))

This bug does not appear if the configuration is loaded in the configuration file.

cc @traversaro and @S-Dafarra

@traversaro
Copy link
Collaborator

I guess it is some problem of implicit overloading?

@S-Dafarra
Copy link
Member

I would suggest checking if this happens also with direct yarp calls. I suspect that this is happening when converting a boolean to string with to_string inside yarp.

@GiulioRomualdi
Copy link
Member Author

GiulioRomualdi commented May 24, 2021

Indeed @S-Dafarra , the problem seems related to yarp: robotology/yarp#2584

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants