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

Revision history [back]

your naming of variables seems troubled to me. You have a global variable nam which identical to function parameter;

costmap_2d::Costmap2DROS *costmap_ros;

and

 void GlobalPlanner::initialize(std::string name, costmap_2d::Costmap2DROS* costmap_ros){ .... }

You do realize both of them has costmap_ros, it could be that you are making use of function parameter costmap_ros thats why it doesnt throw anything.

I suggest yo to clear up the namings to avoid confusions, also try to avoid using raw pointers. a std::shared_ptr<> will suit better here.

your naming of variables seems troubled to me. You have a global variable nam name which is identical to function parameter;

costmap_2d::Costmap2DROS *costmap_ros;

and

 void GlobalPlanner::initialize(std::string name, costmap_2d::Costmap2DROS* costmap_ros){ .... }

You do realize both of them has costmap_ros, ?, it could be that you are making use of function parameter costmap_ros thats why it doesnt throw anything. in initialize() function.

I suggest yo to clear up the namings to avoid confusions, also try to avoid using raw pointers. a std::shared_ptr<> will suit better here. here.