Skip to content

Commit f36a88b

Browse files
added 5 points to scoreboard for correct prediction (#279)
1 parent 8d15918 commit f36a88b

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

mep3_hardware/mep3_hardware/box_driver.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ def __init__(self):
2727
qos_profile=QoSProfile(depth=1, reliability=ReliabilityPolicy.RELIABLE, durability=DurabilityPolicy.TRANSIENT_LOCAL))
2828
self.get_logger().info('Logging level: %d' % self.get_logger().get_effective_level())
2929
self.points = 0
30+
self.balls_in_box = False
3031
self.START_MESSAGE = ("0202").encode('utf-8')
3132

3233
# Create a UDP socket and listen for incoming data
@@ -60,6 +61,13 @@ def publish_scoreboard(self):
6061
self.points = points
6162
self.publisher.publish(scoreboard_msg)
6263
self.get_logger().info('Published scoreboard: task=%s, points=%d' % (scoreboard_msg.task, scoreboard_msg.points))
64+
if not self.has_balls_in_box:
65+
self.has_balls_in_box = True
66+
scoreboard_msg = Scoreboard()
67+
scoreboard_msg.task = 'box_correct_prediction_5_points'
68+
scoreboard_msg.points = 5
69+
self.publisher.publish(scoreboard_msg)
70+
6371

6472

6573
def main(args=None):

mep3_hardware/test/UDP_communucation/udp_client_basic_v2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
BUFFER_SIZE = 1024
77

88
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
9-
counter = "0202"
9+
counter = "1212"
1010
while (True):
1111
MESSAGE = (counter).encode('utf-8') # The message you want to send to the server
1212

0 commit comments

Comments
 (0)