Closed
Description
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