Here are the long-promised videos of my hex tracking blue objects! Currently running my VB.net software + Roborealm. Hardware = SSC32 and bluetooth. Enjoy.
I already said before that I like the way you’ve mounted the cam on top of the hex. It gives it a unique look!
Great work on the tracking part! How do you control the neck? Do you move it to his max and start walking then or do you move the body and neck like 20/80%?
Have you got a link to the cam you’re using. I’m curious about the spec’s.
I would have to say that I have been really pleased with this camera overall. It is the perfect size, easy to mount (the original mount just screws off the bottom and I just screwed it back onto a plate!) It also has a built in li-ion battery (still deciding if I like that) and nightvision.
The only drawback is that because it uses IR for nightvision, it has a red filter on the lens. This makes the color red show up really weak in the standard daytime picture. So, for example the robot has trouble telling the difference between skin and say my mission style furniture.
While watching your videos I couldn’t help thinking that I could get about the same reaction to waving a small bag of cookies (or chips) in front of a 2yo… except when you placed it on the floor they would have pounced on it.
Xan, here is the code for the face tracking…it is still a little rough but it gets good results:
[code] Private Sub FaceTracking()
'Input variables
Dim VisionHeight As Integer = 0
Dim VisionWidth As Integer = 0
Dim VisionArea As Integer = 0
Dim InputString As String = 0
Dim COGx As Double = 0
Dim COGy As Double = 0
Dim ObjectSize As Double = 0
'Calculations
Dim CenterX As Double = 0
Dim CenterY As Double = 0
Dim MovementCorrectionFactor As Integer = 75 'Percentage of “offcenterness” to correct per move
Dim DeadZone As Integer = 20 'In Pixels…should equal the smallest unit of pixels/degree
Dim MoveIncrement As Integer = 25 'Pixels/servo degree
Dim MoveTotal As Double = 0
'Calculate Vision Field Size and Center
VisionSource.GetDimension(VisionWidth, VisionHeight)
VisionArea = VisionHeight * VisionWidth
CenterX = VisionWidth / 2
CenterY = VisionHeight / 2
'Get Object Position Data and Convert to Numbers
InputString = VisionSource.GetVariable("COG_X")
If InputString = "" Then
COGx = CenterX
Else
COGx = Double.Parse(InputString)
End If
InputString = VisionSource.GetVariable("COG_Y")
If InputString = "" Then
COGy = CenterY
Else
COGy = Double.Parse(InputString)
End If
InputString = VisionSource.GetVariable("COG_BOX_SIZE")
If InputString = "" Then
'Do nothing
Else
ObjectSize = Double.Parse(InputString)
ObjectSize = Math.Pow(ObjectSize, 2)
End If
'Track
If Math.Abs(COGx - CenterX) < DeadZone Then
'Camera is in deadzone so do nothing
Else
MoveTotal = (((COGx - CenterX) / MoveIncrement) * (MovementCorrectionFactor / 100))
HeadPanY = HeadPanY + MoveTotal
If HeadPanY > HeadPan_MAX Then
HeadPanY = HeadPan_MAX
ElseIf HeadPanY < HeadPan_MIN Then
HeadPanY = HeadPan_MIN
End If
End If
If Math.Abs(COGy - CenterY) < DeadZone Then
'Camera is in deadzone so do nothing
Else
MoveTotal = (((COGy - CenterY) / MoveIncrement) * (MovementCorrectionFactor / 100))
HeadTiltX = HeadTiltX + MoveTotal
If HeadTiltX > HeadTilt_MAX Then
HeadTiltX = HeadTilt_MAX
ElseIf HeadTiltX < HeadTilt_MIN Then
HeadTiltX = HeadTilt_MIN
End If
End If
'Turning in circle to track movement
If HeadPanY >= (0.8 * HeadPan_MAX) Then
'Debug.Print("Right")
TravelRotationY = TravelRotationYMax / 2
ElseIf HeadPanY <= (0.8 * HeadPan_MIN) Then
'Debug.Print("Left")
TravelRotationY = -TravelRotationYMax / 2
Else
TravelRotationY = 0
End If
'Tilting body up/down to track movement
If HeadTiltX >= (0.65 * HeadTilt_MAX) Then
'Debug.Print("Up")
If Math.Abs(BodyRotX - 1) < (BodyRotXMax / 4) Then
BodyRotX = BodyRotX - 1
End If
ElseIf HeadTiltX <= (0.45 * HeadTilt_MIN) Then
If Math.Abs(BodyRotX + 1) < (BodyRotXMax / 4) Then
BodyRotX = BodyRotX + 1
End If
Else
BodyRotX = 0
End If
End Sub[/code]
Thanks for sharing your code. I’ve checked your code and noticed that you start walking at 80% like you said on a earlier post. Did you also tried twisting the body before starting to walk? I think this would even make it look more natural then it already does!
Cosmetic:
Drop down box for gait selection (you aksed for it T4ndu, you got it!)
Check box for on road/ off road selection
Completely new tab dedicated to blob tracking
Features:
Individual blob tracking features can now be turned on and off and/or combined…such as twisting, 360 degree rotation, head movement, tilt etc.
This is what I’m thinking about for options, in order of preference:
Custom turret that FlowbotX had made by Big Blue Saw. I really liked the behavior in the video, it was perfect. I would need specs I could send to Big Blue Saw, servos used, preferably pictures of how it was mounted. A close up of the mounting would be helpful regardless of which option I choose.
The MSR-H01 Pan/Tilt Head Kit. I think I saw this in another video. I looked good for the sensor setup but not sure how it would work for a camera setup.
I ordered this from Wal-mart. Seems to be stuck in infrared mode even in full lighting. The infrared lights turn on and off properly and infrared mode works properly in the dark but doesn’t seem to switch off when back in light (even though I can see the infrared lights turn off). Ends up having a more or less black and white negative image with no color. Sent a message to Astak support. They didn’t have much for trouble shooting on their site so I’m not very hopeful. May have to send it back.
That’s ultra-strage. My camera switches back and forth with ease. I would try to return it and get another.
Also, what hexapod do you have? Because that might influence which will be the best pan/tilt option. Do you have project thread?
Additionally, I can send you the cad file I sent to Big Blue Saw. But, I’m not sure what the price will be right now since they aren’t having a sale. They do, however, have sales every so often.