ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

sumperfees's profile - activity

2019-12-05 06:40:13 -0500 received badge  Great Question (source)
2018-10-09 07:24:14 -0500 received badge  Good Question (source)
2016-09-16 08:17:01 -0500 received badge  Famous Question (source)
2016-08-05 06:18:22 -0500 received badge  Notable Question (source)
2016-08-05 06:18:22 -0500 received badge  Popular Question (source)
2016-07-22 15:28:51 -0500 received badge  Famous Question (source)
2016-06-17 04:10:04 -0500 received badge  Enthusiast
2016-06-16 11:36:56 -0500 received badge  Nice Question (source)
2016-06-16 09:04:43 -0500 received badge  Supporter (source)
2016-06-16 06:06:20 -0500 received badge  Student (source)
2016-06-16 05:18:44 -0500 received badge  Editor (source)
2016-06-16 05:04:53 -0500 asked a question "The library is neither a target nor built/installed properly"

Hello, Hello I have a package called wp3_driver_pkg which builds without errors when I build it alone but when I'm trying to use it in another package (ur10) I have the following error :


  Project 'ur10' tried to find library 'wp3_driver_pkg'.  The library is
  neither a target nor built/installed properly.  Did you compile project
  'wp3_driver_pkg'? Did you find_package() it before the subdirectory
  containing its code is included?

The package wp3_driver_pkg has been added to the ur10 package.xml for build and run. and is called in the cmakefile.txt of the ur10:


find_package( wp3_driver_pkg REQUIRED)

This is the catkin_package() in the cmakefile.txt for the wp3_driver_pkg


catkin_package(
INCLUDE_DIRS include
LIBRARIES ${PROJECT_NAME} wp3_driver_lib
CATKIN_DEPENDS message_runtime roscpp rospy roslib ${MSG_DEPS}
)

the wp3_driver_lib is a library added in the same cmakefile with the source file



 add_library(wp3_driver_lib
         src/wp3_driver.cpp
)
target_link_libraries(wp3_driver_lib
        ${catkin_LIBRARIES}
)

I can even see the package being built before in the terminal : image description

And if I use the command "rospack fin wp3_driver_pkg" just after the failed compilation and the package is found, even if I suppress the devel and build folder of the workspace.

Thanks for the answers if you see what I'm doing wrong !

2016-06-10 10:44:56 -0500 received badge  Scholar (source)
2016-06-10 10:44:51 -0500 received badge  Notable Question (source)
2016-06-02 12:58:54 -0500 received badge  Popular Question (source)
2016-06-02 07:21:02 -0500 commented question Catkin/Ros “undefined reference to”

I just checked, all the functions in errors are implemented, for exemple : //header template <typename t=""> class List_Container{ .....; T * getElement(int i);.....}
//cpp template <class t=""> T *List_Container<t>::getElement(int i){ return this->list[i]; }
list is a vector of T

2016-06-01 13:32:43 -0500 asked a question Catkin/Ros “undefined reference to”

I'm trying to build a project with ROS, but I keep getting "undefined reference to <<class::function>>" errors, for exemple :



    CMakeFiles/robot_controller_node.dir/src/Node_Robot_Controller.cpp.o: dans la fonction « main »:
    Node_Robot_Controller.cpp:(.text+0x1f1): référence indéfinie vers « trajectoryclass::trajectoryclass(ros::NodeHandle) »
    Node_Robot_Controller.cpp:(.text+0x796): référence indéfinie vers « List_Container<task_interface>::getElement(int) »
    Node_Robot_Controller.cpp:(.text+0x7ab): référence indéfinie vers « Task_Interface::getTaskDescription() »
    Node_Robot_Controller.cpp:(.text+0x7d1): référence indéfinie vers « List_Container<task_interface>::getElement(int) »
    Node_Robot_Controller.cpp:(.text+0x7d9): référence indéfinie vers « Task_Interface::getTaskId() »
    Node_Robot_Controller.cpp:(.text+0x83a): référence indéfinie vers « List_Container<task_interface>::getElement(int) »
    Node_Robot_Controller.cpp:(.text+0x977): référence indéfinie vers « List_Container<task_interface>::next() »
    Node_Robot_Controller.cpp:(.text+0xa60): référence indéfinie vers « List_Container<task_interface>::getElement(int) »
    Node_Robot_Controller.cpp:(.text+0xa68): référence indéfinie vers « Task_Interface::getTaskId() »
    Node_Robot_Controller.cpp:(.text+0xab5): référence indéfinie vers « List_Container<task_interface>::getElement(int) »
    Node_Robot_Controller.cpp:(.text+0xadd): référence indéfinie vers « List_Container<task_interface>::isEmpty() »
    /home/tcozic/Documents/git_ur10/catkin_ws/devel/lib/librobot_controller_library.so: référence indéfinie vers « error_norm(std::vector<double, std::allocator<double=""> >, std::vector<double, std::allocator<double=""> >) »
    /home/tcozic/Documents/git_ur10/catkin_ws/devel/lib/librobot_controller_library.so: référence indéfinie vers « Position_Joint::getVector() »
    collect2: error: ld returned 1 exit status
    make[2]: *** [/home/tcozic/Documents/git_ur10/catkin_ws/devel/lib/ur10/robot_controller_node] Erreur 1
    make[1]: *** [ur10/CMakeFiles/robot_controller_node.dir/all] Erreur 2
    make: *** [all] Erreur 2
    Invoking "make install -j4 -l4" failed

