Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Why does using a BehaviorTree.CPP in ROS2 cause the program to crash?#1032

Unanswered
YangKaiyun-a asked this question inQ&A
Discussion options

I used CMake version 3.22 to compile BehaviorTree.CPP and built a shared library named libbehaviortree_cpp.so using the following three commands:
mkdir build_release
cmake -S . -B build_release
cmake --build build_release --parallel

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.
After that, I ran the following commands for the Conan build:
conan install . -s build_type=Release --build=missing
cmake --preset conan-release
cmake --build --preset conan-release

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.
In addition, I compiled a third shared library using CMake 4.1.2 with the first method, and it also caused the program to crash.

My project is located at the following path.
Please note that it should be run on Ubuntu 22 and compiled using the system-provided Qt 5.15.3.

🔗 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?

You must be logged in to vote

Replies: 0 comments

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
Q&A
Labels
None yet
1 participant
@YangKaiyun-a

[8]ページ先頭

©2009-2025 Movatter.jp