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

accessing local costmap and footprint

asked 2021-11-15 23:01:17 -0600

dinesh gravatar image

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?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-11-16 18:06:18 -0600

miura gravatar image

cost_map("/move_base/local_costmap", buffer); should be a description to create a cost map to publish /move_base/local_costmap. I think it is not a description to subscribe( access ) to /move_base/local_costmap.

Can you adopt the method of creating a subscriber that subscribes to /move_base/local_costmap/footprint?

edit flag offensive delete link more

Comments

I need both costmap as well as footprint data inside my ros node. what can i do?

dinesh gravatar image dinesh  ( 2021-11-16 21:48:40 -0600 )edit

As @miura suggests, subscribe to the move_base topics. The costmap_2d::Costmap2DROS class is not what you want to use - its purpose is to create and update a costmap (typically from sensor inputs.)

Mike Scheutzow gravatar image Mike Scheutzow  ( 2021-11-17 06:09:02 -0600 )edit

@dinesh I think you can subscribe to /move_base/local_costmap/costmap and /move_base/local_costmap/footprint.

miura gravatar image miura  ( 2021-11-17 19:21:52 -0600 )edit

If i subscribe to /move_base/local_costmap/costmap how am i going to calculate cost value of given cell from that topic data?

dinesh gravatar image dinesh  ( 2021-11-18 01:56:11 -0600 )edit

@dinesh I think the content has changed since the original question. Creating another question is more likely to get more input.

miura gravatar image miura  ( 2021-11-18 08:13:30 -0600 )edit

Question Tools

2 followers

Stats

Asked: 2021-11-15 23:01:17 -0600

Seen: 243 times

Last updated: Nov 16 '21