Skip to content
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

Only update one joint slider on value changed. #11

Merged
merged 2 commits into from
Jan 16, 2019

Conversation

clalancette
Copy link
Collaborator

This should fix the issue raised in
#5. The
basic problem is that update_sliders() changes the values
of the sliders, which causes the "onValueChanged" signal
to be emitted for each slider. The problem is that both
update_sliders() and onValueChanged() iterate over the
entire list of joints, so onValueChanged() is re-evaluating
all sliders during each setValue() in the update_sliders()
loop. To avoid this problem, change onValueChanged() to
only operate on the field that actually changed, which is
accomplished with a lambda.

Signed-off-by: Chris Lalancette clalancette@openrobotics.org

This should fix the issue raised in
#5.  The
basic problem is that update_sliders() changes the values
of the sliders, which causes the "onValueChanged" signal
to be emitted for each slider.  The problem is that both
update_sliders() and onValueChanged() iterate over the
entire list of joints, so onValueChanged() is re-evaluating
all sliders during each setValue() in the update_sliders()
loop.  To avoid this problem, change onValueChanged() to
only operate on the field that actually changed, which is
accomplished with a lambda.

Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
@clalancette clalancette requested a review from sloretz July 10, 2018 19:08
Signed-off-by: Chris Lalancette <clalancette@openrobotics.org>
Copy link
Contributor

@sloretz sloretz left a comment

Choose a reason for hiding this comment

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

I didn't try running it locally, but the strategy LGTM

@clalancette
Copy link
Collaborator Author

Thanks. I'm going to merge since it seems to work in my testing.

@clalancette clalancette merged commit 9172597 into kinetic-devel Jan 16, 2019
@clalancette clalancette deleted the slider-update branch January 16, 2019 17:29
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.

None yet

2 participants