Hi all,
I am running an experiment where rats have to retrieve a couple of rewards from several goal locations in an open field and then return to a start box where they will stay for a coupel of seconds and then can retrieve more rewards from the goa locations etc...
I am tracking the position of the animal and I would like to plot a dot on the video feed where the goals are. Importantly, I want the dot to change colour (e.g. from red to green) when the animal retrieved a reward and then reset the colour when the animal is back in the start box. The idea is that the experimenter can see on the video feed when the animal collected all rewards.
So far I have managed to plot the dots on the video feed and make them change colour once the animal collects the reward, but I am struggling to implement the resetting part.
My approach is to generate a Boolean/frame ('StartBox') to indicate whether the animal is outside of start box or not. When the animal spends a certain time at a reward location (>3 seconds) I trigger the colour change for the respective dot (importantly only the first time as the animal might revisist a reward location several times). When the animal goes back into the start box I would like to restart all the branches that detect the reward location visits.
I hope this makes sense. Any help/pointers is much appreciated. Thanks a lot.
Cheers
Laurenz