accessing local costmap and footprint
I am trying to access the costmap published by move base as a topic move_base/local_costmap/footprint
in another ros node like this:
tf2_ros::Buffer buffer(ros::Duration(10));
tf2_ros::TransformListener tf(buffer);
costmap_2d::Costmap2DROS cost_map("/move_base/local_costmap", buffer);
cost_map.start();
while (ros::ok())
{
cost_map.updateMap();
// Dynamic footprint according to rotation of body
std::vector<geometry_msgs::Point> P1;
P1 = cost_map.getRobotFootprint();
}
But this is not working somehow and shows and error like:
[update_footprint-6] process has died [pid 10589, exit code -11, cmd /home/ubuntu/bini_ws/devel/lib/motion_controllers/update_footprint_node __name:=update_footprint __log:=/home/ubuntu/.ros/log/0ed228d2-469a-11ec-939e-4f97b0f0f331/update_footprint-6.log].
log file: /home/ubuntu/.ros/log/0ed228d2-469a-11ec-939e-4f97b0f0f331/update_footprint-6*.log
How should i resolve this issue?