Call to deleted constructor of 'BT::Tree'clang(ovl_deleted_init)
bt_factory.h(141, 5): 'Tree' has been explicitly marked deleted here
colcon build errors
In file included from /home/njtech/RMUA_WS/src/navigation2/nav2_bt_navigator/src/bt_navigator.cpp:15:
In file included from /home/njtech/RMUA_WS/src/navigation2/nav2_bt_navigator/include/nav2_bt_navigator/bt_navigator.hpp:27:
In file included from /home/njtech/RMUA_WS/src/navigation2/nav2_bt_navigator/include/nav2_bt_navigator/navigators/navigate_to_pose.hpp:24:
In file included from /home/njtech/RMUA_WS/src/navigation2/nav2_bt_navigator/include/nav2_bt_navigator/navigator.hpp:27:
/home/njtech/RMUA_WS/install/nav2_behavior_tree/include/nav2_behavior_tree/bt_action_server.hpp:173:12: error: call to deleted constructor of 'BT:
:Tree'
return tree_;
^~~~~
/opt/ros/rolling/include/behaviortree_cpp_v3/bt_factory.h:141:5: note: 'Tree' has been explicitly marked deleted here
Tree(const Tree& ) = delete;
^
#### Additional information
- **workaround** to comply with `// non-copyable. Only movable` comment in `behaviortree_cpp_v3/bt_factory.h` header which last modified in
```diff
diff --git a/nav2_behavior_tree/include/nav2_behavior_tree/bt_action_server.hpp b/nav2_behavior_tree/include/nav2_behavior_tree/bt_action_server.hpp
index e423afcb..faf23843 100644
--- a/nav2_behavior_tree/include/nav2_behavior_tree/bt_action_server.hpp
+++ b/nav2_behavior_tree/include/nav2_behavior_tree/bt_action_server.hpp
@@ -168,7 +168,7 @@ public:
* @brief Getter function for the current BT tree
* @return BT::Tree Current behavior tree
*/
- BT::Tree getTree() const
+ const BT::Tree& getTree() const
{
return tree_;
}
after git log --graph --all --oneline I found both main and ci-jammy-rollingbt_action_server.hpp last modified at Nov 20, 2021c15ccbf don‘t change BT::Tree getTree() const
then can modify similarly by
BT::Tree* foo_tree = &foo_class.getTree();
foo_tree->...
// or call member function(s)
Bug report
Required Info:
ci-jammy-rolling
branch choosed based onros-index
Steps to reproduce issue
njtech@robot-ai-1:~/RMUA_WS$ clang -v Ubuntu clang version 15.0.0-++20220309112335+52fb4f53c29e-1~exp1~20220309232347.184 Target: x86_64-pc-linux-gnu Thread model: posix InstalledDir: /usr/bin Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/10 Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/11 Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/8 Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/9 Selected GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/11 Candidate multilib: .;@m64 Selected multilib: .;@m64
Actual behavior
git log --graph --all --oneline
I found bothmain
andci-jammy-rolling
bt_action_server.hpp
last modified at Nov 20, 2021c15ccbf
don‘t changeBT::Tree getTree() const
BehaviorTreeFactory::createTree...
official functionFeature request
Feature description
Implementation considerations