Asked — Edited

Ez Script And The Camera

Has anyone wrote scripts that used info from the camera? I want to combine the movement and colour tracking into the script so the robot can figure out what it wants to follow. Like randomly choose to follow the black cat when it moves and not the white one when she moves. I am going to try and incorporate the ping sensor not for avoidance but to follow the cat at a distance.

I am trying to create more complex stuff other than just wonder around and avoid stuff scripts.

Thanks for the help.


ARC Pro

Upgrade to ARC Pro

Stay on the cutting edge of robotics with ARC Pro, guaranteeing that your robot is always ahead of the game.

United Kingdom
#1  

Quote:

Has anyone wrote scripts that used info from the camera?
Yes...

Quote:

I want to combine the movement and colour tracking into the script so the robot can figure out what it wants to follow.
It wasn't for that though...:)

First, black and white may not be the best colours to try and track. Bright colours like red, blue, green etc. are better to track. You'll have to play with the custom colour tracking options to see if you can get the colours of the cats in there.

Then you need a script, or manually set, for Motion Tracking

ControlCommand("Camera", CameraMotionTracking)

When motion is detected you need the script to switch over to custom colour tracking

IF($CameraIsTracking = 1)
  ControlCommand("Camera", CameraMultiColorTracking)
ENDIF
#2  

Dang Rich you are one sharp dude. Thanks so much for the help..

United Kingdom
#3  

It's a start at the very least, you'll probably need to do a bit more than I've posted above though.

If it comes down to it you could always script to follow the detection, the camera control adds a few variables of it's own including the x and y values of whatever it's detected. I've not done a lot with the camera tracking controls yet but I'm pretty sure it's all built in to the control anyway so minimal scripting is needed (but if not, we can do something I am sure).