GithubHelp home page GithubHelp logo

Comments (9)

piraka9011 avatar piraka9011 commented on May 22, 2024 1

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.

miccol avatar miccol commented on May 22, 2024

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.

piraka9011 avatar piraka9011 commented on May 22, 2024

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.

miccol avatar miccol commented on May 22, 2024

could it be that you are missing a dependency in your package.xml (in frasier_behavior)?

from ros-behavior-tree.

piraka9011 avatar piraka9011 commented on May 22, 2024

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.

miccol avatar miccol commented on May 22, 2024

could it be related to this: https://answers.ros.org/question/9338/cannot-find-libraries-when-linking/

from ros-behavior-tree.

piraka9011 avatar piraka9011 commented on May 22, 2024

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.

miccol avatar miccol commented on May 22, 2024

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.

miccol avatar miccol commented on May 22, 2024

great!

from ros-behavior-tree.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.