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

Commit

Permalink
convert rospy Time difference to seconds to compare with a timeout value
Browse files Browse the repository at this point in the history
  • Loading branch information
ashishraste committed Jul 3, 2020
1 parent aadee6a commit 38aad7c
Showing 1 changed file with 1 addition and 1 deletion.
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

0 comments on commit 38aad7c

Please sign in to comment.