loading
 
Spykee Red Ball
joeytk from United States  [3 posts]
7 years
Hi. I loaded the Spykee Red Ball program into roborealm and spykee just starts rolling forward. It doesn't track anything. Is the robot supposed to move continuously or just when it sees something red? I set the motor pulses to 50 so at least now it doesn't race off but it still doesn't track. Any ideas?
Anonymous 7 years
It is supposed to pivot when it doesn't see anything red and move forward only when it sees something red.

What you can do it snap an image using the main RR gui when it is moving forward and then investigate what in that image could be causing the issue by loading it into RR with the Spykee module disabled. Then you can step through each module to see what is being detected (mainly the RGB module in particular).

Or post the image that you snapped here and we'll investigate what might be going wrong.

STeven.
joeytk from United States  [3 posts] 7 years
Hi Steve
Thanks for getting back to me. Seems like I just had to tweak the red filter a bit. What I would like to do now is have the spykee just sit still until it sees the ball and then start tracking. I'm not familiar with writing Vbscript yet but I  am very slowly figuring it out. What part of the script should be altered to have the robot just sit and not rotate until it sees the ball? Thanks again
Anonymous 7 years
Assuming the script is still somewhat the same as ours, it will be using the COG or Center of Gravity module. This will generate a variable called COG_BOX_SIZE which will be some larger number when something is being seen. So checking that variable in your VBScript will allow you to stop the bot. So right at the bottom of the VBScript you can add

if GetVariable("COG_BOX_SIZE") < 10 then
  SetVariable "left_motor", 128
  SetVariable "right_motor", 128
end if

which should do the job. You can also be a little smarter about the script and use that conditional to avoid calculating the movement based on a too small object ... but that requires some rearrangement of the script.

OR if the following lines still exist in your script

if state = 0 then
  left_motor = 120
  right_motor = 145
  SetTimedVariable "scanning", 2, 7000
  SetVariable "scanning", 1
elseif state = 2 then
  left_motor = 128
  right_motor = 128
else
  left_motor = GetVariable("left_motor")
  right_motor = GetVariable("right_motor")
end if

you can replace all that with just

left_motor = 128
right_motor = 128

which would stop the movement.

STeven.
joeytk from United States  [3 posts] 7 years
Hi Steve
Thanks again. That script modification worked perfectly and the spykee is dead on with tracking the red ball. I have 2 more questions then I'll leave you alone for a while. My pipeline looks like this - spykee mod, RGB filter red, Erode, Center of Gravity and VBscript. The attached image was taken while highlighting the Center of Gravity mod. Should it look so noisy? I  also find that I have to put the spykee mod first in the pipeline. If it is at the end like it was in the original red ball chasing program the tracking box is huge and the spykee doesn't perform well. I know placing the filters in a certain order def affects what the robot sees but does placing the spykee mod in a particular spot affect performance? Thanks

 
Anonymous 7 years
joeytk,

Yes it will change the result depending on where you have the Spykee module as that's the module that produces the image. IF you load in an image with the same dimensions as the Spykee module produces then the above issue goes away. The reason for this is how the graphics and added to the image after all processing is done. When the pipeline loops around it will take the image size of the default image loaded in RoboRealm and then change that when the Spykee module is encountered. The problem is when the second loop through the pipeline is done to add the graphics the image is not the same size as it was initially. So either put the Spykee module first (recommended placement) or drag an image into RR with the same dimensions.

The problem comes from preventing the graphics from being processed along with the image. Note that in the above image the square is actually ok (a graphic) whilst the image data is all twisted.

STeven.

This forum thread has been closed due to inactivity (more than 4 months) or number of replies (more than 50 messages). Please start a New Post and enter a new forum thread with the appropriate title.

 New Post   Forum Index