Failed to load nodelet [/local_planner_node] of type [LocalPlannerNodelet]

Hello,
I am trying to run the local_planner with the install folder (output of cantkin build with config --install) on an Intel compute stick with UBUNTU 18.04 LTS and ROS Melodic with the minimal setup.

This is the output of my avoidance.launch:

SUMMARY
========

CLEAR PARAMETERS
 * /mavros/

PARAMETERS
 * /D435i/realsense2_camera/accel_fps: 0
 * /D435i/realsense2_camera/accel_frame_id: D435i_accel_frame
 * /D435i/realsense2_camera/accel_optical_frame_id: D435i_accel_optic...
 * /D435i/realsense2_camera/align_depth: False
 * /D435i/realsense2_camera/aligned_depth_to_color_frame_id: D435i_aligned_dep...
 * /D435i/realsense2_camera/aligned_depth_to_fisheye1_frame_id: D435i_aligned_dep...
 * /D435i/realsense2_camera/aligned_depth_to_fisheye2_frame_id: D435i_aligned_dep...
 * /D435i/realsense2_camera/aligned_depth_to_fisheye_frame_id: D435i_aligned_dep...
 * /D435i/realsense2_camera/aligned_depth_to_infra1_frame_id: D435i_aligned_dep...
 * /D435i/realsense2_camera/aligned_depth_to_infra2_frame_id: D435i_aligned_dep...
 * /D435i/realsense2_camera/allow_no_texture_points: False
 * /D435i/realsense2_camera/base_frame_id: D435i_link
 * /D435i/realsense2_camera/calib_odom_file: 
 * /D435i/realsense2_camera/clip_distance: -1.0
 * /D435i/realsense2_camera/color_fps: 15
 * /D435i/realsense2_camera/color_frame_id: D435i_color_frame
 * /D435i/realsense2_camera/color_height: 480
 * /D435i/realsense2_camera/color_optical_frame_id: D435i_color_optic...
 * /D435i/realsense2_camera/color_width: 640
 * /D435i/realsense2_camera/depth_fps: 30
 * /D435i/realsense2_camera/depth_frame_id: D435i_depth_frame
 * /D435i/realsense2_camera/depth_height: 480
 * /D435i/realsense2_camera/depth_optical_frame_id: D435i_depth_optic...
 * /D435i/realsense2_camera/depth_width: 640
 * /D435i/realsense2_camera/device_type: 
 * /D435i/realsense2_camera/enable_accel: False
 * /D435i/realsense2_camera/enable_color: False
 * /D435i/realsense2_camera/enable_depth: True
 * /D435i/realsense2_camera/enable_fisheye1: False
 * /D435i/realsense2_camera/enable_fisheye2: False
 * /D435i/realsense2_camera/enable_fisheye: False
 * /D435i/realsense2_camera/enable_gyro: False
 * /D435i/realsense2_camera/enable_infra1: True
 * /D435i/realsense2_camera/enable_infra2: False
 * /D435i/realsense2_camera/enable_infra: False
 * /D435i/realsense2_camera/enable_pointcloud: False
 * /D435i/realsense2_camera/enable_pose: False
 * /D435i/realsense2_camera/enable_sync: False
 * /D435i/realsense2_camera/filters: 
 * /D435i/realsense2_camera/fisheye1_frame_id: D435i_fisheye1_frame
 * /D435i/realsense2_camera/fisheye1_optical_frame_id: D435i_fisheye1_op...
 * /D435i/realsense2_camera/fisheye2_frame_id: D435i_fisheye2_frame
 * /D435i/realsense2_camera/fisheye2_optical_frame_id: D435i_fisheye2_op...
 * /D435i/realsense2_camera/fisheye_fps: 30
 * /D435i/realsense2_camera/fisheye_frame_id: D435i_fisheye_frame
 * /D435i/realsense2_camera/fisheye_height: 0
 * /D435i/realsense2_camera/fisheye_optical_frame_id: D435i_fisheye_opt...
 * /D435i/realsense2_camera/fisheye_width: 0
 * /D435i/realsense2_camera/gyro_fps: 0
 * /D435i/realsense2_camera/gyro_frame_id: D435i_gyro_frame
 * /D435i/realsense2_camera/gyro_optical_frame_id: D435i_gyro_optica...
 * /D435i/realsense2_camera/imu_optical_frame_id: D435i_imu_optical...
 * /D435i/realsense2_camera/infra1_frame_id: D435i_infra1_frame
 * /D435i/realsense2_camera/infra1_optical_frame_id: D435i_infra1_opti...
 * /D435i/realsense2_camera/infra2_frame_id: D435i_infra2_frame
 * /D435i/realsense2_camera/infra2_optical_frame_id: D435i_infra2_opti...
 * /D435i/realsense2_camera/infra_fps: 15
 * /D435i/realsense2_camera/infra_height: 480
 * /D435i/realsense2_camera/infra_width: 640
 * /D435i/realsense2_camera/initial_reset: False
 * /D435i/realsense2_camera/json_file_path: /home/ctrazzi/ins...
 * /D435i/realsense2_camera/linear_accel_cov: 0.01
 * /D435i/realsense2_camera/odom_frame_id: D435i_odom_frame
 * /D435i/realsense2_camera/pointcloud_texture_index: 0
 * /D435i/realsense2_camera/pointcloud_texture_stream: RS2_STREAM_COLOR
 * /D435i/realsense2_camera/pose_frame_id: D435i_pose_frame
 * /D435i/realsense2_camera/pose_optical_frame_id: D435i_pose_optica...
 * /D435i/realsense2_camera/publish_odom_tf: True
 * /D435i/realsense2_camera/publish_tf: True
 * /D435i/realsense2_camera/rosbag_filename: 
 * /D435i/realsense2_camera/serial_no: 021122070141
 * /D435i/realsense2_camera/tf_publish_rate: 0.0
 * /D435i/realsense2_camera/topic_odom_in: D435i/odom_in
 * /D435i/realsense2_camera/unite_imu_method: none
 * /D435i/realsense2_camera/usb_port_id: 
 * /local_planner_node/goal_x_param: 0
 * /local_planner_node/goal_y_param: 0
 * /local_planner_node/goal_z_param: 4
 * /local_planner_node/pointcloud_topics: ['/D435i/depth/po...
 * /mavros/cmd/use_comp_id_system_control: False
 * /mavros/conn/heartbeat_rate: 1.0
 * /mavros/conn/system_time_rate: 1.0
 * /mavros/conn/timeout: 10.0
 * /mavros/conn/timesync_rate: 10.0
 * /mavros/distance_sensor/hrlv_ez4_pub/field_of_view: 0.0
 * /mavros/distance_sensor/hrlv_ez4_pub/frame_id: hrlv_ez4_sonar
 * /mavros/distance_sensor/hrlv_ez4_pub/id: 0
 * /mavros/distance_sensor/hrlv_ez4_pub/orientation: ROLL_180
 * /mavros/distance_sensor/hrlv_ez4_pub/send_tf: True
 * /mavros/distance_sensor/hrlv_ez4_pub/sensor_position/x: 0.0
 * /mavros/distance_sensor/hrlv_ez4_pub/sensor_position/y: 0.0
 * /mavros/distance_sensor/hrlv_ez4_pub/sensor_position/z: -0.1
 * /mavros/distance_sensor/laser_1_sub/id: 3
 * /mavros/distance_sensor/laser_1_sub/orientation: ROLL_180
 * /mavros/distance_sensor/laser_1_sub/subscriber: True
 * /mavros/distance_sensor/lidarlite_pub/field_of_view: 0.0
 * /mavros/distance_sensor/lidarlite_pub/frame_id: lidarlite_laser
 * /mavros/distance_sensor/lidarlite_pub/id: 1
 * /mavros/distance_sensor/lidarlite_pub/orientation: ROLL_180
 * /mavros/distance_sensor/lidarlite_pub/send_tf: True
 * /mavros/distance_sensor/lidarlite_pub/sensor_position/x: 0.0
 * /mavros/distance_sensor/lidarlite_pub/sensor_position/y: 0.0
 * /mavros/distance_sensor/lidarlite_pub/sensor_position/z: -0.1
 * /mavros/distance_sensor/sonar_1_sub/id: 2
 * /mavros/distance_sensor/sonar_1_sub/orientation: ROLL_180
 * /mavros/distance_sensor/sonar_1_sub/subscriber: True
 * /mavros/fcu_protocol: v2.0
 * /mavros/fcu_url: /dev/ttyACM0:57600
 * /mavros/gcs_url: udp://@10.0.0.56
 * /mavros/global_position/frame_id: fcu
 * /mavros/global_position/rot_covariance: 99999.0
 * /mavros/global_position/tf/child_frame_id: fcu_utm
 * /mavros/global_position/tf/frame_id: local_origin
 * /mavros/global_position/tf/send: False
 * /mavros/image/frame_id: px4flow
 * /mavros/imu/angular_velocity_stdev: 0.0003490659 // 0...
 * /mavros/imu/frame_id: fcu
 * /mavros/imu/linear_acceleration_stdev: 0.0003
 * /mavros/imu/magnetic_stdev: 0.0
 * /mavros/imu/orientation_stdev: 1.0
 * /mavros/local_position/frame_id: local_origin
 * /mavros/local_position/tf/child_frame_id: fcu
 * /mavros/local_position/tf/frame_id: local_origin
 * /mavros/local_position/tf/send: True
 * /mavros/local_position/tf/send_fcu: False
 * /mavros/mission/pull_after_gcs: True
 * /mavros/mocap/use_pose: False
 * /mavros/mocap/use_tf: True
 * /mavros/odometry/fcu/odom_child_id_des: base_link
 * /mavros/odometry/fcu/odom_parent_id_des: map
 * /mavros/plugin_blacklist: ['safety_area', '...
 * /mavros/plugin_whitelist: []
 * /mavros/px4flow/frame_id: px4flow
 * /mavros/px4flow/ranger_fov: 0.118682
 * /mavros/px4flow/ranger_max_range: 5.0
 * /mavros/px4flow/ranger_min_range: 0.3
 * /mavros/safety_area/p1/x: 1.0
 * /mavros/safety_area/p1/y: 1.0
 * /mavros/safety_area/p1/z: 1.0
 * /mavros/safety_area/p2/x: -1.0
 * /mavros/safety_area/p2/y: -1.0
 * /mavros/safety_area/p2/z: -1.0
 * /mavros/setpoint_accel/send_force: False
 * /mavros/setpoint_attitude/reverse_throttle: False
 * /mavros/setpoint_attitude/tf/child_frame_id: attitude
 * /mavros/setpoint_attitude/tf/frame_id: local_origin
 * /mavros/setpoint_attitude/tf/listen: False
 * /mavros/setpoint_attitude/tf/rate_limit: 10.0
 * /mavros/setpoint_position/tf/child_frame_id: setpoint
 * /mavros/setpoint_position/tf/frame_id: local_origin
 * /mavros/setpoint_position/tf/listen: False
 * /mavros/setpoint_position/tf/rate_limit: 50.0
 * /mavros/startup_px4_usb_quirk: True
 * /mavros/sys/disable_diag: False
 * /mavros/sys/min_voltage: 10.0
 * /mavros/target_component_id: 1
 * /mavros/target_system_id: 1
 * /mavros/tdr_radio/low_rssi: 40
 * /mavros/time/time_ref_source: fcu
 * /mavros/time/timesync_avg_alpha: 0.6
 * /mavros/vibration/frame_id: vibration
 * /mavros/vision_pose/tf/child_frame_id: vision
 * /mavros/vision_pose/tf/frame_id: local_origin
 * /mavros/vision_pose/tf/listen: False
 * /mavros/vision_pose/tf/rate_limit: 10.0
 * /mavros/vision_speed/listen_twist: False
 * /rosdistro: melodic
 * /rosversion: 1.14.6

NODES
  /
    drop_D435i_depth (topic_tools/drop)
    drop_D435i_ir (topic_tools/drop)
    local_planner_node (local_planner/local_planner_node)
    mavros (mavros/mavros_node)
    rqt_param_toggle (local_planner/rqt_param_toggle.sh)
    tf_D435i (tf/static_transform_publisher)
  /D435i/
    points_xyz_sw_registered (nodelet/nodelet)
    realsense2_camera (nodelet/nodelet)
    realsense2_camera_manager (nodelet/nodelet)

auto-starting new master
process[master]: started with pid [19163]
ROS_MASTER_URI=http://localhost:11311

setting /run_id to 942eda88-cbef-11ea-9d65-00e04c6863e7
process[rosout-1]: started with pid [19174]
started core service [/rosout]
process[mavros-2]: started with pid [19182]
process[tf_D435i-3]: started with pid [19183]
process[D435i/realsense2_camera_manager-4]: started with pid [19184]
process[D435i/realsense2_camera-5]: started with pid [19185]
process[D435i/points_xyz_sw_registered-6]: started with pid [19191]
process[drop_D435i_depth-7]: started with pid [19192]
process[drop_D435i_ir-8]: started with pid [19202]
process[local_planner_node-9]: started with pid [19209]
process[rqt_param_toggle-10]: started with pid [19215]
[ INFO] [1595404047.596698327]: Initializing nodelet with 4 worker threads.
[ INFO] [1595404047.701604474]: Initializing nodelet with 4 worker threads.
**[ERROR] [1595404048.008635918]: Failed to load nodelet [/local_planner_node] of type [LocalPlannerNodelet] even after refreshing the cache: Failed to load library /home/ctrazzi/install/lib//liblocal_planner_nodelet.so. Make sure that you are calling the PLUGINLIB_EXPORT_CLASS macro in the library code, and that names are consistent between this macro and your XML. Error string: Could not load library (Poco exception = libavoidance.so: cannot open shared object file: No such file or directory)**
**[ERROR] [1595404048.009218255]: The error before refreshing the cache was: Failed to load library /home/ctrazzi/install/lib//liblocal_planner_nodelet.so. Make sure that you are calling the PLUGINLIB_EXPORT_CLASS macro in the library code, and that names are consistent between this macro and your XML. Error string: Could not load library (Poco exception = libavoidance.so: cannot open shared object file: No such file or directory)**
[ INFO] [1595404048.045112629]: FCU URL: /dev/ttyACM0:57600
[ INFO] [1595404048.055917471]: serial0: device: /dev/ttyACM0 @ 57600 bps
[ INFO] [1595404048.058368544]: GCS URL: udp://@10.0.0.56
[ INFO] [1595404048.062198428]: udp1: Bind address: 0.0.0.0:14555
[ INFO] [1595404048.062582815]: udp1: Remote address: 10.0.0.56:14550
[ INFO] [1595404048.390482495]: Plugin 3dr_radio loaded
[ INFO] [1595404048.397836802]: Plugin 3dr_radio initialized
[ INFO] [1595404048.398247051]: Plugin actuator_control loaded
[ INFO] [1595404048.411258304]: Plugin actuator_control initialized
[ INFO] [1595404048.634062825]: Plugin adsb loaded
[ INFO] [1595404048.648860063]: Plugin adsb initialized
[ INFO] [1595404048.649919713]: Plugin altitude loaded
[ INFO] [1595404048.655228409]: Plugin altitude initialized
etc ...

This is the launch file avoidance.launch generated from the modified generate_launchfile.sh:

<launch>
    <arg name="ns" default="/"/>
    
<arg name="fcu_url" default="/dev/ttyACM0:57600"/>
   	
<!--	<arg name="gcs_url" default="udp://@127.0.0.1"/> -->
   	 <arg name="gcs_url" default="udp://@10.0.0.56"/> 
<!-- <arg name="gcs_url" default="" /> --> <!-- GCS link is provided by SITL --> 

<arg name="tgt_system" default="1" />
    <arg name="tgt_component" default="1" />

    <!-- Launch MavROS -->
    <group ns="$(arg ns)">
        <include file="$(find mavros)/launch/node.launch">
            <arg name="pluginlists_yaml" value="$(find mavros)/launch/px4_pluginlists.yaml" />

            <!-- Need to change the config file to get the tf topic and get local position in terms of local origin -->
            <arg name="config_yaml" value="$(find local_planner)/px4_config.yaml" /> 
           	<!-- <arg name="config_yaml" value="$(find mavros)/launch/px4_config.yaml" /> -->

<arg name="fcu_url" value="$(arg fcu_url)" />
            <arg name="gcs_url" value="$(arg gcs_url)" />
            <arg name="tgt_system" value="$(arg tgt_system)" />
            <arg name="tgt_component" value="$(arg tgt_component)" />
        </include>
    </group>

    <!-- Launch cameras -->
<node pkg="tf" type="static_transform_publisher" name="tf_D435i" required="true"
 args="0.3 0.32 -0.11 0 0 0 fcu D435i_link 10"/>
  
<include file="$(find local_planner)/rs_depthcloud.launch">
<arg name="required"              value="true"/>
<arg name="namespace"             value="D435i" />
<arg name="tf_prefix"             value="D435i" />
<arg name="serial_no"             value="021122070141"/>
<arg name="depth_fps"             value="30"/>
</include>

      <!-- launch node to throttle depth images for logging -->
      <node name="drop_D435i_depth" pkg="topic_tools" type="drop" output="screen"
        args="/D435i/depth/image_rect_raw 29 30">
      </node>
      <node name="drop_D435i_ir" pkg="topic_tools" type="drop" output="screen"
        args="/D435i/infra1/image_rect_raw 29 30">
      </node>
    <!-- Launch avoidance -->
     <!-- <env name="ROSCONSOLE_CONFIG_FILE" value="$(find local_planner)/resource/custom_rosconsole.conf"/> -->
<env name="ROSCONSOLE_CONFIG_FILE" value="$(find local_planner)/custom_rosconsole.conf"/>
    <arg name="pointcloud_topics" default="[/D435i/depth/points]"/>

    <node name="local_planner_node" pkg="local_planner" type="local_planner_node" output="screen" required="true" >
      <param name="goal_x_param" value="0" />
      <param name="goal_y_param" value="0"/>
      <param name="goal_z_param" value="4" />
      <rosparam param="pointcloud_topics" subst_value="True">$(arg pointcloud_topics)</rosparam>
    </node>
    
    <!-- set or toggle rqt parameters -->
    <node name="rqt_param_toggle" pkg="local_planner" type="rqt_param_toggle.sh" />


</launch>


And this is my arranged CMakeList.txt inside local_planner:


cmake_minimum_required(VERSION 2.8.12)
project(local_planner)

set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)


## 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
  rospy
  dynamic_reconfigure
  tf
  pcl_ros
  mavros
  mavros_extras
  mavros_msgs
  mavlink
  avoidance
  nodelet
  pluginlib
)
find_package(PCL 1.7 REQUIRED)

#if(DISABLE_SIMULATION)
if(1)
  message(STATUS "Building avoidance without Gazebo Simulation")
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DDISABLE_SIMULATION")
endif()

################################################
## Gazebo Simulation
################################################
## System dependencies are found with CMake's conventions
find_package(Boost REQUIRED COMPONENTS system)


## Uncomment this if the package has a setup.py. This macro ensures
## modules and global scripts declared therein get installed
## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html
# catkin_python_setup()

################################################
## Declare ROS messages, services and actions ##
################################################

## To declare and build messages, services or actions from within this
## package, follow these steps:
## * Let MSG_DEP_SET be the set of packages whose message types you use in
##   your messages/services/actions (e.g. std_msgs, actionlib_msgs, ...).
## * In the file package.xml:
##   * add a build_depend tag for "message_generation"
##   * add a build_depend and a run_depend tag for each package in MSG_DEP_SET
##   * If MSG_DEP_SET isn't empty the following dependency has been pulled in
##     but can be declared for certainty nonetheless:
##     * add a run_depend tag for "message_runtime"
## * In this file (CMakeLists.txt):
##   * add "message_generation" and every package in MSG_DEP_SET to
##     find_package(catkin REQUIRED COMPONENTS ...)
##   * add "message_runtime" and every package in MSG_DEP_SET to
##     catkin_package(CATKIN_DEPENDS ...)
##   * uncomment the add_*_files sections below as needed
##     and list every .msg/.srv/.action file to be processed
##   * uncomment the generate_messages entry below
##   * add every package in MSG_DEP_SET to generate_messages(DEPENDENCIES ...)

## Generate services in the 'srv' folder
# add_service_files(
#   FILES
#   Service1.srv
#   Service2.srv
# )

## Generate actions in the 'action' folder
# add_action_files(
#   FILES
#   Action1.action
#   Action2.action
# )

################################################
## Declare ROS dynamic reconfigure parameters ##
################################################

## To declare and build dynamic reconfigure parameters within this
## package, follow these steps:
## * In the file package.xml:
##   * add a build_depend and a run_depend tag for "dynamic_reconfigure"
## * In this file (CMakeLists.txt):
##   * add "dynamic_reconfigure" to
##     find_package(catkin REQUIRED COMPONENTS ...)
##   * uncomment the "generate_dynamic_reconfigure_options" section below
##     and list every .cfg file to be processed

## Generate dynamic reconfigure parameters in the 'cfg' folder
generate_dynamic_reconfigure_options(
  cfg/LocalPlannerNode.cfg
)

###################################
## 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 you 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 local_planner
  CATKIN_DEPENDS roscpp rospy std_msgs mavros_msgs geometry_msgs sensor_msgs message_runtime tf avoidance nodelet pluginlib
#  DEPENDS system_lib
)

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

## CMake Setup
# Build in Release mode if nothing is specified
if(NOT CMAKE_BUILD_TYPE)
    set(CMAKE_BUILD_TYPE Release)
