def __init__(self, timeout=5.0): self.timeout = rospy.Duration(timeout) self.last_msg = None self.sub = rospy.Subscriber('/keep_alive', Header, self.got_network_msg, queue_size=1) self.alarm_broadcaster, self.alarm = single_alarm('network_loss', severity=3, problem_description="Network loss") rospy.Timer(rospy.Duration(0.1), self.check)
def main(navigator): kill_alarm_broadcaster, kill_alarm = single_alarm('kill', action_required=True, problem_description="Killing wamv to listen to pinger") df = defer.Deferred().addCallback(head_for_pinger) df.callback(navigator) try: yield txros.util.wrap_timeout(df, 55, cancel_df_on_timeout=True) except txros.util.TimeoutError: print "Done heading towards pinger"
def __init__(self, timeout=2.0): self.timeout = rospy.Duration(timeout) self.last_time = rospy.Time.now() self.last_msg = '' self.sub = rospy.Subscriber('/keep_alive', String, self.got_network_msg, queue_size=1) self.alarm_broadcaster, self.alarm = single_alarm('network_loss', severity=3, problem_description="Network loss") rospy.Timer(rospy.Duration(0.1), self.check)
def __init__(self, timeout=0.5): self.timeout = rospy.Duration(timeout) self.last_time = rospy.Time.now() self.last_position = None self.check_count = 0 self.max_jump = 1.0 self.odom_discontinuity = False self.killed = False self.odom_listener = rospy.Subscriber('/odom', Odometry, self.got_odom_msg, queue_size=1) self.alarm_broadcaster, self.alarm = single_alarm('odom_loss', severity=3, problem_description="Killing wamv due to unreliable state estimation") rospy.Timer(rospy.Duration(0.1), self.check)