Example #1
0
	def send_msg(self, msg_idx, remote_address, ack, packet):
		acoustic_msg = AcousticModemPayload()
		acoustic_msg.msg_id = msg_idx
		acoustic_msg.address = remote_address
		acoustic_msg.ack = ack
		acoustic_msg.payload = packet
		# Send the packet to the Evologics driver which will send to modem
		self.acoustic_msg_pub.publish(acoustic_msg)
 def send_info(self, data):
     # send a broadcast im to exchange the information stored
     print("Sending Broadcast IM with nav data...")
     self.flag_busy = True
     self.timer = rospy.Timer(rospy.Duration(0, int(self.time_for_bim * 1e9)), self.timer_callback, oneshot=True)
     # create and send the message
     msg = AcousticModemPayload()
     msg.ack = False
     msg.address = 255
     msg.payload = MSG_HEADER + self.data_packer.pack(data)
     self.pub_msg.publish(msg)
 def send_requestV2(self, node):
     # send an im to a device to get his position
     # self.flag_busy = True
     self.timer = rospy.Timer(rospy.Duration(0, int(self.time_for_im * 1e9)), self.timer_callback, oneshot= True)
     # self.nodes_list.append(node)
     # create and send the message
     msg = AcousticModemPayload()
     msg.ack = True
     msg.address = node
     msg.payload = 'A'
     self.pub_msg.publish(msg)
Example #4
0
 def send_info(self, data):
     # send a broadcast im to exchange the information stored
     print("Sending Broadcast IM with nav data...")
     self.flag_busy = True
     self.timer = rospy.Timer(rospy.Duration(0,
                                             int(self.time_for_bim * 1e9)),
                              self.timer_callback,
                              oneshot=True)
     # create and send the message
     msg = AcousticModemPayload()
     msg.ack = False
     msg.address = 255
     msg.payload = MSG_HEADER + self.data_packer.pack(data)
     self.pub_msg.publish(msg)
Example #5
0
 def send_requestV2(self, node):
     # send an im to a device to get his position
     # self.flag_busy = True
     self.timer = rospy.Timer(rospy.Duration(0,
                                             int(self.time_for_im * 1e9)),
                              self.timer_callback,
                              oneshot=True)
     # self.nodes_list.append(node)
     # create and send the message
     msg = AcousticModemPayload()
     msg.ack = True
     msg.address = node
     msg.payload = 'A'
     self.pub_msg.publish(msg)