remove block highlight

This commit is contained in:
Silver Kuusik 2018-07-18 18:42:03 +02:00 committed by GitHub
parent a304e94e68
commit 790dbbe128
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

16
hal.py
View File

@ -117,10 +117,6 @@ class Sumorobot(object):
# Function to get boolean if there is something in front of the SumoRobot # Function to get boolean if there is something in front of the SumoRobot
def is_opponent(self, block_id = None): def is_opponent(self, block_id = None):
# When block_id given and blockly highlight is on
if block_id and self.config["blockly_highlight"]:
self.highlight_block(block_id)
# Get the opponent distance # Get the opponent distance
self.opponent_distance = self.get_opponent_distance() self.opponent_distance = self.get_opponent_distance()
# When the opponent is close and the ping actually returned # When the opponent is close and the ping actually returned
@ -169,10 +165,6 @@ class Sumorobot(object):
# Check for valid direction # Check for valid direction
assert dir == LEFT or dir == RIGHT assert dir == LEFT or dir == RIGHT
# When block_id given and blockly highlight is on
if block_id and self.config["blockly_highlight"]:
self.highlight_block(block_id)
# Return the given line sensor value # Return the given line sensor value
if dir == LEFT: if dir == LEFT:
line = abs(self.get_line(LEFT) - self.config["left_line_threshold"]) > 1000 line = abs(self.get_line(LEFT) - self.config["left_line_threshold"]) > 1000
@ -214,10 +206,6 @@ class Sumorobot(object):
# Check for valid direction # Check for valid direction
assert dir == STOP or dir == RIGHT or dir == LEFT or dir == BACKWARD or dir == FORWARD assert dir == STOP or dir == RIGHT or dir == LEFT or dir == BACKWARD or dir == FORWARD
# When block_id given and blockly highlight is on
if block_id and self.config["blockly_highlight"]:
self.highlight_block(block_id)
# Go to the given direction # Go to the given direction
if dir == STOP: if dir == STOP:
self.set_servo(LEFT, 0) self.set_servo(LEFT, 0)
@ -251,10 +239,6 @@ class Sumorobot(object):
# Check for valid delay # Check for valid delay
assert delay > 0 assert delay > 0
# When block_id given and blockly highlight is on
if block_id and self.config["blockly_highlight"]:
self.highlight_block(block_id)
# Split the delay into 50ms chunks # Split the delay into 50ms chunks
for j in range(0, delay, 50): for j in range(0, delay, 50):
# Check for forceful termination # Check for forceful termination