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

listenreality's profile - activity

2023-03-06 22:56:12 -0500 received badge  Famous Question (source)
2023-03-06 22:56:12 -0500 received badge  Notable Question (source)
2020-04-30 00:02:29 -0500 received badge  Famous Question (source)
2020-04-30 00:02:29 -0500 received badge  Notable Question (source)
2019-10-17 12:07:41 -0500 received badge  Popular Question (source)
2019-10-16 21:54:35 -0500 commented answer Nodelets from 2 different pkg

thank you all for help!

2019-10-16 21:39:21 -0500 commented answer Nodelets from 2 different pkg

So, it means: one nodelet manager = one pkg. Cannot include nodelet from other pkg?

2019-10-16 06:25:21 -0500 asked a question Nodelets from 2 different pkg

Nodelets from 2 different pkg Hi. How Can I use different node as a nodelet in my pkg? For example, I have two pkg: f

2019-10-10 00:40:03 -0500 received badge  Enthusiast
2019-09-29 08:54:36 -0500 received badge  Popular Question (source)
2019-09-24 07:00:46 -0500 marked best answer nodelets problem

Hi. I'm trying to create a custom pgk with nodelets. I read already manual http://wiki.ros.org/nodelet/Tutorials... And for more understanding I use the pkg: https://github.com/tysik/obstacle_det... And I got error

[ERROR] [1569303210.735895568]:Loader::load Failed to load nodelet [/test_nodelet1] of type [safety_zones/TestNodelet1] even after refreshing the cache: MultiLibraryClassLoader: Could not create object of class type safety_zones::TestNodelet1Nodelet as no factory exists for it. Make sure that the library exists and was explicitly loaded through MultiLibraryClassLoader::loadLibrary()
[ERROR] [1569303210.735951283]:Loader::load The error before refreshing the cache was: MultiLibraryClassLoader: Could not create object of class type safety_zones::TestNodelet1Nodelet as no factory exists for it. Make sure that the library exists and was explicitly loaded through MultiLibraryClassLoader::loadLibrary()

Any help, please. Thank you!

CMakeList.txt

cmake_minimum_required(VERSION 2.8.3)
project(safety_zones)

## Compile as C++11, supported in ROS Kinetic and newer
# add_compile_options(-std=c++11)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
find_package(catkin REQUIRED COMPONENTS
  roscpp
  roslaunch
  sensor_msgs
  std_msgs
  std_srvs
  pluginlib
  nodelet
)


###################################
## catkin specific configuration ##
###################################
## The catkin_package macro generates cmake config files for your package
## Declare things to be passed to dependent projects
## INCLUDE_DIRS: uncomment this if your package contains header files
## LIBRARIES: libraries you create in this project that dependent projects also need
## CATKIN_DEPENDS: catkin_packages dependent projects also need
## DEPENDS: system dependencies of this project that dependent projects also need
catkin_package(
  INCLUDE_DIRS include
  LIBRARIES test_nodelet1 test_nodelet2 ${PROJECT_NAME}_nodelets
  CATKIN_DEPENDS
    roscpp
    roslaunch
    sensor_msgs
    std_msgs
    std_srvs
    pluginlib
    nodelet
#  DEPENDS system_lib
)

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

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

## Declare a C++ library

add_library(test_nodelet1 src/test_nodelet1.cpp)
target_link_libraries(test_nodelet1 ${catkin_LIBRARIES})
add_dependencies(test_nodelet1 ${catkin_EXPORTED_TARGETS})

add_library(test_nodelet2 src/test_nodelet2.cpp)
target_link_libraries(test_nodelet2 ${catkin_LIBRARIES})
add_dependencies(test_nodelet2 ${catkin_EXPORTED_TARGETS})

#
# Build nodes
#

add_executable(test_nodelet1_node src/nodes/test_nodelet1_node.cpp)
target_link_libraries(test_nodelet1_node test_nodelet1)

add_executable(test_nodelet2_node src/nodes/test_nodelet2_node.cpp)
target_link_libraries(test_nodelet2_node test_nodelet2)

#
# Build nodelets
#
add_library(${PROJECT_NAME}_nodelets
  src/nodelets/test_nodelet1_nodelet.cpp
  src/nodelets/test_nodelet2_nodelet.cpp)
target_link_libraries(${PROJECT_NAME}_nodelets test_nodelet1 test_nodelet2)


#
# Install libraries
#
install(TARGETS test_nodelet1 test_nodelet2 ${PROJECT_NAME}_nodelets 
  ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
  LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
  RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION})


#
# Install nodes
#
install(TARGETS test_nodelet1_node test_nodelet2_node
  RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION})


#
# Install header files
#
install(DIRECTORY include/${PROJECT_NAME}/
  DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION})


#
# Install nodelet #and rviz plugins description
#
install(FILES nodelet_plugins.xml
  DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION})

package.xml

<?xml version="1.0"?>
<package format="2">
  <name>safety_zones</name>
  <version>0.0.0</version>
  <description>The safety_zones package</description>

  <!-- One maintainer tag required, multiple allowed, one person per tag -->
  <!-- Example:  -->
  <!-- <maintainer email="jane.doe@example.com">Jane Doe</maintainer> -->
  <maintainer email=""></maintainer>

  <license>TODO</license>
   <buildtool_depend>catkin</buildtool_depend>

  <build_depend>roscpp</build_depend>
  <build_depend>roslaunch</build_depend>
  <build_depend>sensor_msgs</build_depend>
  <build_depend>std_msgs</build_depend>
  <build_depend>std_srvs</build_depend>
  <build_export_depend>roscpp</build_export_depend>
  <build_export_depend>roslaunch</build_export_depend>
  <build_export_depend>sensor_msgs</build_export_depend>
  <build_export_depend>std_msgs</build_export_depend>
  <build_export_depend>std_srvs</build_export_depend>
  <exec_depend>roscpp</exec_depend>
  <exec_depend>roslaunch</exec_depend>
  <exec_depend>sensor_msgs</exec_depend>
  <exec_depend>std_msgs</exec_depend>
  <exec_depend>std_srvs</exec_depend>
  <exec_depend>pluginlib</exec_depend>
  <build_depend>pluginlib</build_depend>
  <build_depend>nodelet</build_depend>
  <exec_depend>nodelet</exec_depend>

  <!-- The export ...
(more)
2019-09-24 07:00:46 -0500 received badge  Scholar (source)
2019-09-24 03:00:21 -0500 commented question nodelets problem

@Delb Thanks, that helped!

2019-09-24 02:59:05 -0500 commented question nodelets problem

@gvdhoorn so, I changed it to C++11, and still got the error

2019-09-24 01:00:08 -0500 asked a question nodelets problem

nodelets problem Hi. I'm trying to create a custom pgk with nodelets. I read already manual http://wiki.ros.org/nodelet