You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
pr2_bringup/calibrate.py has a pyhton for loop on a list, but the elements of the list can be removed during the loop.
def calibrate(controllers):
...
# Sets up callbacks for calibration completion
waiting_for = launched[:]
def calibrated(msg, name): # Somewhat not thread-safe
if name in waiting_for:
waiting_for.remove(name)
for name in waiting_for:
rospy.Subscriber("%s/calibrated" % name, Empty, calibrated, name)
# Waits until all the controllers have calibrated
while waiting_for and not rospy.is_shutdown():
print "Waiting for: %s" % ', '.join(waiting_for)
sleep(0.5)
So if the first controllers in the queue publish something quickly enough, the callback function could be called before the for loop has finished, what results in the last cycle/s not being executed, and thus, the last subscribers not being called. This leads to the subsequent while loop running forever.
I've been using this with custom calibration controllers (not with a pr2 robot but with a Shadow Robot hand). If the calibration controllers take more time to publish on the xxx/calibrated topic, then this problem doesn't happen (in our case it takes a very short time, thus the problem).
pr2_bringup/calibrate.py has a pyhton for loop on a list, but the elements of the list can be removed during the loop.
def calibrate(controllers):
...
# Sets up callbacks for calibration completion
waiting_for = launched[:]
def calibrated(msg, name): # Somewhat not thread-safe
if name in waiting_for:
waiting_for.remove(name)
for name in waiting_for:
rospy.Subscriber("%s/calibrated" % name, Empty, calibrated, name)
So if the first controllers in the queue publish something quickly enough, the callback function could be called before the for loop has finished, what results in the last cycle/s not being executed, and thus, the last subscribers not being called. This leads to the subsequent while loop running forever.
I've been using this with custom calibration controllers (not with a pr2 robot but with a Shadow Robot hand). If the calibration controllers take more time to publish on the xxx/calibrated topic, then this problem doesn't happen (in our case it takes a very short time, thus the problem).
trac data:
The text was updated successfully, but these errors were encountered: