-
Notifications
You must be signed in to change notification settings - Fork 19
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
Switched to L2 DOF resolution in VectorField and GreedyIk #332
Merged
Merged
Changes from 2 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
0a07dad
Updating vector field to use GetLinearCollisionCheckPts
jeking04 82702ff
Updating GreedyIK to allow using alternate norms. Defaulting to L2 norm.
jeking04 e02591b
Added sampling_func parameter to FollowVectorField.
89621a4
Changing vector field to use SampleTimeGenerator. Updating GetLinearC…
jeking04 fb9caf8
Fixing bugs when providing untimed trajectory
jeking04 59fb247
Fixing bug in timing computation
jeking04 ef4132d
Merge branch 'master' into bugfix/collision_checking_resolution
jeking04 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -141,7 +141,7 @@ def PlanToEndEffectorOffset(self, robot, direction, distance, | |
|
||
@ClonedPlanningMethod | ||
def PlanWorkspacePath(self, robot, traj, timelimit=5.0, | ||
min_waypoint_index=None, **kw_args): | ||
min_waypoint_index=None, norm_order=2, **kw_args): | ||
""" | ||
Plan a configuration space path given a workspace path. | ||
All timing information is ignored. | ||
|
@@ -150,6 +150,11 @@ def PlanWorkspacePath(self, robot, traj, timelimit=5.0, | |
represented as OpenRAVE AffineTrajectory | ||
@param min_waypoint_index minimum waypoint index to reach | ||
@param timelimit timeout in seconds | ||
@param norm_order: 1 ==> The L1 norm | ||
2 ==> The L2 norm | ||
inf ==> The L_infinity norm | ||
Used to determine the resolution of collision checked waypoints | ||
in the trajectory | ||
@return qtraj configuration space path | ||
""" | ||
from .exceptions import ( | ||
|
@@ -179,6 +184,8 @@ def PlanWorkspacePath(self, robot, traj, timelimit=5.0, | |
t = 0. | ||
dt = traj.GetDuration() | ||
|
||
q_resolutions = robot.GetActiveDOFResolutions() | ||
|
||
# Smallest CSpace step at which to give up | ||
min_step = min(robot.GetActiveDOFResolutions()) / 100. | ||
ik_options = openravepy.IkFilterOptions.CheckEnvCollisions | ||
|
@@ -206,11 +213,14 @@ def PlanWorkspacePath(self, robot, traj, timelimit=5.0, | |
infeasible_step = True | ||
if qnew is not None: | ||
# Found an IK | ||
step = abs(qnew - qcurr) | ||
if (max(step) < min_step) and qtraj: | ||
steps = abs(qnew - qcurr) / q_resolutions; | ||
norm = numpy.linalg.norm(steps, ord=norm_order) | ||
|
||
if (norm < min_step) and qtraj: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this dramatically changed the scaling on |
||
raise PlanningError('Not making progress.') | ||
infeasible_step = \ | ||
any(step > robot.GetActiveDOFResolutions()) | ||
|
||
infeasible_step = norm > 1.0 | ||
|
||
if infeasible_step: | ||
# Backtrack and try half the step | ||
dt = dt / 2.0 | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Can you modify
FollowVectorField
to accept asampling_func
? The default can still beVanDerCorputSampleGenerator
. This is the convention we've followed in other planners to allow the user to configure this option.