BehaviorTree / BehaviorTree.CPP

Behavior Trees Library in C++. Batteries included.
https://www.behaviortree.dev
MIT License
2.97k stars 656 forks source link

RetryUntilSuccesful fail to get parameter from blackboard #22

Closed liuxin00738 closed 5 years ago

liuxin00738 commented 5 years ago

Hi, Recently I am trying to set a blackboard parameter, then ask retryuntilsuccessful to retry this num of times. However, it keeps core dumpt and says stol, invalid argument. This error is easy to reproduce with t05_crossdoor.cpp. Here is my version of code which will error out. I tried to give a unsigned int, I am not sure what the type this num_attempts should be.

t05_crossdoor.cpp.tar.gz

facontidavide commented 5 years ago

Ok, I see what is happening.

getParam is called in the constructor, but the blackboard is assigned only later. I can fix this, but I am afraid that this error will happen a lot to other people writing their own nodes. I have to think about a long term solution

facontidavide commented 5 years ago

fixed. Thanks for the help

liuxin00738 commented 5 years ago

Thank you!

facontidavide commented 5 years ago

I just pushed another fix related to that. Please pull from master and let me know if anything looks weird.

liuxin00738 commented 5 years ago

I tried it today and it works. Thanks!