Comments (4)
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.
from cpp_uav.
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.
from cpp_uav.
@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.
from cpp_uav.
@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.
from cpp_uav.
Related Issues (1)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cpp_uav.