Skip to content

add safety check to IKConstraintSampler - #188

Merged
davetcoleman merged 1 commit into
moveit:indigo-develfrom
v4hn:indigo-ik-complain-if-dirty
Sep 21, 2016
Merged

davetcoleman merged 1 commit into
moveit:indigo-develfrom
v4hn:indigo-ik-complain-if-dirty

Conversation

@v4hn

@v4hn v4hn commented Aug 29, 2016

Copy link
Copy Markdown
Contributor

The sampler uses the transforms, but never checked if they are dirty,
so it might return invalid/unexpected robot states.

@scottpaulin noticed this in #186 and fixed the calling code.
For safety reasons, we should also check in the sampler itself.

@scottpaulin could you please check out this patch and see if it triggers in the use-case you found?

@v4hn

v4hn commented Aug 29, 2016

Copy link
Copy Markdown
Contributor Author

ok. so the check catches the bug @scottpaulin discovered :-)
Once #186 is merged, I'll rebase this request and after it passes this can be merged.

@scottpaulin

Copy link
Copy Markdown
Contributor

Would it be better if the error checking was performed in samplePose, since that is the method requiring accurate frame transforms?

@v4hn

v4hn commented Aug 30, 2016

Copy link
Copy Markdown
Contributor Author

On Tue, Aug 30, 2016 at 03:23:36AM -0700, Scott Paulin wrote:

Would it be better if the error checking was performed in samplePose, since that is the method requiring accurate frame transforms?

I had it in there originally, but moved it because the only function that calls samplePose is sampleHelper that is invoked through sample.
Contrary to my believe samplePose actually is public, so we should check in samplePose, you're right.
I moved the check.

@v4hn
v4hn force-pushed the indigo-ik-complain-if-dirty branch from 69df90e to 782016a Compare August 30, 2016 13:33
const robot_state::RobotState &ks,
unsigned int max_attempts)
{
if ( ks.dirty() ){

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bracket on new line

@v4hn
v4hn force-pushed the indigo-ik-complain-if-dirty branch from 782016a to e73d47b Compare September 16, 2016 10:51
@v4hn

v4hn commented Sep 16, 2016

Copy link
Copy Markdown
Contributor Author

On Fri, Sep 16, 2016 at 12:22:57AM -0700, Dave Coleman wrote:

bracket on new line

You know, at some point you should integrate this with CI. :)
Fixed.

@v4hn

v4hn commented Sep 16, 2016

Copy link
Copy Markdown
Contributor Author

@scottpaulin do you have any idea why the tests still break? #186 has been merged, so I expected this would succeed now.

@davetcoleman

Copy link
Copy Markdown
Member

You know, at some point you should integrate this with CI. :)

First we'd have to auto-clean up all the current code base, which I'd like to do in the future when there is a lull in pull requests

@scottpaulin

Copy link
Copy Markdown
Contributor

@v4hn I think your code should be calling RobotState::dirtyLinkTransforms rather than RobotState::dirty. The latter checks that the link transforms and the collision body transforms are up to date. UnionConstraintSampler::sample is only updating the link transforms not the collision body transforms.

@v4hn
v4hn force-pushed the indigo-ik-complain-if-dirty branch from e73d47b to 4aa0152 Compare September 21, 2016 12:58
The sampler uses the transforms, but never checked if they are dirty,
so it might return invalid/unexpected robot states.
@v4hn

v4hn commented Sep 21, 2016

Copy link
Copy Markdown
Contributor Author

@scottpaulin you're right, thanks. I changed the code and it passes the tests now.
This is ready for merge.

@davetcoleman
davetcoleman merged commit ff83b7e into moveit:indigo-devel Sep 21, 2016
davetcoleman pushed a commit that referenced this pull request Sep 21, 2016
The sampler uses the transforms, but never checked if they are dirty,
so it might return invalid/unexpected robot states.
davetcoleman pushed a commit that referenced this pull request Sep 21, 2016
The sampler uses the transforms, but never checked if they are dirty,
so it might return invalid/unexpected robot states.
@davetcoleman

Copy link
Copy Markdown
Member

cherry-picked to J/K

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants