Society of Robots - Robot Forum

Software => Software => Topic started by: frank26080115 on October 08, 2007, 03:16:28 PM

Title: AVRcam colour map upload
Post by: frank26080115 on October 08, 2007, 03:16:28 PM
I posted on the JRobot forum but haven't gotten an answer yet. Does anybody have any example code for uploading the colour map? I have everything working except the stupid colour map which apparently uses ASCII number characters instead of the usual bytes.
Title: Re: AVRcam colour map upload
Post by: Ro-Bot-X on October 08, 2007, 03:55:04 PM
I am also trying to figure out the AVRcam. I upload the color map using the software from the CD, AVRcamView. I take a picture of the objects, then point with the mouse at the color I want to add to the colour map, right click and select add to map, then click on one of the 8 locations and click on send. Then go back to the picture, select another color, add it to a different location, send again.

Now I have a question for you, something that I didn't figure out yet. How do you parse the bounding boxes? I mean how do you find out how to turn the robot and have it go towards the object you want?
Title: Re: AVRcam colour map upload
Post by: frank26080115 on October 08, 2007, 05:33:36 PM
I can't use his software because he specifically programmed it for COM1, I use a FTDI chip

I'm making my own test software using Processing, so far I can get all the data from the camera, but still can't upload colour map.

Anyhow, the camera outputs the values for the boundaries, lets say xMin is the left and xMax is the right boundary, you find the center of the object like this:

xCent = xMin + (xMax - xMin) / 2

if x is towards the left, turn the robot left, etc

You can also get width and height and use it to determine shape (square or rectangular) so this way you only look for spheres if you are chasing a ball.
Title: Re: AVRcam colour map upload
Post by: frank26080115 on October 09, 2007, 03:42:58 PM
the colour map uploading is really complicated, you don't upload values, everything is boolean, imagine sending this in binary format

(http://www.jrobot.net/pictures/AVRcamVIEW_screenshot1.jpg)
I mean the window on the right

i hooked my laptop's serial to my desktop's serial port to analyze what is being sent...
everything is ascii, so if you send 123 it has to be "1" "2" "3" then a space
Title: Re: AVRcam colour map upload
Post by: Ro-Bot-X on October 10, 2007, 04:41:14 AM
I believe John Orlando has the PC application open source. You may want to take a look at his code to figure it out. At least modify the COM port number to the one the USB adapter gives you and use his application to load the values in the colour table. For me it's too complicated to do it other way.