def __init__(self, ident, w_pub_topic, w_sub_topic): self.STATE_NO_INIT = 0 self.STATE_WAIT_RESP_SUB_RATE = 1 self.STATE_WAIT_RESP_SUB_ADDR = 2 self.STATE_WAIT_EN_PUB_SERVICE = 3 self.STATE_WAIT_RUN = 4 self.STATE_OK = 10 self.state = self.STATE_NO_INIT self.ident = ident self.now = 0.0 self.vel_set = 0.0 self.encoder_ticks = 0 self.encoder_latest_update = 0.0 self.encoder_update_tout = 0.3 # [s] self.vel = 0.0 self.ser_send = serial() self.ser_use_checksum = False self.ser_send_tout = 0.0 self.ser_send_tout_duration = 1.0 # [s] # set up serial publisher self.w_pub = rospy.Publisher(w_pub_topic, serial) # set up serial subscriber rospy.Subscriber(w_sub_topic, serial, self.parse_serial_string)
def __init__(self): rospy.init_node('topcon_initializer') self.rate = rospy.Rate(1) self.serial_pub = rospy.Publisher("/fmData/tx", serial) self.serial_sub = rospy.Subscriber("/fmData/rx", serial, self.onSerial ) self.serial_msg = serial() self.serial_msg.data = "Testmessage \r"
def __init__(self): rospy.init_node('topcon_initializer') self.rate = rospy.Rate(1) self.serial_pub = rospy.Publisher("/fmData/tx", serial) self.serial_sub = rospy.Subscriber("/fmData/rx", serial, self.onSerial) self.serial_msg = serial() self.serial_msg.data = "Testmessage \r"
def __init__(self): rospy.init_node('topcon_initializer') self.topic = rospy.get_param("~serial_topic",'/fmData/tx') self.message1 = rospy.get_param("~message_string1","") self.message2 = rospy.get_param("~message_string2","") self.message3 = rospy.get_param("~message_string3","") self.rate = rospy.Rate(1) self.serial_pub = rospy.Publisher(self.topic, serial) self.serial_msg = serial()
def __init__(self): """Constructor. Instantiates the Qt GUI and inits the ROS node""" # Init GUI and register callback self.app = QtGui.QApplication(sys.argv) self.Form = QtGui.QWidget() self.ui = pid_trimmer.Ui_Form() self.ui.setupUi(self.Form) self.ui.register_cb(self.onUpdate) # Init node an set up publisher rospy.init_node('PID_trimmer', anonymous=True) self.serial_pub = rospy.Publisher("/fmData/command", serial) self.serial_msg = serial() self.rate = rospy.Rate(10)
def __init__(self): rospy.init_node('topcon_initializer') self.rate = rospy.Rate(1) self.serial_pub = rospy.Publisher("/fmData/rx", serial) self.serial_sub = rospy.Subscriber("/fmData/tx", serial, self.onSerial) self.nmea_pub = rospy.Publisher("/fmData/nmea_out", nmea) self.nmea_sub = rospy.Subscriber("/fmData/nmea_in", nmea, self.onNMEA) self.serial_msg = serial() self.nmea_msg = nmea() self.nmea_msg.type = "GPGGA" self.nmea_msg.length = 5 self.nmea_msg.data = ["100", "12.15", "", "0", "01.10"]
def __init__(self): rospy.init_node('topcon_initializer') self.rate = rospy.Rate(1) self.serial_pub = rospy.Publisher("/fmData/rx", serial) self.serial_sub = rospy.Subscriber("/fmData/tx", serial, self.onSerial ) self.nmea_pub = rospy.Publisher("/fmData/nmea_out", nmea) self.nmea_sub = rospy.Subscriber("/fmData/nmea_in", nmea, self.onNMEA ) self.serial_msg = serial() self.nmea_msg = nmea() self.nmea_msg.type = "GPGGA" self.nmea_msg.length = 5 self.nmea_msg.data = ["100","12.15","","0","01.10"]