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

about undefined symbol error

asked 2014-06-22 16:41:54 -0500

Ken_in_JAPAN gravatar image

updated 2014-10-24 13:51:28 -0500

ahendrix gravatar image

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/Tutori... ), 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!
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2014-06-23 13:48:20 -0500

fergs gravatar image

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).

edit flag offensive delete link more

Comments

@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 < base_local_planner/costmap_model.h> Could you teach me that?

Ken_in_JAPAN gravatar image Ken_in_JAPAN  ( 2014-06-23 16:50:38 -0500 )edit

I am still getting a similar error even after adding base_local_plannerto target_link_libraries

ROSCMBOT gravatar image ROSCMBOT  ( 2014-11-27 00:02:22 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2014-06-22 16:41:54 -0500

Seen: 2,756 times

Last updated: Jun 23 '14