You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I expect the script node to succeed, resulting in a blackboard entry goal_range_min, which contains the difference of goal_position and goal_tolerance. In this example, it would be -0.01.
What I get
Error in script [goal_range_min := goal_position - goal_tolerance]
I get a bit more info when I do the calculation in two steps, i.e.
Error in script [goal_range_min -= goal_tolerance]
Operator not supported for strings
Or, when I add a Script node at the beginning of the tree to set/overwrite an entry, i.e.
<Scriptcode="goal_tolerance := 0.03" />
I get
Error in script [goal_tolerance := 0.03]
Error assigning a value to entry [goal_tolerance] with type [std::string].
The right operand has type [double] and can't be converted to [std::string]
However, when I delete the goal_tolerance entry from the JSON and only set it through the Script Node, while still setting the goal_position from the JSON, it seems to work.
Thoughts
This hints me that the blackboard entries have the type information to be a string. However, I would expect them to be without type information, according to this line and following:
// if a new generic port is created with a string, it's type should be AnyTypeAllowed
So, are mathematical operations between two AnyTypeAlloweds not possible? I assume if both are of unknown type, it is unknown what the operation is supposed to be (addition? string concatenation?).
But is there any solution? I could infer the data type from the JSON entry and use the right template instantiation of Blackboard::set<T>. Any other suggestion?
The text was updated successfully, but these errors were encountered:
What I do
After creating a tree, I set blackboard entries from data read in from a JSON string, something like this
I currently restrict to primitive values, setting the parameters with something like this:
In my tree, I want to set values according to those set blackboard entries, like so:
What I expect
I expect the script node to succeed, resulting in a blackboard entry
goal_range_min
, which contains the difference ofgoal_position
andgoal_tolerance
. In this example, it would be-0.01
.What I get
I get a bit more info when I do the calculation in two steps, i.e.
which will result in the following error:
Or, when I add a
Script
node at the beginning of the tree to set/overwrite an entry, i.e.I get
However, when I delete the
goal_tolerance
entry from the JSON and only set it through the Script Node, while still setting thegoal_position
from the JSON, it seems to work.Thoughts
This hints me that the blackboard entries have the type information to be a string. However, I would expect them to be without type information, according to this line and following:
BehaviorTree.CPP/include/behaviortree_cpp/blackboard.h
Line 220 in 3c62813
So, are mathematical operations between two
AnyTypeAllowed
s not possible? I assume if both are of unknown type, it is unknown what the operation is supposed to be (addition? string concatenation?).But is there any solution? I could infer the data type from the JSON entry and use the right template instantiation of
Blackboard::set<T>
. Any other suggestion?The text was updated successfully, but these errors were encountered: