We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi Davide,
I find trying to set arithmetic operations using _onSuccess and _onFailure does not work. However using _onpost works as expected.
E.g XML (not working)
<Sequence> <TestCanDo state="false" _onFailure="loop_count += 1"/> <SendWarning deviceStatus="{isLowBattery}" deviceType="BATT"/> </Sequence>
But this works:
<Sequence> <TestCanDo state="false" _onpost="loop_count += 1"/> <SendWarning deviceStatus="{isLowBattery}" deviceType="BATT"/> </Sequence>
C++ code
BT::NodeStatus testCanDo(BT::TreeNode &self) { bool state; if(auto res = self.getInput<bool>("state")) state = res.value(); else throw std::runtime_error(res.error()); return (state)? BT::NodeStatus::SUCCESS : BT::NodeStatus::FAILURE; }
Could this be a bug of sorts?
PS: TestCanDo is a simple condition node
The text was updated successfully, but these errors were encountered:
Solved by removing the spacing between the variable and arithmetic operations Solution
<Sequence> <TestCanDo state="false" _onFailure="loop_count+=1"/> <SendWarning deviceStatus="{isLowBattery}" deviceType="BATT"/> </Sequence>
Sorry, something went wrong.
That is still a bug, even with spacing, it should work.
Add test related to issue #539
ee68e15
I added a specific unit test for your case, but can not reproduce the error:
https://github.com/BehaviorTree/BehaviorTree.CPP/blob/master/tests/gtest_postconditions.cpp#L41-L62
Closing. If youcan create a variant of the unit test that show the issue, let me know
facontidavide
No branches or pull requests
Hi Davide,
I find trying to set arithmetic operations using _onSuccess and _onFailure does not work.
However using _onpost works as expected.
E.g XML (not working)
But this works:
C++ code
Could this be a bug of sorts?
PS: TestCanDo is a simple condition node
The text was updated successfully, but these errors were encountered: