# Revision history [back]

Hey David,

I happened to be working on the same thing as you with regards to adding cost functions as plugins to the DWAPlanner and came across this exact same problem.

I believe the issue is that you cannot link against the same library that contains the plugin that you are trying to load.

I can get your example to run with the following changes to your CMakeLists.txt:

 add_library(cost_functions
src/map_grid_cost_function.cpp
src/goal_dist_cost_function.cpp
src/path_dist_cost_function.cpp
src/offset_grid_cost_function.cpp
src/goal_align_cost_function.cpp
src/path_align_cost_function.cpp
src/obstacle_cost_function.cpp
src/oscillation_cost_function.cpp
src/prefer_forward_cost_function.cpp
) add_library(dwa_local_planner src/dwa_planner.cpp src/dwa_planner_ros.cpp src/simple_scored_sampling_planner.cpp)
target_link_libraries(plugin_quiz ${catkin_LIBRARIES} dwa_local_planner) add_executable(plugin_quiz2 src/plugin_quiz2.cpp) target_link_libraries(plugin_quiz2${catkin_LIBRARIES} dwa_local_planner) 

However, I now get the following error after running:


Warning: class_loader::ClassLoader: SEVERE WARNING!!! Attempting to unload library while objects created by this loader exist in the heap! You should delete your objects before attempting to unload the library or destroying the ClassLoader. The library will NOT be unloaded.
Segmentation fault (core dumped)


Let me know if that helps. Looking forward to seeing this addition to the planner!

Hey David,

I happened to be working on the same thing as you with regards to adding cost functions as plugins to the DWAPlanner and came across this exact same problem.

I believe the issue is that you cannot link against the same library that contains the plugin that you are trying to load.

I can get your example to run with the following changes to your CMakeLists.txt:

 add_library(cost_functions
src/map_grid_cost_function.cpp
src/goal_dist_cost_function.cpp
src/path_dist_cost_function.cpp
src/offset_grid_cost_function.cpp
src/goal_align_cost_function.cpp
src/path_align_cost_function.cpp
src/obstacle_cost_function.cpp
src/oscillation_cost_function.cpp
src/prefer_forward_cost_function.cpp
) add_library(dwa_local_planner src/dwa_planner.cpp src/dwa_planner_ros.cpp src/simple_scored_sampling_planner.cpp)
target_link_libraries(plugin_quiz ${catkin_LIBRARIES} dwa_local_planner) add_executable(plugin_quiz2 src/plugin_quiz2.cpp) target_link_libraries(plugin_quiz2${catkin_LIBRARIES} dwa_local_planner) 

However, I now get the following error after running:


Warning: class_loader::ClassLoader: SEVERE WARNING!!! Attempting to unload library while objects created by this loader exist in the heap! You should delete your objects before attempting to unload the library or destroying the ClassLoader. The library will NOT be unloaded.
Segmentation fault (core dumped)


This appears to be occurring in the destructor of ObstacleCostFunction.

Let me know if that helps. Looking forward to seeing this addition to the planner!

Hey David,

I happened to be working on the same thing as you with regards to adding cost functions as plugins to the DWAPlanner and came across this exact same problem.

I believe the issue is that you cannot link against the same library that contains the plugin that you are trying to load.

I can get your example to run with the following changes to your CMakeLists.txt:

 add_library(cost_functions
src/map_grid_cost_function.cpp
src/goal_dist_cost_function.cpp
src/path_dist_cost_function.cpp
src/offset_grid_cost_function.cpp
src/goal_align_cost_function.cpp
src/path_align_cost_function.cpp
src/obstacle_cost_function.cpp
src/oscillation_cost_function.cpp
src/prefer_forward_cost_function.cpp
) add_library(dwa_local_planner src/dwa_planner.cpp src/dwa_planner_ros.cpp src/simple_scored_sampling_planner.cpp)
target_link_libraries(plugin_quiz ${catkin_LIBRARIES} dwa_local_planner) add_executable(plugin_quiz2 src/plugin_quiz2.cpp) target_link_libraries(plugin_quiz2${catkin_LIBRARIES} dwa_local_planner) 

However, I now get the following error after running:


Warning: class_loader::ClassLoader: SEVERE WARNING!!! Attempting to unload library while objects created by this loader exist in the heap! You should delete your objects before attempting to unload the library or destroying the ClassLoader. The library will NOT be unloaded.
Segmentation fault (core dumped)


This appears to be occurring with the deletion of the WorldModel in the destructor of ObstacleCostFunction.

Let me know if that helps. Looking forward to seeing this addition to the planner!

Hey David,

I happened to be working on the same thing as you with regards to adding cost functions as plugins to the DWAPlanner and came across this exact same problem.

I believe the issue is that you cannot link against the same library that contains the plugin that you are trying to load.

I can get your example to run with the following changes to your CMakeLists.txt:

 add_library(cost_functions
src/map_grid_cost_function.cpp
src/goal_dist_cost_function.cpp
src/path_dist_cost_function.cpp
src/offset_grid_cost_function.cpp
src/goal_align_cost_function.cpp
src/path_align_cost_function.cpp
src/obstacle_cost_function.cpp
src/oscillation_cost_function.cpp
src/prefer_forward_cost_function.cpp
) add_library(dwa_local_planner src/dwa_planner.cpp src/dwa_planner_ros.cpp src/simple_scored_sampling_planner.cpp)
target_link_libraries(plugin_quiz ${catkin_LIBRARIES} dwa_local_planner) add_executable(plugin_quiz2 src/plugin_quiz2.cpp) target_link_libraries(plugin_quiz2${catkin_LIBRARIES} dwa_local_planner) 

However, I now get the following error after running:


Warning: class_loader::ClassLoader: SEVERE WARNING!!! Attempting to unload library while objects created by this loader exist in the heap! You should delete your objects before attempting to unload the library or destroying the ClassLoader. The library will NOT be unloaded.
Segmentation fault (core dumped)


This appears to be occurring with the deletion of the WorldModel in the destructor of ObstacleCostFunction.ObstacleCostFunction. Changing world_model_ to a boost::shared_ptr appears to fix this issue.

Let me know if that helps. Looking forward to seeing this addition to the planner!

Hey David,

I happened to be working on the same thing as you with regards to adding cost functions as plugins to the DWAPlanner and came across this exact same problem.

I believe the issue is that you cannot link against the same library that contains the plugin that you are trying to load.

I can get your example to run with the following changes to your CMakeLists.txt:

 add_library(cost_functions
src/map_grid_cost_function.cpp
src/goal_dist_cost_function.cpp
src/path_dist_cost_function.cpp
src/offset_grid_cost_function.cpp
src/goal_align_cost_function.cpp
src/path_align_cost_function.cpp
src/obstacle_cost_function.cpp
src/oscillation_cost_function.cpp
src/prefer_forward_cost_function.cpp
) add_library(dwa_local_planner src/dwa_planner.cpp src/dwa_planner_ros.cpp src/simple_scored_sampling_planner.cpp)
target_link_libraries(plugin_quiz ${catkin_LIBRARIES} dwa_local_planner) add_executable(plugin_quiz2 src/plugin_quiz2.cpp) target_link_libraries(plugin_quiz2${catkin_LIBRARIES} dwa_local_planner) 

However, I now get the following error after running:


Warning: class_loader::ClassLoader: SEVERE WARNING!!! Attempting to unload library while objects created by this loader exist in the heap! You should delete your objects before attempting to unload the library or destroying the ClassLoader. The library will NOT be unloaded.
Segmentation fault (core dumped)


This appears to be occurring with the deletion of the WorldModel in the destructor of ObstacleCostFunction. Changing world_model_ to a boost::shared_ptr appears to fix this issue.this.

Let me know if that helps. Looking forward to seeing this addition to the planner!

Hey David,

I happened to be working on the same thing as you with regards to adding cost functions as plugins to the DWAPlanner and came across this exact same problem.

I believe the issue is that you cannot link against the same library that contains the plugin that you are trying to load.

I can get your example to run with the following changes to your CMakeLists.txt:

 add_library(cost_functions
src/map_grid_cost_function.cpp
src/goal_dist_cost_function.cpp
src/path_dist_cost_function.cpp
src/offset_grid_cost_function.cpp
src/goal_align_cost_function.cpp
src/path_align_cost_function.cpp
src/obstacle_cost_function.cpp
src/oscillation_cost_function.cpp
src/prefer_forward_cost_function.cpp
) add_library(dwa_local_planner src/dwa_planner.cpp src/dwa_planner_ros.cpp src/simple_scored_sampling_planner.cpp)
target_link_libraries(plugin_quiz ${catkin_LIBRARIES} dwa_local_planner) add_executable(plugin_quiz2 src/plugin_quiz2.cpp) target_link_libraries(plugin_quiz2${catkin_LIBRARIES} dwa_local_planner) 

However, I now get the following error after running:


Warning: class_loader::ClassLoader: SEVERE WARNING!!! Attempting to unload library while objects created by this loader exist in the heap! You should delete your objects before attempting to unload the library or destroying the ClassLoader. The library will NOT be unloaded.
Segmentation fault (core dumped)


This appears to be occurring with the deletion of the WorldModel in the destructor of ObstacleCostFunction. Changing world_model_ to a boost::shared_ptr appears to fix this.ObstacleCostFunction.

Let me know if that helps. Looking forward to seeing this addition to the planner!

Hey David,

I happened to be working on the same thing as you with regards to adding cost functions as plugins to the DWAPlanner and came across this exact same problem.

I believe the issue is that you cannot link against the same library that contains the plugin that you are trying to load.

I can get your example to run with the following changes to your CMakeLists.txt:

 add_library(cost_functions
src/map_grid_cost_function.cpp
src/goal_dist_cost_function.cpp
src/path_dist_cost_function.cpp
src/offset_grid_cost_function.cpp
src/goal_align_cost_function.cpp
src/path_align_cost_function.cpp
src/obstacle_cost_function.cpp
src/oscillation_cost_function.cpp
src/prefer_forward_cost_function.cpp
) add_library(dwa_local_planner src/dwa_planner.cpp src/dwa_planner_ros.cpp src/simple_scored_sampling_planner.cpp)
target_link_libraries(plugin_quiz ${catkin_LIBRARIES} dwa_local_planner) add_executable(plugin_quiz2 src/plugin_quiz2.cpp) target_link_libraries(plugin_quiz2${catkin_LIBRARIES} dwa_local_planner) 

However, I now get the following error after running:


Warning: class_loader::ClassLoader: SEVERE WARNING!!! Attempting to unload library while objects created by this loader exist in the heap! You should delete your objects before attempting to unload the library or destroying the ClassLoader. The library will NOT be unloaded.
Segmentation fault (core dumped)


This appears to be occurring with the deletion of the WorldModel in the destructor of ObstacleCostFunction.

Let me know if that helps. Looking forward to seeing this addition to the planner!

Hey David,

I happened to be working on the same thing as you with regards to adding cost functions as plugins to the DWAPlanner and came across this exact same problem.

I believe the issue is that you cannot link against the same library that contains the plugin that you are trying to load.

I can get your example to run with the following changes to your CMakeLists.txt:

 add_library(cost_functions
src/map_grid_cost_function.cpp
src/goal_dist_cost_function.cpp
src/path_dist_cost_function.cpp
src/offset_grid_cost_function.cpp
src/goal_align_cost_function.cpp
src/path_align_cost_function.cpp
src/obstacle_cost_function.cpp
src/oscillation_cost_function.cpp
src/prefer_forward_cost_function.cpp
) add_library(dwa_local_planner src/dwa_planner.cpp src/dwa_planner_ros.cpp src/simple_scored_sampling_planner.cpp)
target_link_libraries(plugin_quiz ${catkin_LIBRARIES} dwa_local_planner) add_executable(plugin_quiz2 src/plugin_quiz2.cpp) target_link_libraries(plugin_quiz2${catkin_LIBRARIES} dwa_local_planner) 

However, I now get the following error after running:


Warning: class_loader::ClassLoader: SEVERE WARNING!!! Attempting to unload library while objects created by this loader exist in the heap! You should delete your objects before attempting to unload the library or destroying the ClassLoader. The library will NOT be unloaded.
Segmentation fault (core dumped)


This appears to be occurring with the deletion of the WorldModel in the destructor of ObstacleCostFunction.

Let me know if that helps. Looking forward to seeing this addition to the planner!

Hey David,

I happened to be working on the same thing as you with regards to adding cost functions as plugins to the DWAPlanner and came across this exact same problem.

I believe the issue is that you cannot link against the same library that contains the plugin that you are trying to load.

I can get your example to run with the following changes to your CMakeLists.txt:

 add_library(cost_functions
src/map_grid_cost_function.cpp
src/goal_dist_cost_function.cpp
src/path_dist_cost_function.cpp
src/offset_grid_cost_function.cpp
src/goal_align_cost_function.cpp
src/path_align_cost_function.cpp
src/obstacle_cost_function.cpp
src/oscillation_cost_function.cpp
src/prefer_forward_cost_function.cpp
) add_library(dwa_local_planner src/dwa_planner.cpp src/dwa_planner_ros.cpp src/simple_scored_sampling_planner.cpp)
target_link_libraries(plugin_quiz ${catkin_LIBRARIES} dwa_local_planner) add_executable(plugin_quiz2 src/plugin_quiz2.cpp) target_link_libraries(plugin_quiz2${catkin_LIBRARIES} dwa_local_planner) 

However, I now get the following error after running:


Warning: class_loader::ClassLoader: SEVERE WARNING!!! Attempting to unload library while objects created by this loader exist in the heap! You should delete your objects before attempting to unload the library or destroying the ClassLoader. The library will NOT be unloaded.
Segmentation fault (core dumped)


This The segfault appears to be occurring with the deletion of the WorldModel in the destructor of ObstacleCostFunction.ObstacleCostFunction, I'm not sure about the class_loader warning.

Let me know if that helps. Looking forward to seeing this addition to the planner!

Hey David,

I happened to be working on the same thing as you with regards to adding cost functions as plugins to the DWAPlanner and came across this exact same problem.

I believe the issue is that you cannot link against the same library that contains the plugin that you are trying to load.

I can get your example to run with the following changes to your CMakeLists.txt:

 add_library(cost_functions
src/map_grid_cost_function.cpp
src/goal_dist_cost_function.cpp
src/path_dist_cost_function.cpp
src/offset_grid_cost_function.cpp
src/goal_align_cost_function.cpp
src/path_align_cost_function.cpp
src/obstacle_cost_function.cpp
src/oscillation_cost_function.cpp
src/prefer_forward_cost_function.cpp
) add_library(dwa_local_planner src/dwa_planner.cpp src/dwa_planner_ros.cpp src/simple_scored_sampling_planner.cpp)
target_link_libraries(plugin_quiz ${catkin_LIBRARIES} dwa_local_planner) add_executable(plugin_quiz2 src/plugin_quiz2.cpp) target_link_libraries(plugin_quiz2${catkin_LIBRARIES} dwa_local_planner) 

However, I now get the following error after running:


Warning: class_loader::ClassLoader: SEVERE WARNING!!! Attempting to unload library while objects created by this loader exist in the heap! You should delete your objects before attempting to unload the library or destroying the ClassLoader. The library will NOT be unloaded.
Segmentation fault (core dumped)


The segfault appears to be occurring with the deletion of the WorldModel in the destructor of ObstacleCostFunction, ObstacleCostFunction. I'm not sure about the class_loader warning.

Let me know if that helps. Looking forward to seeing this addition to the planner!

Hey David,

I happened to be working on the same thing as you with regards to adding cost functions as plugins to the DWAPlanner and came across this exact same problem.

I believe the issue is that you cannot link against the same library that contains the plugin that you are trying to load.

I can get your example to run with the following changes to your CMakeLists.txt:

 add_library(cost_functions
src/map_grid_cost_function.cpp
src/goal_dist_cost_function.cpp
src/path_dist_cost_function.cpp
src/offset_grid_cost_function.cpp
src/goal_align_cost_function.cpp
src/path_align_cost_function.cpp
src/obstacle_cost_function.cpp
src/oscillation_cost_function.cpp
src/prefer_forward_cost_function.cpp
) add_library(dwa_local_planner src/dwa_planner.cpp src/dwa_planner_ros.cpp src/simple_scored_sampling_planner.cpp)
target_link_libraries(plugin_quiz ${catkin_LIBRARIES} dwa_local_planner) add_executable(plugin_quiz2 src/plugin_quiz2.cpp) target_link_libraries(plugin_quiz2${catkin_LIBRARIES} dwa_local_planner) 

However, I now get the following error after running:


Warning: class_loader::ClassLoader: SEVERE WARNING!!! Attempting to unload library while objects created by this loader exist in the heap! You should delete your objects before attempting to unload the library or destroying the ClassLoader. The library will NOT be unloaded.
Segmentation fault (core dumped)


The segfault appears to be occurring with the deletion of the WorldModel in the destructor of ObstacleCostFunction. ObstacleCostFunction - changing world_model_ to a boost::shared_ptr appears to fix this, though I'm not sure what the root cause is. I'm not sure about the cause of the class_loader warning.warning either, but calling tc_.reset() appears to fix it.

Let me know if that helps. Looking forward to seeing this addition to the planner!

Hey David,

I happened to be working on the same thing as you with regards to adding cost functions as plugins to the DWAPlanner and came across this exact same problem.

I believe the issue is that you cannot link against the same library that contains the plugin that you are trying to load.

I can get your example to run with the following changes to your CMakeLists.txt:

 add_library(cost_functions
src/map_grid_cost_function.cpp
src/goal_dist_cost_function.cpp
src/path_dist_cost_function.cpp
src/offset_grid_cost_function.cpp
src/goal_align_cost_function.cpp
src/path_align_cost_function.cpp
src/obstacle_cost_function.cpp
src/oscillation_cost_function.cpp
src/prefer_forward_cost_function.cpp
) add_library(dwa_local_planner src/dwa_planner.cpp src/dwa_planner_ros.cpp src/simple_scored_sampling_planner.cpp)
target_link_libraries(plugin_quiz ${catkin_LIBRARIES} dwa_local_planner) add_executable(plugin_quiz2 src/plugin_quiz2.cpp) target_link_libraries(plugin_quiz2${catkin_LIBRARIES} dwa_local_planner) 

However, I now get the following error after running:


Warning: class_loader::ClassLoader: SEVERE WARNING!!! Attempting to unload library while objects created by this loader exist in the heap! You should delete your objects before attempting to unload the library or destroying the ClassLoader. The library will NOT be unloaded.
Segmentation fault (core dumped)


The segfault appears to be occurring with the deletion of the WorldModel in the destructor of ObstacleCostFunction - changing world_model_ to a boost::shared_ptr appears to fix this, though I'm not sure what the root cause is. I'm not sure about the cause of the class_loader warning either, but calling tc_.reset() at the end of your plugin_quiz2.cpp appears to fix it.

Let me know if that helps. Looking forward to seeing this addition to the planner!

Hey David,

I happened to be working on the same thing as you with regards to adding cost functions as plugins to the DWAPlanner and came across this exact same problem.

I believe the issue is that you cannot link against the same library that contains the plugin that you are trying to load.

I can get your example to run with the following changes to your CMakeLists.txt:

 add_library(cost_functions
src/map_grid_cost_function.cpp
src/goal_dist_cost_function.cpp
src/path_dist_cost_function.cpp
src/offset_grid_cost_function.cpp
src/goal_align_cost_function.cpp
src/path_align_cost_function.cpp
src/obstacle_cost_function.cpp
src/oscillation_cost_function.cpp
src/prefer_forward_cost_function.cpp
) add_library(dwa_local_planner src/dwa_planner.cpp src/dwa_planner_ros.cpp src/simple_scored_sampling_planner.cpp)
target_link_libraries(plugin_quiz ${catkin_LIBRARIES} dwa_local_planner) add_executable(plugin_quiz2 src/plugin_quiz2.cpp) target_link_libraries(plugin_quiz2${catkin_LIBRARIES} dwa_local_planner) 

However, I now get the following error after running:


Warning: class_loader::ClassLoader: SEVERE WARNING!!! Attempting to unload library while objects created by this loader exist in the heap! You should delete your objects before attempting to unload the library or destroying the ClassLoader. The library will NOT be unloaded.


plugin_quiz2: pthread_mutex_lock.c:62: __pthread_mutex_lock: Assertion mutex->__data.__owner == 0' failed.
`