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

Adding a New Local Planner in Navigation

asked 2014-11-27 00:52:16 -0600

ROSCMBOT gravatar image

Hello,

I am trying to add a new local planner as a plugin to the navigation stack. I followed the guide here to do this and everything compiles fine, and the new plugin is available by nav_core (rospack plugins --attrib=plugin nav_core), but when I am running the navigation, I get the error below:

[ INFO] [1417068766.032804515]: Using plugin "static_layer"
[ INFO] [1417068766.131730337]: Requesting the map...
[ INFO] [1417068766.473023497]: Resizing costmap to 4000 X 4000 at 0.050000 m/pix
[ INFO] [1417068766.593126231]: Received a 4000 X 4000 map at 0.050000 m/pix
[ INFO] [1417068766.609460784]: Using plugin "obstacle_layer"
[ INFO] [1417068766.636893038]:     Subscribed to Topics: 
[ INFO] [1417068766.786537389]: Using plugin "inflation_layer"
[ INFO] [1417068767.228129165]: Using plugin "obstacle_layer"
[ INFO] [1417068767.351801435]:     Subscribed to Topics: 
[ INFO] [1417068767.416552886]: Using plugin "inflation_layer"
/opt/ros/hydro/lib/move_base/move_base: symbol lookup error: /home/yan/myrobot/shark/devel/lib//libpose_follower_lib.so: undefined symbol: _ZN18base_local_planner20TrajectoryPlannerROSC1Ev
[move_base-6] process has died [pid 2430, exit code 127, cmd /opt/ros/hydro/lib/move_base/move_base odom:=shark/odom __name:=move_base __log:=/home/yan/.ros/log/f8e767fa-6909-11e4-9bd3-0024e832832e/move_base-6.log].
log file: /home/yan/.ros/log/f8e767fa-6909-11e4-9bd3-0024e832832e/move_base-6*.log

Running

 c++filt _ZN18base_local_planner20TrajectoryPlannerROSC1Ev

outputs

base_local_planner::TrajectoryPlannerROS::TrajectoryPlannerROS()

but the issue is base_local_planner exists in my CMakeLists.txt File

cmake_minimum_required(VERSION 2.8.3)
project(pose_follower)

find_package(catkin REQUIRED COMPONENTS
  base_local_planner 
  cmake_modules
  costmap_2d
  dynamic_reconfigure
  move_base
  move_base_msgs 
  actionlib 
  roscpp
  nav_core 
  tf 
  nav_msgs 
  pluginlib
)    

catkin_package(
   INCLUDE_DIRS include
   LIBRARIES pose_follower
   CATKIN_DEPENDS base_local_planner cmake_modules costmap_2d  dynamic_reconfigure move_base move_base_msgs actionlib roscpp nav_core tf nav_msgs pluginlib
)    

include_directories(
  include
  ${catkin_INCLUDE_DIRS}
)

link_directories(${catkin_LIBRARY_DIRS})

add_executable(pose_follower src/pose_follower.cpp)
target_link_libraries(pose_follower ${catkin_LIBRARIES} base_local_planner)

add_library(pose_follower_lib src/pose_follower.cpp)

add_dependencies(pose_follower nav_msgs_gencpp)

install(FILES blp_plugin.xml
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)

install(DIRECTORY include/pose_follower
  DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
  PATTERN "*~" EXCLUDE
)

install(TARGETS pose_follower
  ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
  LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
  RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)

Any thoughts?

edit retag flag offensive close merge delete

Comments

I also checked this thread about this problem @Ken_in_JAPAN@fergs

ROSCMBOT gravatar image ROSCMBOT  ( 2014-11-27 00:54:31 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2014-11-27 21:43:46 -0600

ROSCMBOT gravatar image

Thanks to @fergs, I added another target_link_libraries after add_library in my CMakeLists.txt, and it fixed the error:

add_library(pose_follower_lib src/pose_follower.cpp)
target_link_libraries(pose_follower_lib ${catkin_LIBRARIES} trajectory_planner_ros)

Although it seems pose_follower is not compatible with navfn global planner, and the robot is currently stuck.

edit flag offensive delete link more
1

answered 2014-11-27 04:46:24 -0600

fergs gravatar image

TrajectoryPlannerROS functions are found in the trajectory_planner_ros library, not base_local_planner.

However, I would expect that catkin_LIBRARIES would contain trajectory_planner_ros since you have base_local_planner package in the find_package().

edit flag offensive delete link more

Comments

I explicitly added trajectory_planner_ros library to the target_link_libraries() (target_link_libraries(pose_follower ${catkin_LIBRARIES} trajectory_planner_ros base_local_planner)), but still getting the same error

ROSCMBOT gravatar image ROSCMBOT  ( 2014-11-27 18:31:00 -0600 )edit

Question Tools

4 followers

Stats

Asked: 2014-11-27 00:52:16 -0600

Seen: 2,603 times

Last updated: Nov 27 '14