Has anyone tried pan and tilt with the ssc32? I have wrote some vbscript code but can’t seem to get the movement smooth enough when tracking an object. After adapting the code from the tutorial on roborealm, I can track the object but when it moves off the screen I can not get the servo control to realign. Any ideas?
More info would help,ie are u using color tracking might would help to post ur code so someone could see what its doing ,other than that u might try moving the object slower or making the servos move faster as for smoothing the movement mabe some ramping
airraptor,
Check out this thread over at the Parallax Robot Forum:
forums.parallax.com/forums/defau … 1&m=186647
T0m’s original code does not appear to control the wireless camera pan & tilt mount, but I suspect that later code does. You might want to email him about his control of the pan & tilt mount using RoboRealm.
Also, check out this video of a BoeBot running under RoboRealm. You will notice that the Pan & Tilt platform the wireless camera is mounted on is moving to keep the ball within the FOV:
youtube.com/watch?v=gbf0zaxWjvI
Regards,
TCIII
Here is a brief breakdown of the modules i am using. After following the roborealm tutorial for tracking the green ball; I have the RGBFilter for Red detection, Center of Gravity with 20% Pixels and .02 stop tracking. I then included the Lynxmotion_SSC module with pan and tilt set on servos 0 and 1 respectively. Finally here is the VBScript programming code I have modified for tracking:
’ initialize our start motor values to neutral
’ get the size (width or height) of the current
size = GetVariable(“COG_BOX_SIZE”)
’ if it is equal to “” then no object was detected
if size <> “” then
pan= GetVariable(“PAN”)
cogX = GetVariable(“COG_X”)
if (cogX < 290) AND (cogX > 90) then
pan = 2200 - cogX
end if
if cogX >290 then
pan = (pan- cogX+200 )
end if
SetVariable "PAN", pan
tilt = GetVariable(“TILT”)
cogY = GetVariable(“COG_Y”)
if (cogY < 200) AND (cogY > 20) then
tilt = cogY + 700
end if
SetVariable “TILT”, tilt
SetVariable “COG_X”,cogX
SetVariable “COG_Y”, cogY
end if
Hope this helps.
I’m having similar problems right now. I have not tried using roborealm with the ssc-32 yet but in the past, servo erratic movement has been caused by the following:
- Under voltage
- To much voltage
- Moving in to large of incremented steps
I don’t believe there is a significant difference in the supply voltage. I am using a 6v regulated 600ma wallplug. However the large steps maybe causing the problem. I can get the servo to track when the object is in the initial frame of view however when the object is gradually moved “off screen”, to the left or right, the servos will jump back to the initial position rather than continue following the object.
I’ve emailed STeven over at RoboRealm. Hopefully he can shed some light on the subject.
Jim, you ever get any response from Steven?
Same issue here, jerky movement… I think its due to a problem with the SSC-32 module and FPS actually. When I disable the SSC-32 module in roborealm… FPS is about average. As soon as I enable it, FPS drops down to 1fps, hence the jerky movement as its only updating once per second.
Sorry it was like 6 months ago. I don’t know. You may want to contact him directly. I’m quite burried right now.
The jerky servos is due to the servo moving at top speed, so when it makes small moves it zips right to that new position causing jerky motion. The servo needs to slow down. I have not tried it yet, but I bet you can get much smoother moves if you send the time parameter to the ssc-32 so the servo moves slower. There is nothing wrong with RoboRealm.
Yar, I already slowed them down… still only getting 1fps when running the SSC-32 module in Roborealm… I disable it and it goes back up to normal. I’m positive this is what’s causing the jerky movement, as its only updating once per second…
Yar,
I had this exact same problem but forgot how I fixed it. Time to fire up RR and see…