Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions mep3_hardware/mep3_hardware/box_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def __init__(self):
qos_profile=QoSProfile(depth=1, reliability=ReliabilityPolicy.RELIABLE, durability=DurabilityPolicy.TRANSIENT_LOCAL))
self.get_logger().info('Logging level: %d' % self.get_logger().get_effective_level())
self.points = 0
self.balls_in_box = False
self.START_MESSAGE = ("0202").encode('utf-8')

# Create a UDP socket and listen for incoming data
Expand Down Expand Up @@ -60,6 +61,13 @@ def publish_scoreboard(self):
self.points = points
self.publisher.publish(scoreboard_msg)
self.get_logger().info('Published scoreboard: task=%s, points=%d' % (scoreboard_msg.task, scoreboard_msg.points))
if not self.has_balls_in_box:
self.has_balls_in_box = True
scoreboard_msg = Scoreboard()
scoreboard_msg.task = 'box_correct_prediction_5_points'
scoreboard_msg.points = 5
self.publisher.publish(scoreboard_msg)



def main(args=None):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
BUFFER_SIZE = 1024

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

Expand Down