endif(NOT CMAKE_BUILD_TYPE)

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

## Declare a C++ library
# add_library(avoidance
#   src/${PROJECT_NAME}/avoidance.cpp
# )
set(LOCAL_PLANNER_CPP_FILES   "src/nodes/local_planner.cpp"
                              "src/nodes/waypoint_generator.cpp"
                              "src/nodes/tree_node.cpp"
                              "src/nodes/star_planner.cpp"
                              "src/nodes/planner_functions.cpp"
                              "src/nodes/local_planner_visualization.cpp"
                              "src/utils/trajectory_simulator.cpp"
)

add_library(local_planner     "${LOCAL_PLANNER_CPP_FILES}")
add_library(local_planner_nodelet src/nodes/local_planner_nodelet.cpp)




## Add cmake target dependencies of the library
## as an example, code may need to be generated before libraries
## either from message generation or dynamic reconfigure
add_dependencies(local_planner ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
add_dependencies(local_planner_nodelet local_planner ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})

## Declare a C++ executable
# add_executable(avoidance_node src/avoidance_node.cpp)
add_executable(local_planner_node src/nodes/local_planner_node_main.cpp)

## Add cmake target dependencies of the executable
## same as for the library above
# add_dependencies(avoidance_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})


## Specify libraries to link a library or executable target against
# target_link_libraries(avoidance_node
#   ${catkin_LIBRARIES}
#   ${PCL_LIBRARIES}
# )

target_link_libraries(
  local_planner
  PUBLIC
  ${catkin_LIBRARIES}
  ${YAML_CPP_LIBRARIES})

target_link_libraries(
  local_planner_nodelet
  PUBLIC
  local_planner
  ${catkin_LIBRARIES}
  ${YAML_CPP_LIBRARIES})

target_link_libraries(
  local_planner_node
  PUBLIC
  local_planner_nodelet
  ${catkin_LIBRARIES}
  ${YAML_CPP_LIBRARIES}
  ${Boost_LIBRARIES})
  


#############
## Install ##
#############

# all install targets should use catkin DESTINATION variables
# See http://ros.org/doc/api/catkin/html/adv_user_guide/variables.html

## Mark executable scripts (Python etc.) for installation
## in contrast to setup.py, you can choose the destination
# install(PROGRAMS
#   scripts/my_python_script
#   DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
# )

## Mark executables and/or libraries for installation
# install(TARGETS avoidance avoidance_node
#   ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
#   LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
#   RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
# )


# Install local_planner library
#install(TARGETS ${PROJECT_NAME}
#    ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
#    LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
#    RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
#    )

# Install local_planner library
install(TARGETS local_planner
    ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
    LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
    RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
    )

# Install nodelet library
 install(TARGETS local_planner_nodelet
    ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
    LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
    RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
    )


