-
Notifications
You must be signed in to change notification settings - Fork 724
Runtime Error| Any::copyInto fails when Remapping ports between subtrees #530
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
|
Any::copyTo fails when copying between non-compatible types and it is used ONLY in Scripts. Therefore, I have the feeling that it is related to
<BehaviorTree ID="GenericT">
<Sequence>
<Script code=" hasTask:=false; UserRequest:='0;0;0;0;0;0;0;0;0' "/>
<Parallel failure_count="2" success_count="-1">
<SubTree ID="UserActivityT" hasTask="{hasTask}" UserRequest="{UserRequest}"/>
<SubTree ID="MapManagerT" hasTask="{hasTask}" UserRequest="{UserRequest}" />
</Parallel>
<Sequence>
</BehaviorTree> |
Also, I am not sure that this looks good: <BehaviorTree ID="MapManagerT">
<ReactiveSequence>
<Script code=" isMapping:=false; hasTask:=false; UserRequest:='0;0;0;0;0;0;0;0;0' "/>
<IsMapActivity request="{UserRequest}" trigger="{hasTask}"/>
</ReactiveSequence>
</BehaviorTree> This means that at EACH tick, we reset hasTask to false and UserRequest to zeros. Also IsMapActivity sounds like a synchronous action, therefore using ReactiveSequence seems pointless. |
I think so too but as you can see the syntax for the struct as well as its corresponding template is ok. What I don't seem to understand is that if I run the MapManagerT alone. It works. I would assume that if there was an issue with the conversion from RequestData_s to std::string, it should appear here as well right?
Yes. Changing the parent from Parallel to Sequence node makes no difference and I get the same error output.
Your interpretation is on point. I intend to have UserActivityT and MapmanagerT running simultaneously in order to be able to process user requests and also have the robot performing any previously received input at the same time. I know UserActivityT doesn't make a lot of sense as it is shown here but the final tree is also going to have EmergencyT and PowerManagerT in RUNNING mode simultaneously so as to be able to interrupt the current operation should the emergency button be triggered or the battery level go below a certain level. If you can recommend an alternative way to achieve a similar effect, I will be willing to try it out.
You are right about this. The Script should only be executed once. I will re-organize the stack as shown. |
That was a setup I used for testing the subtree alone. The final subtree has no Script tag in it. That was my fault. Regarding IsMapActivity, yes that is a synchronous node. But that tree is just an extract from the actual tree. The complete MapManagerT has many other nodes that can return RUNNING hence the reason I use a ReactiveSequence. I don't know if that makes any sense but that's what seemed logical considering I want some nodes like IsMapActivity to always be ticked. |
Ok, I need to find a succinct unit test to reproduce the error. I think there is an error somewhere, but also that you may express your logic in a simpler way. I will let you know if I find anything |
Hi Davide,
I am facing this issue and can't seem to figure out a solution. I have two subtrees (TreeA and TreeB) as children of a parallel node. The main idea is that TreeA receives user input, processes it and outputs the results in an output variable "request_o".
XML of sub-TreeA:
TreeB uses the output from TreeA to decide the next cause of action.
XML of sub-TreeB:
The the main tree containing the parallel node is composed as follows:
The programs runs if I comment out either one of the subtrees but fails with this error (after ticking once) otherwise:
This is my CPP structure being used:
This is my BT Template definition for the corresponding structure:
I am not sure what I am doing wrong. It would be nice if you can shed some light on this issue since the error output is not very informative to aid in finding a solution.
The text was updated successfully, but these errors were encountered: