Skip to content

Commit

Permalink
navigator_ball_launcher: Remove print statements, fix timer events, f…
Browse files Browse the repository at this point in the history
…inal push after testing with adrian (#1275)
  • Loading branch information
cbrxyz committed Oct 22, 2024
1 parent 37f80be commit 964f11d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def __init__(self, port: str):
self.heard_nack = False
self.drops = 0
self.temp_timer = None
print("done init")
rospy.loginfo("Ball launcher device initialized")

def get_drop_count(self) -> int:
return self.drops
Expand All @@ -51,10 +51,10 @@ def _check_for_valid_response(self, event: str):
elif not self.heard_ack:
rospy.logerr(f"Failed to {event} (no response from board)")

def _check_for_dropped_ball(self):
def _check_for_dropped_ball(self, _):
self._check_for_valid_response("drop ball")

def _check_for_spun(self):
def _check_for_spun(self, _):
self._check_for_valid_response("set spin")

def drop_ball(self, _: EmptyRequest):
Expand Down Expand Up @@ -84,7 +84,6 @@ def spin(self, request: SetBoolRequest):
return {}

def on_packet_received(self, packet: AckPacket | NackPacket) -> None:
print("inc packet", packet)
if isinstance(packet, AckPacket):
self.heard_ack = True
elif isinstance(packet, NackPacket):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@

if __name__ == "__main__":
rospy.init_node("ball_launcher")
device = BallLauncherDevice(str(rospy.get_param("~port")))
port = str(rospy.get_param("~port"))
device = BallLauncherDevice(port)
rospy.spin()

0 comments on commit 964f11d

Please sign in to comment.