Finding a bullseye target
Download the Find Target Symbol robofile.
- This demo shows how to track a bullseye target using RoboRealm. This target is convenient to track since we can use the black and
white circles in contrast to each other to detect a circular pattern. This also works even if the target is viewed from a rotated
position (i.e. it is on a wall facing the robot but not right in front of it) where the circle is more of an ellipse than a circle.
This should work in any ordinary room with adequate lighting such that you can see and move around the room.
- First double click on the
Roomba module in the processing pipeline and change the serial COM port
to the one you are using. Note that if you happen to have a serial port on your Netbook then the COM port will most likely be from COM1 to COM4. If you are using
a USB to serial converter then it can be a much higher number. RoboRealm will only display those COM ports that are active within the system
so the COM port selection should be limited to only a few selections. If you are not sure on which COM port is being used start with the highest one and
test while moving to lower ones.
If you have already configured the Roomba in a previous robofile then the COM port should already be configured for your robot assuming the "Remember as default" checkbox in the Roomba GUI interface is set.
- If the camera view is not already present press the Camera button in the main RoboRealm interface to show you the USB webcam image.
If you have multiple cameras installed or other imaging devices you may need to press the Options button->Video Tab and select the
camera from the dropdown list that shows all the imaging devices installed in the system.
- Once you get the COM port and camera set you should see the image from the Roomba in the main RoboRealm GUI.
From here you can
now place a target within view of the robot's camera. Use the following link to view and then print out this target using your browser's File->Print menu.
Once printed, place
the target somewhere within the line of sight of the Roomba. The Roomba will head
towards it as soon as the target is seen.
We track the bullseye target using specific properties of the target that are unlikely to exist
elsewhere in the environment. First we start with an example image that could be seen from
your robot while navigating around your hallway. Note that the target is placed low to the floor to ensure
best viewing by the Roomba.
To segment the bullseye from the scene we first use the Adaptive Threshold module to identify
localized parts of the image that are much brighter or darker than their surrounding. This removes many bad lighting
issues and allows the target to easily be seen while most of the rest of the image is reduced to white. Note that
this thresholding works only on the intensity of the image and disregards the color so black and white images will
- From there we invert the image using the
Negative module as RoboRealm likes to
work with white objects instead of black ones.
- To remove all non-target objects we use the
specific property of a bullseye target that the center of gravity (i.e. where you would balance the shape on a finger) of each of the rings will be very close to
each other and in most cases in exactly the same spot. This is typically seen by a circular target and thus is a very
effective filter for this type of symbol. We use the blob filter module to
eliminate any objects that do not have a close COG near to another blob, to eliminate any small objects from
consideration and finally check that we only result with blobs that are inside of other blobs. Thus we do lose
the outer ring of the target but the inner two are kept.
- Finally we now need to tell the Roomba 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 Roomba 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 left and right variable that contains the suggested direction that the Roomba should move. The Roomba module then grabs this value and passes it to the Roomba robot to complete the cycle.