Skip to content

Commit

Permalink
Updated game_piece from a boolean to a number
Browse files Browse the repository at this point in the history
  • Loading branch information
Injector-Spenral committed Mar 10, 2019
1 parent 73cd627 commit 6a23d93
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cameraServer.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def getRetroPos(frame: np.array, annotated: bool, hsv: np.array, mask: np.array)
raspi_pong.setNumber(time.monotonic())
rio_pong.setNumber(ping_time)
old_ping_time = ping_time
game_piece = entry_game_piece.getNumber(0)
game_piece = entry_game_piece.getBoolean(0)
fiducial_time = time.monotonic()
sink = hatch_sink if game_piece == 0 else cargo_rocket_sink
entry_camera.setBoolean(False if not game_piece else True)
Expand All @@ -216,7 +216,7 @@ def getRetroPos(frame: np.array, annotated: bool, hsv: np.array, mask: np.array)
else:
image, dist, offset = getRetroPos(frame, True, hsv, mask)
source.putFrame(image)
if not math.isnan(dist) and not dist < 0.6 and not dist > 3 and not abs(offset) > 2:
if not math.isnan(dist):
if game_piece == 1:
dist *= -1
offset *= -1
Expand Down

2 comments on commit 6a23d93

@auscompgeek
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit makes no sense.

@Injector-Spenral
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. I must have done something in the wrong order

Please sign in to comment.