-
Notifications
You must be signed in to change notification settings - Fork 722
Issue with ports not being remapped with subtreeplus on v3.8 #563
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
Version 4.X has been in development for almost 1 year now. Keep maintaining 3.8 is really a struggle for me. Said that, would you be so kind to give me a unit test that I can use to reproduce the issue? |
These are my current tests: https://github.com/BehaviorTree/BehaviorTree.CPP/blob/v3.8/tests/gtest_subtree.cpp |
I was able to reproduce here: https://github.com/BehaviorTree/BehaviorTree.CPP/tree/issue563 |
Hi, problem fixed in branch issue563. Would you be so kind to test it? Once you confirm, I will merge and release a new version |
still there for me D: trying to find a test case where that'll show |
oh god, don't tell me that! |
also, if you experienced a regression, please share that with me. I hope I am not breaking anything with these changes (my unit tests pass) |
So, the unit test passes fine, but when I'm trying a simple thing with the nav2 stack, it fails.
fails to instantiate tree with the |
Sorry, I just implemented it and it works. I don't know how to help you sorry. class WaitNode : public BT::StatefulActionNode
{
std::chrono::system_clock::time_point _deadline;
public:
WaitNode(const std::string& name, const BT::NodeConfiguration& config) :
BT::StatefulActionNode(name, config)
{}
virtual NodeStatus onStart() override
{
double time = getInput<double>("wait_duration").value();
_deadline =
std::chrono::system_clock::now() + std::chrono::milliseconds(int(time * 1000));
return NodeStatus::RUNNING;
}
virtual NodeStatus onRunning() override
{
return (std::chrono::system_clock::now() < _deadline) ? NodeStatus::RUNNING :
NodeStatus::SUCCESS;
}
virtual void onHalted() override {}
static BT::PortsList providedPorts()
{
return {BT::InputPort<double>("wait_duration")};
}
};
TEST(SubTree, Autoremap)
{
BehaviorTreeFactory factory;
const std::string tree_xml = R"(
<root main_tree_to_execute="Tree">
<BehaviorTree ID="Tree">
<Sequence>
<SubTreePlus ID="Main" __autoremap="true"/>
</Sequence>
</BehaviorTree>
<BehaviorTree ID="Main">
<Wait wait_duration="1"/>
</BehaviorTree>
</root>
)";
factory.registerNodeType<WaitNode>("Wait");
Tree tree = factory.createTreeFromText(tree_xml);
auto ret = tree.tickRootWhileRunning();
ASSERT_EQ(ret, NodeStatus::SUCCESS);
} |
Also the message:
suggests that you are having a problem with the infamous use of the blackboard to share the ROS node handle. This is a bad practice and an abuse of the blackboard that I don't support, nor recommend. I think the solution you need has nothing to do with SubtreePlus and autoremap. |
I'm aware:c. it is the way it's currently done all over nav2 bt's, unfortunately. |
it does look like you fixed it from your side, but that breaks the nav2 side somehow |
I don't even know how it is possible that it worked before. Also, I think that, as you detected it yourself (motivation of this issue), Is that a correct statement? This make sense to me considering what Nav2 does and the way SubtreePlus autoreamp was implemented. In other words, unless we change something in Nav2 (I have a suggestion), Said that, I DO NEED to know from you what used to work but is not working anymore. |
I wanted to use I was using |
I have no idea how it could possibly work before |
I have an idea, maybe it is possible to fix this, I will ask you later to try a new branch |
fun to be a part of ! haha |
Please try this branch issue_563 |
nope ;( |
I will need to try this on my machine or debug this with you. Can you arrange a session tomorrow or Thursday to do the investigation together? The backtrace obtained with GDB would really help |
Hi. any additional detail? When you say "crashes" you mean that an exception in thrown? Same message? |
sorry, don’t have time now. |
Honestly, fixing what Nav2 does is not on top of my priorities; I will prioritize what can be reproduced in my unit tests. |
Nor should you, @Rid0n its on you to provide reproduction help or compile with a debugger to get a trace. Its not @facontidavide 's problem to go into another project he doesn't maintain to chase down your issue 😄 You should provide the level of detail necessary for a responsible maintainer to make actionable progress on, not just "nope ;(" |
@Rid0n to be clear: I am grateful for the time you spent so far. I was able to correct some issues and improve the library thanks to your error report. But I need more information to help you further. |
I know, but isn’t it a bit of a gray area since it’s something that’s affecting both projects? I only said that because @facontidavide seems to want to fix this quickly and without fallout to nav2, while I can’t quickly provide what he’s asking for. ;( |
and I will give it to you if I find the time haha 💌 |
as far as I know, this is fixed |
Bug report:Hey! I ran into some problems after this issue, type conversion for the arguments I pass to the SubTreePlus stopped working:
ToggleSomething BT:
This fails with the following error: On version 3.8.3 it worked great, and i think that's expected that it would be converted from string to bool automatically or no? As for the issue this ticket is about:I might be missing something but the original report in my understanding sounds like: Blackboard variables (which are not ports) are not remapped by a SubTreePlus with __autoremap="True". The way I see it its your favorite bug report about SubTrees and nav2 (#189) , or there is more to it, that you tried to fix in this ticket? |
@facontidavide friendly ping |
Ciao @facontidavide, same problem as @HovorunB here. I've recently upgraded my
I get this error:
It was used to work in the previous version. Possibly related to #489, which you already fixed for BT.CPP v4? (For info: I'm allowing to write to this issue, as the first problem caused by the version upgrade was the one with |
I am spending some days with my family with little access to the computer. If anyone can provide a simple example that I can reproduce locally, I will focus my attention to this issue as soon as I can |
@m-morelli would you be so kind to open a new issue and provide a way to reproduce it? |
Ciao @facontidavide , sure I'll do it as soon as I have a bit of time. Thanks! |
Done in #623. Thanks! |
This can be closed then I guess |
Here's my code.
I have the outermost tree passing down values to a subtree which is then passing down values to another subtree which ticks a navigation tree. Everything with the
__autoremap
flag set to true. Very simple.I expect there not to be any issues, however for some reason I'm getting an error
[bt_navigator]: Exception when loading BT: Blackboard::get() error. Missing key [node]
I found that the issue lies specifically in the switch from Tree2 to Tree3. Every other subtree node does successfully remap everything.
If I change one line
<SubTreePlus ID="Tree3" __autoremap="true"/>
To
<SubTreePlus ID="Tree3" goal="{goal}" node="{node}" bt_loop_duration="{bt_loop_duration}" tf_buffer="{tf_buffer}" server_timeout="{server_timeout}" />
It all works fine.
What's up here?
The text was updated successfully, but these errors were encountered: