Download the Chase Light robofile.
- First double click on the WowWee module in the processing pipeline. It may take a while to appear since it
will immediately try to connect to the default Rovio setting at 192.168.1.10. When it does appear change the IP address
to the one you are using. If you do not know the IP address of the robot you will have to check your router information.
If you have already configured the Rovio in a previous robofile then the IP address should already be configured for your robot assuming the "Remember as default" in the Rovio GUI interface is set.
- Once you get the right IP address you should see the image from the Rovio in the main RoboRealm GUI and the
robot starting to react to light and dark area. Try using just a single flashlight in your room to see
if the Rovio heads towards that light.
- We do this by first cropping the image to ignore lights on the ceiling
using the Crop module.
- Then we remove pixels that are not very bright
using the RGB_Filter module.
- Since small blobs are not very good indicators of where light
is we remove them from the image using the Blob Size module.
- Now we want to know the center of gravity of the remaining light
blobs which is a good indication of where we should move the robot in order to follow the light. We
do this using the Center of Gravity module.
Finally we now need to tell the Rovio how to move in order to get to the identified light. We do this by
understanding on what side of the image the identified target is. In our case it is on the right side.
If the desired target point is right of the center of the
image we need to move the robot right, whilst if it is on the left we need to move left. If we create this
behavior the robot will move in the direction of the light. The VBscript
module allows us to write some VBScript to set the motor values of the Rovio based on the X coordinate of the target
point. The more the X location is to the right the harder we should turn LEFT and vice versa for the other side. The VBScript module produces
a 'move' variable that contains the suggested direction that the Rovio should perform. The Rovio module then grabs this value
and passes it to the Rovio robot to complete the cycle.