Planners ompl constraints overconstrain #2775
Draft
+203
−368
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.
Description
When creating OMPL constraints the AmbientDimension often gets overconstraint as the coDimension of the constraint is set to 3 even when you constrict less than 3 dimensions.
Current implementation uses the bounds class to never give an error for a dimension if that dimension is set using -1 but still "constrains" that dimension by setting the coDimension of the ompl::base::constraint to 3.
this causes you to be unable to use both a position and orientation constraint with <7 DOF robots as an AmbientDimension of 6 - 3 - 3 = 0 . #2614
Changes
I removed the derivative function of the bounds class as the sign can already be obtained from the penalty function.
I Consolidated the BoxConstraint and EqualityConstraint.
I changed the coDimension of the box and orientation constraints. Now a dimension of a position constraint can be unconstrained if the respective dimension of the constraint region is less than 0 or equal to infinity.
A dimension of an orientation constraint can be unconstrained if the absolute axis tolerance of the orientation is less than 0 or equal to infinity.
I removed the init function, it doesn't make sense to have an uninitialized constraint
I removed i removed the functions: calcError and calcErrorJacobian as their implementation belongs in function and jacobian
Checklist