Asked — Edited

Wait For Object

I have one trained object. A simple Blockly script with a "Wait For Object" plus a "If CameraObjectName =...". I run the script, point the camera around, finally at the object which is then recognized. Now with the camera pointing up to the white ceiling (or anywhere but not at the object) I start the program again. The blue frame shows and the object seems to be recognized, no wait until the object is in the camera view. Starting the program again, same thing. Only running it a 3rd time it doesn't do it; camera still pointing to the white ceiling. I tried a camera stop and start within the Blockly script, a "Set Camera Tracking To Off", still the same. 1 positive, 2 false positives, regardless of the background, and consistently so (1-2-1-2...). Why is that, what am I missing?

Thanks much!


ARC Pro

Upgrade to ARC Pro

ARC Pro is your gateway to a community of like-minded robot enthusiasts and professionals, all united by a passion for advanced robot programming.

PRO
Synthiam
#1  

Hi! You’ll have to wait for the camera to no longer be in tracking mode. That’s when $IsTracking = false

You can see the red tracking status in the camera control near the bottom. It’ll count up and down when the object is detected or not detected. That’s the number of frames before determine if an object should be tracked or if it’s missing from the camera view.

Also, not sure if you’re doing this but if you disable object tracking right away, then when it’s reactivated it will think it sees the object until the framecount timeout has expired.

Why don’t you post a screenshot of your Blockly script. That’ll be easier to assist

#2  

This little script isn't within Camera Config - Scripts - Tracking, but "standalone".

User-inserted image

Probably one of those beginners mistakes but I have tried a bunch of things. I run the script, go back to the Camera Control which shows 'Tracking(0)', then run the script and it keeps doing the 1-2-1-2 ... no matter what.

Thanks so much for the help!

PRO
Synthiam
#3  

Not a beginners mistake:) it’s a common thing. So what happens is the tracking is disabled (set to off) at the end of the script.

So the next time the script runs, the object recognition engine continues from its last state, which was a detected object.

You don’t need to set object tracking off at the end of the script.:)

#4  

Actually I only added it to see if that would sort of reset the tracking but with or without this last block I get 1 positive, then 2 false positives whenever I run the script. I also tried the "Camera Control Command" block with 'CameraStart' at the beginning and 'CameraStop' at the end to see if that would make a difference but it didn't. No idea what I am doing wrong but the behavior seems odd to me. Any other idea?

#5  

Anyone else any idea?