
elfege

Hi everybody,
I'm stuck with GLyph, QRcode, object tracking and all camera features because :
When I write a script such as :Code:
If($CameraQRcode = "DOCK")
Print("I CAN SEE THE QR CODE")
Endif
It seems to work in a totally random way. Once, by chance, the QR code has been seen, IT WILL ALLWAYS BE SEEN, even when the camear is totally looking elsewhere. The script still prints out the message. I tried to find a funcion which would reset the QRcode and found the controlcommand("camera", CameraResetQRCode) in the online script manual (this control doesn't appear at all in the Script Help nor in the Cheat Sheet), but still the same result.
Can someone help me with this?
Here (one of) the script(s) I'm trying to get running : Code:
ControlCommand("Camera", PauseOff)
ControlCommand("Script Manager", scriptstart, "avoidIRSEUL")
ControlCommand("Camera", CameraQRcodeTrackingEnable)
pwm(D19, 99)
:start
repeatuntil($CameraQRcode = "DOCK")
left(250, 300)
sleep(2000)
EndRepeatUntil
ControlCommand("Camera", CameraResetQRCode)
sleep(2000)
if($CameraQRcode = "FORWARD")
Goto(closer)
else
RepeatUntil($CameraQRcode = "FORWARD")
left(250, 500)
sleep(2000)
EndRepeatUntil
Goto(closer)
Endif
:closer
ControlCommand("Script Manager", ScriptStart, "dock")
Halt()
I know I'm missing something(s)... but I'm stuck... and frustrated...
HOWEVER now I need to know how I can make my robot move in such a manner that it will turn left/right move sligtly forward/reverse until the QRcode is centered in the camera's window and thus aligned with the robot.
When I find this out, since I already have a docking script that works pretty well as long as the robot is more or less aligned with the docking station, I'll have finished doing an almost complete automating docking system!
Who will help me with this, show me the way?
Thanks in advance!
Elfège.
Where is this script running? Is it a Script Manager? Or is it On Tracking Start in the camera device? Because if it's just a script, then you don't actually check if the camera has detected it or not with the status. It's recommended to use the Tracking Start script in the Camera Device. Reference the tutorial for Multi Color Tracking in the Activity section. Here is a direct link: http://www.ez-robot.com/Tutorials/Lesson/64?courseId=6
In the future, you can use the [ code ] and [ /code ] UBB code commands to wrap your code examples to make it easier for others to read. You can see UBB code examples on this page while replying or creating posts. I have edited your post to make it easier for me to read.
The ResetQRCode ControlCommand() is indeed in the Cheat Sheet. All commands are in alphabetical order, you will find it in the Cheat Sheet list under the Camera Device.
I got everything working and my robot can dock by itself now, and even recover from missing the station.
Thanks again.
Elfege
Alan
Dj, I can't just use the "Tracking start" feature because it would work whatever the QR code or Glyph or Object is detected. It kicks in as soon as ANYTHING is detected and I want to be able to configure differentiated behaviors. It is getting really annoying and I don't know what I am missing here. Glyph scripts all kick in properly.
Thetechguru, I already have a "smartdock" script that works as long as the rover is more or less aligned. It can even try again if no success after several short left/right and long pushes (forwards at low pwm but long time such as 3000 ms) to make contact. I also use an old neato base for it is very convenient due to its width and springs that push the connectors back toward the rover.
I'm sending a copy of my EWbuilder file. Maybe you can tell me why my QRcode scripts won't kick in.
Best,
Elfège
Here is a video with the ARC file. Some scripts are useless in the scrip manager and I still have to dump them. The important ones are those :
Boot
off
AvoidIRseul
Search (the one that starts the search for the glyph)
Armrest
keepalive
GotoGlyph1
ROBOTS.EZB
Alan
youtu.be/kQaZuT-XeyA
ROBOTS.EZB