Skip to content
Open
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
7 changes: 6 additions & 1 deletion bondpy/bondpy/bondpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@

import rclpy
from rclpy.duration import Duration
from rclpy.exceptions import ParameterAlreadyDeclaredException


def duration_to_sec(duration):
Expand Down Expand Up @@ -184,7 +185,11 @@ def _on_connect_timeout(self):

def _on_heartbeat_timeout(self):
# Checks that heartbeat timeouts haven't been disabled globally
self.node.declare_parameter(Constants.DISABLE_HEARTBEAT_TIMEOUT_PARAM, False)
try:
if not self.node.has_parameter(Constants.DISABLE_HEARTBEAT_TIMEOUT_PARAM):
self.node.declare_parameter(Constants.DISABLE_HEARTBEAT_TIMEOUT_PARAM, False)
except ParameterAlreadyDeclaredException:
pass
disable_heartbeat_timeout = self.node.get_parameter(
Constants.DISABLE_HEARTBEAT_TIMEOUT_PARAM).value
if disable_heartbeat_timeout:
Expand Down