-
Notifications
You must be signed in to change notification settings - Fork 0
Groot2 crashes with std::vector<double> in Blackboard #55
New issue
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
Comments
I had assumed that Groot was only considering that the root-level JSON was an object or primitive. But I tried a workaround where I added a trivial key to the JSON serializer:
Console output showing it was run:
Groot2 crashed with the same error. I am guessing then that it will crash on JSON arrays anywhere. This severely limits the data types that can go in the Blackboard. |
I was trying to make a PR as you mentioned here: ros-navigation/navigation2#4957 (comment) But I found this issue. This is exactly the same crash I got in Groot 2 when converting from std::vector<geometry_msgs::msg::PoseStamped> to JSON. |
Versions:
behaviortree_cpp
4f66447 and 4.6.2behaviortree_ros2
adec04bPlatform: Ubuntu 22.04
Behavior
I put a C++ vector on the Blackboard. I tried to visualize it in Groot, but Groot crashed when I clicked the checkmark to visualize the tree.
The exception is
(Groot2 was able to visualize a primitive - a double - or a more complex ROS2 type, a geometry_msgs/msg/Point, without problem.)
Hypothesized Cause
I am guessing that the Groot2 JSON parser assumes that
the rootany element will be a JSON object or primitive. If that is the case, then it needs to also handle a JSON array.To reproduce
Register a JsonDefinition for a vector.
Create a behavior with the following output ports that writes a vector to them:
Use a behavior tree runner with a Groot2Publisher (I used the
BT::TreeExecutionServer
frombehaviortree_ros2
)XML for the tree:
I experienced the same behavior when using the auto-generated
<TreeNodesModel>
Groot2 console log:
The contents of crash_log.txt:
The text was updated successfully, but these errors were encountered: