0
$\begingroup$

Rosanswers logo

After compiling a code with OMPL, I tried to move a turtlebot. However, next error arose.

process[map_server-1]: started with pid [14847]
process[amcl-2]: started with pid [14859]
process[navigation_velocity_smoother-3]: started with pid [14964]
process[kobuki_safety_controller-4]: started with pid [15018]
process[move_base-5]: started with pid [15044]
[ INFO] [1403471634.839981265]: Using plugin "static_layer"
[ INFO] [1403471635.013088475]: Requesting the map...
[ INFO] [1403471635.244269848]: Resizing costmap to 4000 X 4000 at 0.050000 m/pix
[ INFO] [1403471635.784022404]: Received a 4000 X 4000 map at 0.050000 m/pix
[ INFO] [1403471635.800435571]: Using plugin "obstacle_layer"
[ INFO] [1403471635.830502313]:     Subscribed to Topics: scan bump
[ INFO] [1403471635.974988532]: Using plugin "inflation_layer"
/home/turtlebot/catkin_ws/devel/lib/move_base/move_base: symbol lookup error: /home/turtlebot/catkin_ws/devel/lib//libompl_planner_rrt.so: undefined symbol: _ZN18base_local_planner12CostmapModelC1ERKN10costmap_2d9Costmap2DE
[move_base-5] process has died [pid 15044, exit code 127, cmd /home/turtlebot/catkin_ws/devel/lib/move_base/move_base cmd_vel:=navigation_velocity_smoother/raw_cmd_vel __name:=move_base __log:=/home/turtlebot/.ros/log/6419a288-fa4f-11e3-9ded-dc85de8a0cd2/move_base-5.log].
log file: /home/turtlebot/.ros/log/6419a288-fa4f-11e3-9ded-dc85de8a0cd2/move_base-5*.log

I execute a command rospack plugins --attrib=plugin nav-core The result is following.

navfn /home/turtlebot/catkin_ws/src/navfn/bgp_plugin.xml
ompl_planner_rrt /home/turtlebot/catkin_ws/src/ompl_planner_rrt/bgp_plugin.xml
base_local_planner /home/turtlebot/catkin_ws/src/base_local_planner/blp_plugin.xml 
-- others --

I think that the result means that ompl_planner_rrt is available. But, the problem is undefined symbol: ZN18base_local_planner12CostmapModelC1ERKN10costmap_2d9Costmap2DE. I don't understand the meaning of the error. I guess that ZN18base_local_planner12CostmapModelC1ERKN10costmap_2d9Costmap2DE points out world_model = new base_local_planner::CostmapModel(*costmap);. However, as it is described on the tutorial (http://wiki.ros.org/navigation/Tutorials/Writing%20A%20Global%20Path%20Planner%20As%20Plugin%20in%20ROS), It probably doesn't have a problem. Could anyone teach me something clue not to arise an error? Thank you in advance!

I followed ferg, editing CMakeLists.txt.

target_link_libraries(
     ompl_planner_rrt 
     ${catkin_LIBRARIES} 
 ${OMPL_LIBRARIES} 
     base_local_planner
)

The error message has gone out.

[ INFO] [1403566019.155955441]: Using plugin "static_layer"
[ INFO] [1403566019.322259977]: Requesting the map...
[ INFO] [1403566019.650859797]: Resizing costmap to 4000 X 4000 at 0.050000 m/pix
[ INFO] [1403566020.184608226]: Received a 4000 X 4000 map at 0.050000 m/pix
[ INFO] [1403566020.201439022]: Using plugin "obstacle_layer"
[ INFO] [1403566020.228420634]:     Subscribed to Topics: scan bump
[ INFO] [1403566020.372557447]: Using plugin "inflation_layer"
[ INFO] [1403566020.944125609]: Using plugin "obstacle_layer"
[ INFO] [1403566021.114137708]:     Subscribed to Topics: scan bump
[ INFO] [1403566021.277011379]: Using plugin "inflation_layer"
[ INFO] [1403566021.585192241]: Created local_planner base_local_planner/TrajectoryPlannerROS
[ INFO] [1403566021.620077400]: Sim period is set to 0.20
[ WARN] [1403566021.884131333]: Map update loop missed its desired rate of 1.0000Hz... the loop actually took 1.3869 seconds
[ INFO] [1403566022.889696351]: odom received!

Originally posted by Ken_in_JAPAN on ROS Answers with karma: 894 on 2014-06-22

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

What does your CMakeLists.txt look like for this plugin? Are you linking against the "base_local_planner" library? If not, you probably need to. You can run the undefined symbol through c++filt to see that:

c++filt _ZN18base_local_planner12CostmapModelC1ERKN10costmap_2d9Costmap2DE

outputs:

base_local_planner::CostmapModel::CostmapModel(costmap_2d::Costmap2D const&)

That class is defined in base_local_planner/src/costmap_model.cpp, and is part of the "base_local_planner" library exported by that package. Thus, you need to link against that library (since this is a plugin, you don't get an undefined symbol until runtime).


Originally posted by fergs with karma: 13902 on 2014-06-23

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by Ken_in_JAPAN on 2014-06-23:
@fergs :Thank you for providing me with an important information! So, how should I do? I should edit CMakeLists.txt? My header file ompl_planner_rrt.h include #include &lt base_local_planner/costmap_model.h&gt Could you teach me that?

Comment by ROSCMBOT on 2014-11-27:
I am still getting a similar error even after adding base_local_plannerto target_link_libraries

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.