File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
include/behaviortree_cpp_v3/decorators Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change 1414#define DECORATOR_BLACKBOARD_PRECONDITION_NODE_H
1515
1616#include " behaviortree_cpp_v3/decorator_node.h"
17+ #include < type_traits>
1718
1819namespace BT
1920{
@@ -71,10 +72,17 @@ NodeStatus BlackboardPreconditionNode<T>::tick()
7172 setStatus (NodeStatus::RUNNING);
7273
7374 if ( getInput (" value_A" , value_A) &&
74- getInput (" value_B" , value_B) &&
75- value_B == value_A )
75+ getInput (" value_B" , value_B) )
7676 {
77- return child_node_->executeTick ();
77+ bool is_equal = (value_B == value_A);
78+ if ( std::is_same<double , T>::value || std::is_same<float , T>::value )
79+ {
80+ is_equal = std::abs (value_B - value_A) <= std::numeric_limits<float >::epsilon ();
81+ }
82+ if (is_equal)
83+ {
84+ return child_node_->executeTick ();
85+ }
7886 }
7987
8088 if ( child ()->status () == NodeStatus::RUNNING )
You can’t perform that action at this time.
0 commit comments