RoboGeek Demo tracking program with Roborealm
ThinkBig from Germany [1 posts]
does anybody experience with the RoboGeek Demo tracking software and roborealm?
Unfortunatley my RoboGeek Desktop Roboturrent tracks the "center of gravity" and jump from 500 to 2000 (waypoints) in x and y direction. i don't have changed the demo code. The connecting between Arduino and Roborealm works as well as the Tracking program.
i use a b/w ueye USB camera. The Roboter should find the center and turn his servos that the center is in the middle of the image. i believe that the pan Servo get a to big/ or the wrong value, but why... ?
The construction manual for the RoboGeek tracking and Roborealm:
GetVariable("IMAGE_WIDTH") / 2
midy = GetVariable("IMAGE_HEIGHT") / 2
pan = GetVariable("PAN_SERVO")
tilt = GetVariable("TILT_SERVO")
laser = GetVariable("LASER")
range = 5
horizFactor = 400 / midx
vertFactor = 400 / midy
size = GetVariable("COG_BOX_SIZE")
if size > 10 then
laser = 1
cogX = GetVariable("COG_X")
if cogX < midx - range then
pan = pan+(midx-cogX)/horizFactor
elseif cogX > midx + range then
pan = pan-(cogX-midx)/horizFactor
cogY = GetVariable("COG_Y")
if cogY < midy - range then
tilt = tilt-(midy-cogY)/vertFactor
elseif cogY > midy + range then
tilt = tilt+(cogY-midy)/vertFactor
if pan > 2500 then pan = 2500
if pan < 500 then pan = 500
if tilt > 2500 then tilt = 2500
if tilt < 500 then tilt = 500
SetVariable "PAN_SERVO", pan
SetVariable "TILT_SERVO", tilt
laser = 0
SetVariable "LASER", laser
Steven Gentner from United States [1370 posts]
The above VBScript is written with the 500 to 2500 value range in mind. Typically this is what a valid range for standard PWM servos are. This is sent to the Arduino which will then set the servos accordingly. If you find that you are using standard PWM (ie. RC servos) and they are apparently moving randomly, check that you have given them enough power. When those servos don't get enough amps to move, they start to behave erratically. You cannot just power these from the Arduino USB connection. You will need an external power supply added to the Arduino of at least 1Amp 6V.
If you are using other non-standard servos (like Dynamixel) the value range of 500 to 2500 is no longer valid and would need to be changed to a correct value range.
Finally, while there is a Trossen Desktop Turret module in RR, that's for the much older model. Since they it has be superseded by the Arduino module which should be used instead.