## Mark cpp header files for installation
 install(DIRECTORY include/${PROJECT_NAME}/
   DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
   FILES_MATCHING PATTERN "*.h"
   PATTERN ".svn" EXCLUDE
 )

## Mark other files for installation (e.g. launch and bag files, etc.)

install(TARGETS 
                local_planner_node
        RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION})

#../install/share/local_planner
 install(FILES
              "launch/avoidance.launch"
              "launch/rs_depthcloud.launch"
  DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
 )

# #../install/share/local_planner
install(FILES
              "resource/px4_config.yaml"              
  DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
 )

# #../install/share/local_planner
install(FILES
              "nodelets.xml" 
  DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
 )

# #../install/share/local_planner
install(FILES
              "resource/rqt_param_toggle.sh"              
  DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
 )

# #../install/share/local_planner
install(FILES
              "resource/custom_rosconsole.conf"              
  DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
 )

# #../install/share/local_planner
install(FILES
              "resource/stereo_calib.json"              
  DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
 )


#############
## Testing ##
#############

if(CATKIN_ENABLE_TESTING)
    # Add gtest based cpp test target and link libraries
    catkin_add_gtest(${PROJECT_NAME}-test test/main.cpp
                                          test/test_example.cpp
                                          test/test_local_planner.cpp
                                          test/test_planner_functions.cpp
                                          test/test_star_planner.cpp
                                          test/test_trajectory_simulator.cpp
                                          test/test_waypoint_generator.cpp)

    catkin_add_gtest(${PROJECT_NAME}-test-roscore test/main.cpp
                                        test/test_local_planner_nodelet.cpp)
    if(TARGET ${PROJECT_NAME}-test)
        target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME}
                                                 ${catkin_LIBRARIES}
                                                 ${YAML_CPP_LIBRARIES})
    endif()

    if(TARGET ${PROJECT_NAME}-test-roscore)
        target_link_libraries(${PROJECT_NAME}-test-roscore local_planner_nodelet
                                                 ${catkin_LIBRARIES}
                                                 ${YAML_CPP_LIBRARIES})
    endif()


    if (${CMAKE_BUILD_TYPE} STREQUAL "Coverage")
        SET(CMAKE_CXX_FLAGS "-g -O0 -fprofile-arcs -ftest-coverage --coverage")
        SET(CMAKE_C_FLAGS "-g -O0 -fprofile-arcs -ftest-coverage --coverage")
        SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --coverage")

        add_custom_target(${PROJECT_NAME}-test_coverage
            COMMAND lcov --zerocounters --directory ${PROJECT_BINARY_DIR}
            COMMAND lcov --capture  --initial --no-external --directory ${PROJECT_BINARY_DIR} --base-directory ${${PROJECT_NAME}_SOURCE_DIR} --output-file base_coverage.info --rc lcov_branch_coverage=1
            COMMAND ${PROJECT_NAME}-test
            COMMAND ${PROJECT_NAME}-test-roscore
            COMMAND lcov --capture  --no-external --directory ${PROJECT_BINARY_DIR} --base-directory ${${PROJECT_NAME}_SOURCE_DIR} --output-file test_coverage.info --rc lcov_branch_coverage=1
            COMMAND lcov -a base_coverage.info -a test_coverage.info -o coverage.info --rc lcov_branch_coverage=1
            COMMAND lcov --rc lcov_branch_coverage=1 --summary coverage.info
            WORKING_DIRECTORY .
            DEPENDS ${PROJECT_NAME}-test ${PROJECT_NAME}-test-roscore
        )
        add_custom_target(${PROJECT_NAME}-test_coverage_html
            COMMAND genhtml coverage.info --output-directory out --branch-coverage
            COMMAND x-www-browser out/index.html
            WORKING_DIRECTORY .
            DEPENDS ${PROJECT_NAME}-test_coverage
        )
    endif()

    ## Add folders to be run by python nosetests
    # catkin_add_nosetests(test)
endif()

The strange thing is that with the locate command I can not find the liblocal_planner_nodelet.so in the install folders…is this normal or is a consequence of that error?

I understand that the problem is the path of LocalPlannerNodelet, because the error return /lib//liblocal_planner_nodelet.so , but I can not find a solution on forums or by myself… and is the first time that I see a path with // between a folder and a file.

Can someone help me please? :face_with_head_bandage: