Breack condition (3)

<< Click to Display Table of Contents >>

Navigation:  Examples > Image processing > Search and approach > Rotate >

Breack condition (3)

Previous pageReturn to chapter overviewNext page

example_search_and_approch_rotate

The sub program is terminated when the global variable "next" is unequal to 0.

If the speed set-point is 0 the red cylinder is in the image center, i.e. Robotino is facing the red cylinder. The set-point is compared with 0.

At program startup there is no guaranty that a camera image is available. If there is no camera image the Image information outputs 0 for the image width. The Segment tracker also outputs 0 as x-coordinateso that the set-point is also 0. The break condition would be true. That is the reason why we have to take into account the number of segments found by the Segment tracker. Only if the number of segments found is larger 0 "next" can be set to 1.