Skip to content

Commit

Permalink
Finished subscriber
Browse files Browse the repository at this point in the history
  • Loading branch information
mehulgoel873 committed Oct 24, 2024
1 parent 98e5912 commit ead0cbe
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions rb_ws/src/buggy/buggy/watchdog/watchdog_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,19 @@ def __init__(self):
"""
super().__init__('watchdog')

# Publishers
self.heartbeat_publisher = self.create_publisher(Bool, 'self/debug/heartbeat', 1)
timer_period = 0.01 # seconds (10 Hz)

# Subscribers
self.heartbeat_subscriber = self.create_subscription(Bool, 'self/debug/heartbeat', self.heartbeat_listener, 1)

timer_period = 0.01 # seconds (100 Hz)
self.timer = self.create_timer(timer_period, self.loop)
self.i = 0 # Loop Counter

def loop(self):
# Loop for the code that operates at 0.1 Hz
# Loop for the code that operates every 10ms
msg = Bool()
msg.data = True
self.heartbeat_publisher.publish(msg)
Expand Down

0 comments on commit ead0cbe

Please sign in to comment.