-
Notifications
You must be signed in to change notification settings - Fork 101
Feature/improve collision avoidance #721
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
Conversation
… maps for normals and collision point calculation
…ay visualization was handled
@@ -390,27 +422,27 @@ private void optimizeKnotPoints(PlanarRegionsList planarRegionsList, HeightMapDa | |||
collisionLocationsViz.get(j).setToNaN(); | |||
collisionGradientsViz.get(j).setToNaN(); | |||
} | |||
continue; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This continue call actually jumped out of the outer loop, which was wrong.
{ | ||
double scale = swingKnotPoints.get(j).computeMaximumDisplacementScale(collisionGradients.get(j)); | ||
collisionGradients.get(j).scale(scale); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved to inside the other if block to make the continue block not needed.
@@ -77,7 +81,7 @@ public class CollisionFreeSwingCalculator | |||
private final List<FramePoint3D> defaultWaypoints = new ArrayList<>(); | |||
private final List<FramePoint3D> modifiedWaypoints = new ArrayList<>(); | |||
|
|||
private final SwingKnotOptimizationResult swingKnotOptimizationResult = new SwingKnotOptimizationResult(); | |||
private final SwingKnotOptimizationResult swingKnotOptimizationResult = new SwingKnotOptimizationResult(numberOfKnotPoints); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uses this static variable fixes a size difference.
@@ -555,10 +556,9 @@ private void checkForCollisions(FootstepPlannerRequest request, PlanarRegionsLis | |||
|
|||
List<Point3D> waypoints = footstepPlan.getFootstep(0).getCustomWaypointPositions(); | |||
RecyclingArrayList<FramePoint3D> waypointListCopy = new RecyclingArrayList<>(FramePoint3D.class); | |||
if (waypoints.size() > 0) | |||
for (Point3D waypoint : waypoints) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was a wild bug that caused a bunch of false negatives
@@ -650,22 +650,22 @@ public double getExtraSizeHigh(Axis3D axis) | |||
collisionRelativeToEndFoot.changeFrame(endFootPoseFrame); | |||
collisionRelativeToStartFoot.changeFrame(startFootPoseFrame); | |||
|
|||
double distanceToCollision = collisionBox.distance(collision); | |||
double distanceToCollision = collisionBox.signedDistance(collision); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was also a wild bug that prevented getting the distance correctly.
if (collisionResult.getSignedDistance() < closestDistance) | ||
{ | ||
closestDistance = collisionResult.getSignedDistance(); | ||
closestCollision = new Point3D(collisionResult.getPointOnB()); | ||
} | ||
|
||
boolean colliding = (closestDistance + 1.5e-2) < 0.0; | ||
boolean colliding = (closestDistance + 1e-3) <= 0.0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was way too big an epsilon
@@ -692,6 +692,8 @@ public SwingPlannerParametersBasics getParameters() | |||
SwingPlannerParametersBasics parameters = new DefaultSwingPlannerParameters(); | |||
// parameters.setDoInitialFastApproximation(true); | |||
parameters.setMinimumSwingFootClearance(0.05); | |||
parameters.setMaxDisplacementLow(0.5); | |||
parameters.setMaxDisplacementHigh(0.5); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was needed to allow enough expansion
@@ -503,7 +503,7 @@ private void checkForCollisions(FootstepPlannerRequest request, PlanarRegionsLis | |||
hittingEndGoal |= endFootPolygon.getMinX() < desiredPosition.getX(); | |||
hittingStartGoal |= desiredPosition.getX() < startFootPolygon.getMaxX(); | |||
|
|||
double distanceToCollision = foot.distance(collision); | |||
double distanceToCollision = foot.signedDistance(collision); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also a wild bug
No description provided.