Ask Your Question
0

dynamic_reconfigure function not found during link

asked 2014-05-26 23:22:43 -0500

dreamcase gravatar image

updated 2014-05-27 02:32:51 -0500

Hi,

I am trying to use AMCL for localization. when instantiating AMCLConfig it refers to dynamic_reconfigure package.

so I added following statements in the CMakelists.txt

cmake_minimum_required(VERSION 2.8.3)
include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake)
project(agv)
set(EXECUTABLE_OUTPUT_PATH bin)

find_package(catkin REQUIRED COMPONENTS 
message_filters 
laser_geometry 
roscpp 
rospy
geometry_msgs 
std_msgs 
nav_msgs
sensor_msgs
tf2_msgs
actionlib_msgs 
amcl
tf
genmsg 
dynamic_reconfigure
message_generation )

set(Boost_USE_MULTITHREADED ON)
find_package(Boost COMPONENTS thread date_time program_options filesystem system REQUIRED)

rosbuild_add_boost_directories()
find_package(catkin REQUIRED tf)

# dynamic reconfigure
generate_dynamic_reconfigure_options(
    src/navigation_node/cfg/AMCL.cfg
)

###########
include(FindProtobuf)
find_package(Protobuf REQUIRED)
include_directories(${PROTOBUF_INCLUDE_DIR})

find_package(Eigen REQUIRED)
include_directories(${EIGEN_INCLUDE_DIRS})
add_definitions(${EIGEN_DEFINITIONS})
############

## System dependencies are found with CMake's conventions
find_package(Boost REQUIRED COMPONENTS system thread log log_setup program_options)
find_package( Threads )

 add_message_files(
   FILES
   agv.msg
   laser.msg
   lasergeo.msg
   nav_odo.msg
   tf_msg.msg
#   Message1.msg
#   Message2.msg
 )

 generate_messages(
   DEPENDENCIES
   geometry_msgs
   sensor_msgs
   nav_msgs
   std_msgs
   tf2_msgs
 )

catkin_package(
#  INCLUDE_DIRS include ../include ..
#  LIBRARIES beginner_tutorials
  CATKIN_DEPENDS 
  roscpp
  rospy
  std_msgs
  geometry_msgs
  sensor_msgs
  tf2_msgs
  nav_msgs
  message_runtime
  message_filters
  tf
  #dynamic_reconfigure
  DEPENDS system_lib 
  LIBRARIES laser_geometry
  DEPENDS boost Eigen
  #INCLUDE_DIRS include
  LIBRARIES amcl_sensors amcl_map amcl_pf
)

include_directories(include  ${catkin_INCLUDE_DIRS} ../include ../third_party_lib/include)

set(LASER_PATH src/laser_node)
add_executable(Node_laser ${LASER_PATH}/LMS1xx_node.cpp ${LASER_PATH}/LMS1xx.cpp)
add_dependencies(Node_laser laser_generate_cpp)
target_link_libraries(Node_laser   pthread boost_filesystem boost_system log4cpp)
target_link_libraries(Node_laser   ${catkin_LIBRARIES})
#target_link_libraries (Node_laser /opt/ros/hydro/lib/lms1xx/LMS1xx_node )
target_link_libraries(Node_laser
    ${Boost_FILESYSTEM_LIBRARY}
    ${Boost_SYSTEM_LIBRARY}
    ${PROTOBUF_LIBRARY}
)
add_definitions("-std=c++0x -pthread -llog4cpp")

set(LOCALIZATION_PATH src/localization_node)
add_library(laser_geometry ${LOCALIZATION_PATH}/laser_geometry.cpp)
target_link_libraries(laser_geometry ${Boost_LIBRARIES} ${tf_LIBRARIES})
add_executable(Node_localization ${LOCALIZATION_PATH}/main.cpp)
add_dependencies(Node_localization localization_generate_cpp)
target_link_libraries(Node_localization   boost_filesystem boost_system boost_thread log4cpp)
target_link_libraries(Node_localization   ${catkin_LIBRARIES})
target_link_libraries(Node_localization laser_geometry)
target_link_libraries(Node_localization
    ${Boost_FILESYSTEM_LIBRARY}
    ${Boost_SYSTEM_LIBRARY}
    ${PROTOBUF_LIBRARY}
)
add_definitions("-std=c++0x -pthread -llog4cpp -eigen3")

add_library(amcl_pf
                    src/navigation_node/amcl/pf/pf.c 
                    src/navigation_node/amcl/pf/pf_kdtree.c
                    src/navigation_node/amcl/pf/pf_pdf.c
                    src/navigation_node/amcl/pf/pf_vector.c
                    src/navigation_node/amcl/pf/eig3.c
                    src/navigation_node/amcl/pf/pf_draw.c)

add_library(amcl_map
                    src/navigation_node/amcl/map/map.c
                    src/navigation_node/amcl/map/map_cspace.cpp
                    src/navigation_node/amcl/map/map_range.c
                    src/navigation_node/amcl/map/map_store.c
                    src/navigation_node/amcl/map/map_draw.c)

add_library(amcl_sensors
                    src/navigation_node/amcl/sensors/amcl_sensor.cpp
                    src/navigation_node/amcl/sensors/amcl_odom.cpp
                    src/navigation_node/amcl/sensors/amcl_laser.cpp)
target_link_libraries(amcl_sensors amcl_map amcl_pf)
set(NAVI_PATH src/navigation_node)
#include_directories(${catkin_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS})
add_executable(Node_navi ${NAVI_PATH}/amcl_node.cpp)
add_dependencies(Node_navi navi_generate_cpp)
target_link_libraries(Node_navi   amcl_sensors amcl_map amcl_pf pthread boost_filesystem boost_system )
target_link_libraries(Node_navi   ${catkin_LIBRARIES})
target_link_libraries(Node_navi   ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${PROTOBUF_LIBRARY} ${Boost_LIBRARIES}  ${CMAKE_THREAD_LIBS_INIT})
add_definitions("-std=c++0x -pthread")

and package dependency in package.xml But, during LINK, the linker always complains not able to find packaged function `dynamic_reconfigure::__init_mutex__'

amcl_node.cpp:(.text._ZN4amcl10AMCLConfig15__get_statics__Ev[amcl::AMCLConfig::__get_statics__()]+0x23): undefined reference to `dynamic_reconfigure::__init_mutex__'

am I missing anything here?

edit retag flag offensive close merge delete

Comments

Please post your complete CMakeLists.txt. This is the easiest way for us to help you.

BennyRe gravatar imageBennyRe ( 2014-05-27 00:31:58 -0500 )edit

here u go. :)

dreamcase gravatar imagedreamcase ( 2014-05-27 02:33:58 -0500 )edit

dynamic_reconfigure is commented out in your catkin_package(). What happens if you remove the #

BennyRe gravatar imageBennyRe ( 2014-05-27 20:09:43 -0500 )edit

doesn't change ...

dreamcase gravatar imagedreamcase ( 2014-05-29 16:22:40 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2016-11-03 11:10:19 -0500

joq gravatar image
edit flag offensive delete link more
0

answered 2016-11-03 05:18:29 -0500

aamir gravatar image

Hi dreamcase, did you find a solution to this? I seem to have the exact same issue :(.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2014-05-26 23:22:43 -0500

Seen: 834 times

Last updated: Nov 03 '16