This should fix the issue raised in
https://github.com/ros/joint_state_publisher/pull/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.
This should fix the issue raised in https://github.com/ros/joint_state_publisher/pull/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