GridMap on a Gazebo Plugin

asked 2021-04-02 12:46:48 -0600

bach gravatar image

updated 2021-04-04 05:01:41 -0600


I would like to use the GridMap package in the AutonomousActorPlugin to improve obstacle avoidance. This is the simple code I add to the AutoActorPlugin::Load(physics::ModelPtr _model, sdf::ElementPtr _sdf) method:

  ros::NodeHandle nh("~");
  ros::Publisher publisher = nh.advertise<grid_map_msgs::GridMap>("grid_map", 1, true);
  GridMap obs_map({"obstacles"});
  obs_map.setGeometry(Length(2.0, 2.0), 0.1, Position(init_pose[0], init_pose[1]));

The building is ok, but in run time it gives me this error:

    gzserver: symbol lookup error: /home/alberto/ros/tiago_public_ws/devel/lib/ undefined symbol: _ZN8grid_map7GridMapC1ERKSt6vectorINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEESaIS7_EE
================================================================================REQUIRED process [gazebo-2] has died!
process has died [pid 22593, exit code 127, cmd /home/alberto/ros/tiago_public_ws/src/gazebo_ros_pkgs/gazebo_ros/scripts/gzserver --verbose -e ode worlds/ __name:=gazebo __log:=/home/alberto/.ros/log/206b8d22-93da-11eb-800e-d8cb8abf4555/gazebo-2.log].
log file: /home/alberto/.ros/log/206b8d22-93da-11eb-800e-d8cb8abf4555/gazebo-2*.log
Initiating shutdown!

Can someone suggest me a solution? Thank you in advance.

edit retag flag offensive close merge delete


seems like the loader is having problems finding a gridmap binary symbol. This usually comes from incompatible changes done to the libraries used by the plugin without recompiling the plugin. Could you please remove build/ install/ spaces in catkin and rebuild the whole thing again to see if that helps?

Jose Luis Rivero gravatar imageJose Luis Rivero ( 2021-04-20 12:15:57 -0600 )edit