Hi all. I’m currently using MediaPipe to track position, and I want to use a TimerCHOP to act as a Switch Index so that when the user is in a certain position for 1.5 seconds, then the TimerCHOP’s Done channel outputs a 1 to change the index. However, I want the TimerCHOP to reset if the input changes from 1 within that 1.5 second interval, and keep checking the input value and running until the input is at 1 for 1.5 seconds. Right now, the TimerCHOP just runs whenever the input channel changes values, and continues until the done channels is at 1 even if the input is no longer at 1.
Below is my operators, where the mathCHOP is the input being fed into the TimerCHOP.
this can often nicely be solved with a Speed CHOP instead:
The first input to the Speed CHOP will just be a Constant CHOP with a value of 1 returning the time since the CHOP was last reset, while the second input is used to reset the Speed CHOP’s output value.
So for the reset input you can use the channel that indicates if the person is moving. If the person is moving, the Speed CHOP will continuously be resetting while when the person standing still, the Speed CHOP will count up to above 1.5 which you can use as your trigger.
Maybe the attached example illustrates the idea. Here I’m using the mouse as “movement” - when you move the mouse, the Speed CHOP will reset, if the mouse is still, it will count to beyond 1.5