Skip to content

Commit

Permalink
* flip new camera frames
Browse files Browse the repository at this point in the history
  • Loading branch information
JuliusHendrix committed May 21, 2022
1 parent 403aed1 commit 4ef5997
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Main/bounce.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,19 @@ def bounce(rendering):

# main loop
try:
# initial state
bb.set_camera_bottom_servo_angle(-90)

# continuous video stream
for frame in camera.capture_continuous(rawCapture, format="bgr", use_video_port=True):
for raw_frame in camera.capture_continuous(rawCapture, format="bgr", use_video_port=True):
# get frame, flipped
frame = cv2.flip(raw_frame.array, -1)

print(f'{state = }')

# check if in bounds
if abs(timer.get_timer()) > time_to_max_distance:
print('out of bounds')
state = 'stand'
else:
direction, fire = detector.check_for_object(frame.array, show_video=show_video)
direction, fire = detector.check_for_object(frame, show_video=show_video)
state = direction

if direction == "right":
Expand Down

0 comments on commit 4ef5997

Please sign in to comment.