distance_map
distance_map copied to clipboard
Always give zero
I want to use this package to estimate free distances to close-in obstacles. However, distance always gives zero, despite distmap seems to be correct in Rviz.
if(dist_map_ptr_->process(costmap_)){
auto dist_grid_ptr = dist_map_ptr_->getDistanceFieldObstacle();
double distance = dist_grid_ptr->atCell(mx, my);
std::cout<< distance << std::endl;
auto field_msg = distmap::toMsg(*dist_grid_ptr);
field_msg.header.stamp = ros::Time::now();
field_msg.header.frame_id = global_frame_;
field_obstacles_pub_.publish(field_msg);
}
Any idea why this happens?
I used the following way to initialize the map:
dist_map_ptr_ = distmap::make_distance_mapper("distmap/DistanceMapDeadReck")
seems to be empty, no wonder why it gives zeros https://github.com/artivis/distance_map/blob/devel/distance_map_deadreck/src/distance_map_deadreck.cpp#L77 any reasons why this was not implemented
Hi,
Indeed that's unfortunate and shouldn't have been pushed. Note that the OpenCV-based plugin is implemented tho. Feel free to implement this function and open a pull request if you like.
Hi, Yeah I checked Opencv version works fine, sure I will try after finishing ongoing work, anyway thanks for sharing this