Skip to content
This repository has been archived by the owner on Feb 6, 2023. It is now read-only.

Convert rospy Time difference to seconds to compare with a timeout value #409

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def __init__(self):
if self.config['timeout'] > 0:
# If a timeout is set, zero the outputs to the thrusters if
# there is no command signal for the length of timeout
if rospy.Time.now() - self.last_update > self.config['timeout']:
if (rospy.Time.now() - self.last_update).to_sec() > self.config['timeout']:
print('Turning thrusters off - inactive for too long')
if self.thrust is not None:
self.thrust.fill(0)
Expand Down