Looking at the AI Vision documentation here: https://api.vex.com/aim/home/python/AI_Vision.html#exists
I can't make sense of the "exists" attribute. In the section on ball detection, the example code does this:
# Move forward if a sports ball is detected
while True:
ball = robot.vision.get_data(SPORTS_BALL)
if ball[0].exists:
robot.move_for(10, 0)
wait(50, MSEC)
But if there is no sports ball detected, get_data will return an empty list [ ], so ball[0] will cause an error.
Also, looking at the source code, the "exists" attribute is only mentioned once in the code, in aim.py, where it is set to True.
Looking at the AI Vision documentation here: https://api.vex.com/aim/home/python/AI_Vision.html#exists
I can't make sense of the "exists" attribute. In the section on ball detection, the example code does this:
But if there is no sports ball detected, get_data will return an empty list [ ], so ball[0] will cause an error.
Also, looking at the source code, the "exists" attribute is only mentioned once in the code, in aim.py, where it is set to True.