This is my CmakeLists.txt for the compilation of this package :

<pre><code>
cmake_minimum_required(VERSION 2.8.3)
project(ur10)

set(MSG_DEPS
  std_msgs
  sensor_msgs
  geometry_msgs
  trajectory_msgs
  moveit_msgs
)


find_package(catkin REQUIRED COMPONENTS
  message_generation
  moveit_core
  moveit_ros_planning
  moveit_ros_planning_interface
  dynamic_reconfigure
  moveit_ros_move_group
  pcl_conversions ##adding
  pcl_msgs ##adding
  roscpp
  rospy
  roslib
  #tf
  #urdf
  genmsg
 ${MSG_DEPS}
)




find_package(VISP REQUIRED)
find_library(VISP_LIBRARIES NAMES visp HINTS ${VISP_LIBRARY_DIRS} )

find_package(PCL REQUIRED)
find_package(OpenCV REQUIRED)

find_package( ur_package REQUIRED)

## Generate messages in the 'msg' folder
 add_message_files(
   FILES
   Task_move.msg
   Task_wait.msg
   Piece.msg
   Task.msg
   Task_tool.msg
 )
# Generate services in the 'srv' folder
 add_service_files(
   FILES
   Validation.srv
   NewPiece.srv
 )

## Generate added messages and services with any dependencies listed here
 generate_messages(
   DEPENDENCIES
   std_msgs  # Or other packages containing msgs
 )
catkin_package(
  INCLUDE_DIRS include
  LIBRARIES ${PROJECT_NAME}
  CATKIN_DEPENDS message_runtime roscpp rospy roslib moveit_core moveit_ros_planning_interface   #moveit_plan_execution
 moveit_trajectory_execution_manager moveit_ros_planning  moveit_planning_scene_monitor ${MSG_DEPS}
  DEPENDS VISP OpenCV
)


###########
## Build ##
###########


include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
if(COMPILER_SUPPORTS_CXX11)
    set(CMAKE_CXX_FLAGS "-std=c++11")
elseif(COMPILER_SUPPORTS_CXX0X)
    set(CMAKE_CXX_FLAGS "-std=c++0x")
else()
    message(FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler. Suggested solution: update the pkg build-essential ")
endif()


## Specify additional locations of header files
## Your package locations should be listed before other locations
include_directories(include ${catkin_INCLUDE_DIRS})
include_directories(${ur_package_INCLUDE_DIRS})

## Declare a C++ library
 add_library(robot_controller_library
     src/List_Container/List_Container.cpp

     src/Piece_Description/Piece.cpp

     src/Robot_Description/Robot.cpp
     src/Robot_Description/Tool.cpp
     src/Robot_Description/Tool_IO_Config.cpp

     src/Position/Position_Interface.cpp
     src/Position/Position_Joint.cpp
     src/Position/Position_TCP.cpp

     src/Task/Task_Move.cpp
     src/Task/Task_Tool.cpp
     src/Task/Task_Wait.cpp
 )
add_dependencies(robot_controller_library ur10_gencpp)

# Declare a C++ executable
add_executable(robot_controller_node src/Node_Robot_Controller.cpp)
 #add_dependencies(robot_controller ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
 target_link_libraries(robot_controller_node  robot_controller_library ${catkin_LIBRARIES} ${VISP_LIBRARIES ...
(more)