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
{{ message }}
Repository navigation
Make use of polling functionality in 16-ev3dev kernel #230
Kernel Release Cycle 16 restores support for polling the status attribute of the tacho motor class for EV3 (see ev3dev/ev3dev.github.io#284). This may be used to wait for changes in motor state efficiently, so we should provide an interface for this feature.
motor.wait_while('running') # wait while `'running'` is in the motor's `state`.motor.wait_until('holding') # wait until `'holding'` is in the motor's state
Would that be more error prone that what we have to do currently (while 'running' in m.state: sleep(0.01))? Or do you say that polling event could come later that that state has actually changed?
No, it's not more error-prone than the loops we currently use; however now that we are building it into the library itself we need to make sure it's not going to fail on edge cases.
Activity
ddemidov commentedon Oct 15, 2016
Something like
should be doable.
WasabiFan commentedon Oct 15, 2016
Keep in mind that we'll need to account for race conditions. I don't believe we're guaranteed that the state will change to "running" immediately.
ddemidov commentedon Oct 15, 2016
I am not sure I understand. I was thinking of something along these lines:
Would that be more error prone that what we have to do currently (
while 'running' in m.state: sleep(0.01))? Or do you say that polling event could come later that that state has actually changed?WasabiFan commentedon Oct 15, 2016
No, it's not more error-prone than the loops we currently use; however now that we are building it into the library itself we need to make sure it's not going to fail on edge cases.
Make use of polling functionality in 16-ev3dev kernel
Make use of polling functionality in 16-ev3dev kernel
Make use of polling functionality in 16-ev3dev kernel (#241)