ros / joint_state_publisher

http://wiki.ros.org/joint_state_publisher
50 stars 81 forks source link

Only update one joint slider on value changed. #11

Closed clalancette closed 5 years ago

clalancette commented 6 years ago

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

clalancette commented 5 years ago

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