Comments (9)
Solved it by changing catkin_package()
in behavior_tree_core
's CMakeLists.txt to:
catkin_package(
CATKIN_DEPENDS actionlib_msgs
INCLUDE_DIRS include
LIBRARIES ${PROJECT_NAME} # Added this line
)
Compiled with catkin_make
and catkin build
. Executables do run. Did not have to change target_link_libraries()
. This is what I have currently:
target_link_libraries(spr_bt
${catkin_LIBRARIES}
)
If I add behavior_tree_core
it does not compile, if I add ${behavior_tree_core_LIBRARIES}
it compiles. See #21
from ros-behavior-tree.
Hi,
Thank you for using the library.
The warnings are due to CMake and they will be removed eventually (ros/catkin#796).
I just tried to compile with catkin build and it seemed to work.
I suspect that you are running catkin build
in the same workspace that you compile with catkin_make
(in that case it cannot work as the generated files are different). If that is the case, can you try to run catking build in a new workspace (initialized with catkin init
and not catkin_initialize_workspace
) and get back to me?
Another option is to run catkin clean
clean first but I suggest to avoid having to swtich back and forth, unless necessary.
Regards
MC
from ros-behavior-tree.
A made a clean workspace initialized with catkin init
. It has 2 packages only, the ROS-Behavior-Tree
and my other package using the behavior tree frasier_behavior
. frasier_behavior
still returns the same error as above:
/usr/bin/ld: cannot find -lbehavior_tree_core
collect2: error: ld returned 1 exit status
Here is frasier_behavior
's CMakeLists:
cmake_minimum_required(VERSION 2.8.3)
project(frasier_behavior)
add_compile_options(-std=c++11)
add_definitions(-Wall -Wno-deprecated -Wno-dev -static -Bstatic -std=gnu++0x)
find_package(catkin REQUIRED COMPONENTS
actionlib_msgs
actionlib
behavior_tree_core
behavior_tree_leaves
genmsg
message_generation
roscpp
rospy
roslib
geometry_msgs
)
catkin_package(
CATKIN_DEPENDS roscpp rospy behavior_tree_leaves behavior_tree_core message_runtime
)
###########
## Build ##
###########
include_directories(
include
${catkin_INCLUDE_DIRS}
)
# Main BT Node
add_executable(spr_bt src/spr_bt.cpp)
target_link_libraries(spr_bt
${catkin_LIBRARIES}
behavior_tree_core
)
add_dependencies(spr_bt
${catkin_EXPORTED_TARGETS}
${PROJECT_NAME}_generate_messages_cpp
behavior_tree_core_generate_messages_cpp
)
from ros-behavior-tree.
could it be that you are missing a dependency in your package.xml (in frasier_behavior
)?
from ros-behavior-tree.
I don't think so. Below is my package.xml
:
<buildtool_depend>catkin</buildtool_depend>
<build_depend>actionlib</build_depend>
<build_depend>actionlib_msgs</build_depend>
<build_depend>behavior_tree_core</build_depend>
<build_depend>behavior_tree_leaves</build_depend>
<build_depend>genmsg</build_depend>
<build_depend>geometry_msgs</build_depend>
<build_depend>message_generation</build_depend>
<build_depend>roscpp</build_depend>
<build_depend>rospy</build_depend>
<run_depend>actionlib</run_depend>
<run_depend>actionlib_msgs</run_depend>
<run_depend>behavior_tree_core</run_depend>
<run_depend>behavior_tree_leaves</run_depend>
<run_depend>genmsg</run_depend>
<run_depend>geometry_msgs</run_depend>
<run_depend>message_runtime</run_depend>
<run_depend>roscpp</run_depend>
<run_depend>rospy</run_depend>
Double checked and still have the same error unfortunately.
from ros-behavior-tree.
could it be related to this: https://answers.ros.org/question/9338/cannot-find-libraries-when-linking/
from ros-behavior-tree.
Add the following to my CMake: link_directories(${CATKIN_DEVEL_PREFIX}/lib)
Still didn't fix the issue (although I do see a libbehavior_tree_core.so
file in there!)
Could this be an issue where behavior tree core package is not compiled as a library but rather just as certain executables?
from ros-behavior-tree.
I never used catkin build so I am not sure where the problem could be but we can work together to fix it.
try to change
target_link_libraries(spr_bt
${catkin_LIBRARIES}
behavior_tree_core
)
to
target_link_libraries(spr_bt
${catkin_LIBRARIES}
${behavior_tree_core_LIBRARIES}
)
from ros-behavior-tree.
great!
from ros-behavior-tree.
Related Issues (20)
- Improve tree positioning in visualization HOT 4
- Create a BT with external Nodes HOT 6
- Problems about Segmentation fault HOT 5
- Example does not function as expected HOT 3
- BT::ROSAction::WaitForTick takes up 100% cpu time HOT 1
- Enquiry about new action HOT 3
- full example with external ROS nodes? HOT 3
- add status names to output. HOT 1
- Looking for ROS2 port HOT 1
- BT node display overlap problem HOT 1
- Problem of passing parameters to leaf node and repeated mount of leaf nodes HOT 1
- Pros and Cons for ROS-Behavior-Tree HOT 1
- Using the Parallel Node HOT 1
- Sequence with memory: Return to first Child node by Failure HOT 3
- compile error
- Action and condition templates use wrong namespace for the action servers template class HOT 5
- Prebuilt binary packages HOT 3
- Compliance of C++ style with ROS linter HOT 3
- NameError: global name 'behavior_tree_leaves' is not defined HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ros-behavior-tree.