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

navfn (getPlanFromPotential or makePlan) is not using the last updated map form costmap_2d #1254

Open
MortezaHagh opened this issue Oct 23, 2023 · 1 comment

Comments

@MortezaHagh
Copy link

MortezaHagh commented Oct 23, 2023

I noticed that occasionally (mostly when working with big maps) the global_plan intersects with obstacles when using move_base to navigate to a goal. This shouldn't be a problem since the global_plan gets updated frequently. However, if a node requests a global plan from makePlan or computePotential+getPlanFromPotential, this can cause a problem.

I checked the following functions:

1- NavfnROS::computePotential:

planner_->setCostmap(costmap_->getCharMap(), true, allow_unknown_);

2- NavFn::setCostmap

NavFn::setCostmap(const COSTTYPE *cmap, bool isROS, bool allow_unknown)
... costarr is updated based on cmap values ....

and I saved the costarr after requesting a path several times.
You can see in the following pictures that the created costarr is different for the same map.

test2
test1

This may be because the costmaps was being updated and used simultaneously. So, I tested this solution and it worked:

  • add two other costmaps (unsigned char* costmap) to the costmap_2d.
  • use pointer swapping to always point to the last updated map.

Am I missing a point or this is a real bug?

@JiaoxianDu
Copy link

Is it possible to create a pr? Thanks!

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

No branches or pull requests

2 participants