Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Always give zero #4

Open
GPrathap opened this issue Jul 29, 2021 · 3 comments
Open

Always give zero #4

GPrathap opened this issue Jul 29, 2021 · 3 comments
Labels
good first issue Good for newcomers

Comments

@GPrathap
Copy link

GPrathap commented Jul 29, 2021

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")

@GPrathap
Copy link
Author

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

@artivis
Copy link
Owner

artivis commented Jul 29, 2021

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.

@artivis artivis added the good first issue Good for newcomers label Jul 29, 2021
@GPrathap
Copy link
Author

GPrathap commented Jul 29, 2021

Hi, Yeah I checked Opencv version works fine, sure I will try after finishing ongoing work, anyway thanks for sharing this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants