LookForBiColorMarkers demo

From Tekkotsu Wiki

Jump to: navigation, search

The LookForBiColorMarkers demo looks for bicolor markers in the current camera image and displays them in the camera and local shape spaces.

Robot type: any platform with a camera

Where to find the demo: Root Control > Framework Demos > Navigation Demos > LookForBiColorMarkers

Source code: Tekkotsu/Behaviors/Demos/Navigation/LookForBiColorMarkers.cc.fsm

Setup Instructions

You will need at least one bicolor marker. Set the marker up in front of the robot. Using the RawCam and SegCam viewers, adjust the ASUS Camera Settings for the current lighting conditions so that the marker segments properly.

Running the Demo

Start the demo and open the camera and local SketchGUI viewers by clicking on the C and L buttons in the ControllerGUI. Control-click on camFrame and rawY. Note that the top color strip determines the color of the marker symbol displayed in the SketchGUI image, e.g., an orange-above-blue marker will display as orange. Each time you run the demo it will search the current camera image for markers and report what it sees. To repeat the process, stop the demo and start it again, then click Refresh in the SketchGUI window.

First verify that the marker is detected in the camera image. Check the marker coordinates in the camera Space SketchGUI. The x and y coordinates correspond to the pixel location in the camera image, with (0, 0) being the top left corner. The z coordinate is the estimated distance in millimeters from the camera to the marker. Next, check the coordinates in the local space SketchGUI. The x and y coordinates are distance ahead (x) and to the left (y) of the robot's midline. The z coordinate should equal the marker height, which is 177.8 mm (7 inches).

Measure the distance from the marker to the webcam, and adjust the tilt of the ASUS screen until the estimated distance in the local space (the x coordinate, if the y coordinate is close to zero) roughly matches this distance.