Skip to content
This repository has been archived by the owner on Jan 2, 2021. It is now read-only.

Coverage path not working when the footprint is very small #1

Closed
Adrianrr94 opened this issue May 22, 2019 · 4 comments
Closed

Coverage path not working when the footprint is very small #1

Adrianrr94 opened this issue May 22, 2019 · 4 comments
Assignees
Labels

Comments

@Adrianrr94
Copy link

Greetings,
I have been using your ROS service for a project where the drone need to do a coverage path but the footprint will be really small, like 5-6 m (vertical and horizontal).
So, to debug the code, I tried your specify_rect.py to see if the problem was in my code or in your ROS service.

To do that, I changed the parameters on the specify_rect.py's interface in order to have a small footprint, obtaining as a result that there is a zone without plan as it can be seen in the screenshot.

Captura de pantalla de 2019-05-22 14-14-18

That's exactly the problem I am having in almost all my planification, I believed this is due to the fact that the footprint is small and the area to cover very big. I would like to know how to fix that.

Thanks.

@uenota
Copy link
Owner

uenota commented May 25, 2019

Thank you for reporting the problem. I will check the code.

However, I have not worked on this project for a long time, so it may take long time to find out the causes.

@uenota uenota self-assigned this May 27, 2019
@UTWDrones
Copy link

UTWDrones commented Jun 3, 2019

Hello @uenota
Debuging your service ("torres_etal_2016.cpp"), I found out that when the footprint if small and the given polygon to coverage is a triangle the method computeConvexCoverage returns False no matter where the start points is. So the triangle is decomposed and so that, an error occurs.

`// isOptimal is true if computed path is optimal
bool isOptimal = computeConvexCoverage(polygon, footprintWidth.data, horizontalOverwrap.data, candidatePath);
if (isOptimal == true)
{
// fill "subpolygon" field of response so that polygon is visualized
res.subpolygons = generatePolygonVector(polygon);
// set optimal alternative as optimal path
// see torres et al. 2016 for Optimal Alternative
res.path = identifyOptimalAlternative(polygon, candidatePath, start);
}
else
{
std::vector subPolygons = decomposePolygon(polygon);

// sum of length of all coverage path
double pathLengthSum = 0;
// compute length of coverage path of each subpolygon
for (const auto& polygon : subPolygons)
{
  PointVector partialPath;
  computeConvexCoverage(polygon, footprintWidth.data, horizontalOverwrap.data, partialPath);
  pathLengthSum += calculatePathLength(partialPath);
}
// existsSecondOptimalPath is true if there is at least one coverage that has no intersection with polygon
// second optimal path is the path that has second shortest sweep direction without any intersection with polygon
PointVector secondOptimalPath;
bool existsSecondOptimalPath =
    findSecondOptimalPath(polygon, footprintWidth.data, horizontalOverwrap.data, candidatePath);
if (existsSecondOptimalPath == true)
{
  // compute optimal alternative for second optimal path
  secondOptimalPath = identifyOptimalAlternative(polygon, candidatePath, start);

  // if the length of second optimal path is shorter than the sum of coverage path of subpolygons,
  // set second optimal path as the path
  if (pathLengthSum > calculatePathLength(secondOptimalPath))
  {
    // fill "subpolygon" field of response so that polygon is visualized
    res.subpolygons = generatePolygonVector(polygon);

    res.path = secondOptimalPath;
    return true;
  }
}
else if (subPolygons.size() < 2)
{
  // if number of subpolygon is smaller than 2,
  // it means no valid path can be computed
  ROS_ERROR("Unable to generate path.");
  return true;
}

`
I am not sure this is the part of the code that is making the algorithm to fail, but it maybe the cause.

I look forward to hearing from you.
Thanks.

@uenota
Copy link
Owner

uenota commented Jul 19, 2019

@UTWDrones
Thank you for feedback!
I fixed the issue about computeConvexCoverage.

However the issue @Adrianrr94 reported is not fixed yet.
I will continue to investigate the problem.

@uenota
Copy link
Owner

uenota commented Jul 19, 2019

@Adrianrr94
The issue you reported should be fixed in e526ab8.
Could you check if it fixes your issue?

I'm going to close this issue. Please reopen if the problem persists.

@uenota uenota closed this as completed Jul 19, 2019
@uenota uenota added the bug label Jul 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants