I’m using the botboard and ssc together with botrealm to track a red ball. Because I have a Biped, I need the serial connection to be on the botboard. The problem however is that I cannot find any tutorial for this. I read the serial communication tutorial: roborealm.com/help/Serial.php
I’m assuming that I need to setup as such:
-Wireless webcam on bot that communicates with the pc
-pc communicates back to the botboard via bluetooth
-the microcontroller(BS2 in my case) receives info about the ball and tells the SSC to move accordingly
after some figuring I managed to make my own Boe Bot work, somewhat… The only problem is that it only goes in one direction, and when it turns it only turns one direction. I’m using VB to program the bot:
[code]’ initialize our start motor values to neutral
left_base = 750
right_base = 750
’ get current image size
width = GetVariable(“IMAGE_WIDTH”)
center = width / 2
’ get the size (width or height) of the current
’ bounding box
size = GetVariable(“COG_BOX_SIZE”)
’ if it is equal to “” then no object was detected
if size <> “” then
’ get the horizontal center of gravity found by the COG
’ module
cogX = GetVariable(“COG_X”)
’ if it is less than 75 the blob is on the left side
’ of the screen so move that way
if cogX < center-5 then
left_base = 750-(center-cogX)/2
right_base = 750
’ otherwise move to the right if above 85 pixels (and no
’ movement if 75 < cogX < 85 )
elseif cogX > center+5 then
left_base = 750
right_base = 750+(cogX-center)/2
end if
’ if the ball is too close then we have to move backwards
if (size>140) then
num=1
left_motor = left_base-((size-40)*2)
right_motor = right_base+((size-40)*2)
’ otherwise move forward
else
num=0
left_motor = left_base+((40-size)*2)
right_motor = right_base-((40-size)*2)
end if
’ set the final motor values to be picked up by
’ the SSC module
end if
if (size<20) then
left_motor=750
right_motor=750
end if
SetVariable “LEFT_MOTOR”, CInt(left_motor)
SetVariable “RIGHT_MOTOR”, CInt(right_motor)
SetVariable “NUM”, CInt(num)[/code]
Supposedly this code is supposed to be able to let the boebot go forward and backward according to its distance from the ball it sees. It also is supposed to turn itself so the ball is always at the center of its vision. However what really happens is that as long the the ball is on the screen, the boebot moves forward, regardless of how close it is. Turning doesnt seem to work at all; with some debugging I found out that both the forward and backward code were used, so its not this program’s fault. Have anyone else tried using Roborealm? Can you think of any reasons for this?
Thanks!
You have the right idea on how to do this. A web cam needs to send images wirelessly to the pc so RoboRealm can process the images and using VBS within RoboRealm, the code could be instructed to send data via blue tooth connected to the serial port back to the bot for control purposes.
I don’t know how to program in VB or VBS so I can’t help much in this area. Your goal should be to first send variable data via blue tooth to the bot board and using BS2 code have it respond to the different commands such as move left move right etc…
thanks for the reply! I got the boebot to move forward backward according to the ball and even got it to be able to follow the ball.
But my goal was to have it be a goalie. And sadly its servos are extremely lame(parallax standard servos!!!).
Suppose a ball flashes past to its left, it will turn left but by the time it turns the ball would have already went past it. It’s not that the bot’s camera is slow, the fps is around 20- which is enough-but the problem is with two wheels, it cant turn and go forward/back at the same time.
Of course I could always be lame and have the bot only know how to go back and forth in front of the goal(like in Pong). Right now I’m trying to figure out how to make it work so that it can actually work.
As for the biped…I have not yet incorporated this yet
Do you have any recommendations for some cheap wireless webcams? Currently I’m going by with wire ones, but in the end I will need wireless.
Here’s the discription:
This super-small
(1" x 3/4" by 7/8") 1/4
ounce, 3 Lux wireless
camera and receiver
combo delivers sharp,
full-motion video images
at 380 lines of resolution. With its 150’
(unobstructed) range and 9-volt battery power.
It’s small, relatively inexpensive, light weight, low power and it’s color:
SN96, thanks for the suggestion! But I’m a little tight on budget and I need more than one cam. I found a cheaper mini cam here: amazon.com/Mini-Wireless-Color-Camera-Microphone/dp/B000YM2OIK
do you think that this is capable enough to handle the task?
I researched a bit more on these cameras, and apparently they can’t be connected to the computer w// their video cords. Is it possible to get an adapter for this?
you just need a video capture card/device for the computer. Generally the type where a card is installed in the computer work better, but you can also get USB based ones as well. This used to be an expensive thing to add to a computer but these days it’s cheap enough to do that a lot of consumer video cards have them built in as a “feature” so check the one in your computer. A stand alone card will frequently have more than a single input so that is good for multiple cameras. An exampe, it seems to me the Euresys Picolo was an inexpensive frame grabber we used on a project that had 1 video input and a 3 channel video multiplexer on the same $99 USD card, and it was physically small too. There are lots of this type of thing around though so google away.
Didn’t you say that you needed more than one camera? This looks like it only supports one camera at a time… Unless of course, you mean to get two of these
I dunno… the user reviews only put it about 2.5 / 5 and several are pretty unhappy with it. Still for $30 you might get lucky.
Yes the two products should connect fine… anything that supports composite video input (typically a vellow rca style jack) should work.
a lot of USB capture devices like this are off shore developed single chip ASIC solutions and companies are knocking them out for nearly nothing so if half of them don’t work for folks they have squat invested and customer service is like some kind of alien concept. just be forewarned before you go having big expectations.
You may want to check supercircuits below to see their wireless video. Composite video signals can be switched with a transistor, so using several cheap cams switched into a single tramsmitter on the bot may be the easiest multicam setup.