loading
 
soccer robot
mohammad from United States  [1 posts]
2 years
hi Steve i'm developing  Soccer Robot with RoboRealm . I can detect the ball now but i want to detect another object after detecting the ball .Is there any way that i put an if statement then it detect the second object with all filters separate from the first object ?
Steven from United States  [1425 posts] 2 years
Yes, this is possible. The best way to think about this kind of sequential processing is to do so using states. I.e. use one variable set to

state = 1

within the Main tab use a conditional If_Statement to check if the state is 1. If so, run the recognition for the ball. Once this is detected, i.e. something like Object_Count is not zero from the Object Recognition module (although you'd NOT use that for just a ball) you would set the

state = 2

This would disable the ball conditional and could then be picked up by a second If_Statement at the level of the first If_Statement .. and so on.

See the attached robofile for an example:

STeven.
program.robo

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