- Notifications
You must be signed in to change notification settings - Fork778
Why does using a BehaviorTree.CPP in ROS2 cause the program to crash?#1032
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
I used CMake version 3.22 to compile BehaviorTree.CPP and built a shared library named libbehaviortree_cpp.so using the following three commands: Then, I copied the libbehaviortree_cpp.so library into my project, but the program crashed. Later, I used Conan to compile the project. Since Conan requires CMake version 3.23 or higher, I upgraded CMake to version 4.1.2. Similarly, I obtained a shared library libbehaviortree_cpp.so, and this library did not cause any crashes when used in my project. I find this very strange. I also noticed that the shared libraries generated by the two methods have different sizes — the first one is 2.3 MB, while the second one is 5.1 MB. My project is located at the following path. 🔗 Project link:https://github.com/YangKaiyun-a/ros2_behaviortree_qt_demo.git My Questions 1、In my project’s CMakeLists.txt, the library libbehaviortree_cpp.so is currently found using find_library() and linked with target_link_libraries().Can this be replaced with find_package() and ament_target_dependencies() instead? 2、Why does the library compiled with CMake 4.1.2 not cause the program to crash, while the one built with CMake 3.22 does? 3、Am I the only one encountering these issues? 4、If I don’t use Conan, what is the correct way to use this shared library properly in my project? |
BetaWas this translation helpful?Give feedback.