-
Notifications
You must be signed in to change notification settings - Fork 30
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
Const changes to support new VFP Planner API refactor. #429
Conversation
…en pushed deeper into AIKIDO.
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.
Looks mostly good! I don't think we need to make all statespaces and testables const in this PR, but we should at least do that within each file that we've touched. I left comments on instances that I saw where there was a mix of the two, maybe the next person to review will find more.
@@ -57,7 +57,7 @@ class FramePairDifferentiable : public Differentiable | |||
std::vector<ConstraintType> getConstraintTypes() const override; | |||
|
|||
// Documentation inherited. | |||
statespace::StateSpacePtr getStateSpace() const override; | |||
statespace::ConstStateSpacePtr getStateSpace() const override; | |||
|
|||
private: | |||
statespace::dart::MetaSkeletonStateSpacePtr mMetaSkeletonStateSpace; |
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.
Should this be statespace::dart::ConstMetaSkeletonStateSpacePtr
?
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.
It looks like we need the return type to match for the override to work.
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.
Sorry, this comment was about mMetaSkeletonStateSpace
.
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.
Derp derp, you're right! 😅
@@ -62,7 +62,7 @@ class FrameDifferentiable : public Differentiable | |||
std::vector<ConstraintType> getConstraintTypes() const override; | |||
|
|||
// Documentation inherited. | |||
statespace::StateSpacePtr getStateSpace() const override; | |||
statespace::ConstStateSpacePtr getStateSpace() const override; | |||
|
|||
private: | |||
statespace::dart::MetaSkeletonStateSpacePtr mMetaSkeletonStateSpace; |
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.
Should this be statespace::dart::ConstMetaSkeletonStateSpacePtr
?
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.
It looks like we need the return type to match for the override to work.
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.
Sorry, this comment was about mMetaSkeletonStateSpace
.
@@ -20,7 +20,7 @@ class SequentialSampleable : public Sampleable | |||
|
|||
// Documentation inherited. | |||
// TODO (avk): const-correctness after planner API is merged. |
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.
Delete this line.
@@ -20,7 +20,7 @@ class SequentialSampleable : public Sampleable | |||
|
|||
// Documentation inherited. | |||
// TODO (avk): const-correctness after planner API is merged. | |||
statespace::StateSpacePtr getStateSpace() const override; | |||
statespace::ConstStateSpacePtr getStateSpace() const override; |
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.
I think the private member mStateSpace
should be ConstStateSpacePtr
.
@@ -34,7 +34,7 @@ class DifferentiableIntersection : public Differentiable | |||
std::vector<ConstraintType> getConstraintTypes() const override; | |||
|
|||
// Documentation inherited. | |||
statespace::StateSpacePtr getStateSpace() const override; | |||
statespace::ConstStateSpacePtr getStateSpace() const override; |
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.
I think the private member mStateSpace
should be ConstStateSpacePtr
.
@@ -36,7 +36,7 @@ class FiniteSampleable : public Sampleable | |||
virtual ~FiniteSampleable(); | |||
|
|||
// Documentation inherited. | |||
statespace::StateSpacePtr getStateSpace() const override; | |||
statespace::ConstStateSpacePtr getStateSpace() const override; |
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.
I think the private member mStateSpace
should be ConstStateSpacePtr
.
@@ -30,7 +30,7 @@ class RejectionSampleable : public Sampleable | |||
int _maxTrialPerSample); | |||
|
|||
// Documentation inherited. | |||
statespace::StateSpacePtr getStateSpace() const override; | |||
statespace::ConstStateSpacePtr getStateSpace() const override; |
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.
I think the private member mStateSpace
should be ConstStateSpacePtr
.
@@ -45,14 +45,14 @@ class FrameTestable : public Testable | |||
std::unique_ptr<TestableOutcome> createOutcome() const override; | |||
|
|||
// Documentation inherited | |||
std::shared_ptr<statespace::StateSpace> getStateSpace() const override; | |||
statespace::ConstStateSpacePtr getStateSpace() const override; | |||
|
|||
private: | |||
statespace::dart::MetaSkeletonStateSpacePtr mMetaSkeletonStateSpace; |
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.
I think this should be statespace::dart::ConstMetaSkeletonStateSpacePtr
.
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.
It looks like this breaks the override.
@@ -41,7 +41,7 @@ class InverseKinematicsSampleable : public Sampleable | |||
virtual ~InverseKinematicsSampleable() = default; | |||
|
|||
// Documentation inherited. | |||
statespace::StateSpacePtr getStateSpace() const override; | |||
statespace::ConstStateSpacePtr getStateSpace() const override; |
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.
I think mMetaSkeletonStateSpace
should be ConstMetaSkeletonStateSpacePtr
.
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.
It looks like this breaks the override.
@@ -24,7 +24,7 @@ std::unique_ptr<Differentiable> createDifferentiableBoundsFor( | |||
/// Differtiable is created. | |||
/// \param _stateSpace The StateSpace where the Differentiable will be applied | |||
std::unique_ptr<Differentiable> createDifferentiableBounds( | |||
std::shared_ptr<statespace::dart::JointStateSpace> _stateSpace); | |||
std::shared_ptr<const statespace::dart::JointStateSpace> _stateSpace); |
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 we make all the statespaces in this file const?
Codecov Report
@@ Coverage Diff @@
## master #429 +/- ##
==========================================
+ Coverage 79.69% 79.76% +0.06%
==========================================
Files 231 231
Lines 5990 5986 -4
==========================================
+ Hits 4774 4775 +1
+ Misses 1216 1211 -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.
Looks good to me. Thanks for the fix! 👍
[skip ci]
* Make types play nice by changing old VFP code, but problem has now been pushed deeper into AIKIDO. * Propograte const-ness to more of AIKIDO, but not done yet. * Even more const-ing. Builds more, but still not all the way. * Add const-ness to some OMPL stuff. Bumped issues back to VFP code. * Make VFP Offset changes build. Needed to muck around with Robot class. * Yet more const-ing to make tests build. * Tests now build as well. * Clean up createDistanceMetricFor_impl code. * Add file left out from last commit * Clean up JointStateSpaceHelpers code. * Run `make format`. * Respond to Brian's comments. * Update CHANGELOG.md.
This PR has
const
changes to support the upcoming VFP refactor onto the new Planner API. #426 is currently blocking on this PR. Once this PR has been merged, I will rebase #426, and we can tackle that PR.Because the new
Problem
derivate classes from the new Planner API (#314) make most membersconst
, this requires shoving a bunch ofconst
variables through AIKIDO (we probably don't want to cast theconst
-ness away, since this would break a promise to the user).These changes are necessary to make
planToEndEffectorOffset
possible with the new Planner API.planToEndEffectorPose
may require more changes- my plan is to getplanToEndEffectorOffset
refactored first, then tackleplanToEndEffectorPose
.Summary of changes
Const all the things.
Update old
planToEndEffectorOffset
with the signature it needs to have in Refactor VFP with new Planner API #426.Before creating a pull request
make format
Before merging a pull request
CHANGELOG.md