def parse_failed(self, tokens): rospy.logwarn("%s: Message delivering failed to node %s" % (self.name, tokens[1])) if self.flag_ack_BUSY: if self.last_transmission_type == "imack": self.pub_im_ack.publish(AcousticModemAck(ack=False)) elif self.last_transmission_type == "burstack": self.pub_burst_ack.publish(AcousticModemAck(ack=False)) self.flag_ack_BUSY = False
def parse_failed(self, tokens): rospy.logwarn("%s: Message delivering failed to node %s" %(self.name,tokens[1])) if self.modem.last_ack_type == "imack": msg = AcousticModemAck() msg.header.stamp = rospy.Time.now() msg.ack = False self.pub_im_ack.publish(msg) elif self.modem.last_ack_type == "burstack": msg = AcousticModemAck() msg.header.stamp = rospy.Time.now() msg.ack = False self.pub_burst_ack.publish(msg) self.modem.last_ack_type = ""
def parse_delivered(self, tokens): rospy.loginfo("%s: Message delivered to node %s" %(self.name,tokens[1])) # print self.modem.last_ack_type if self.modem.last_ack_type == "imack": self.propagation_time_flag = True # to check propagation time later self.im_ack_cnt += 1 msg = AcousticModemAck() msg.header.stamp = rospy.Time.now() msg.ack = True self.pub_im_ack.publish(msg) elif self.modem.last_ack_type == "burstack": self.burst_ack_cnt += 1 msg = AcousticModemAck() msg.header.stamp = rospy.Time.now() msg.ack = True self.pub_burst_ack.publish(msg) self.modem.last_ack_type = ""