コード例 #1
0
    def __init__(self):
        self.func_queue = queue.Queue()

        host = rospy.get_param("~host")
        port = rospy.get_param("~port")
        com = ogameasure.ethernet(host, port)
        self.att = ogameasure.SENA.adios(com)

        rospy.Subscriber("/dev/adios/__IP__/att1_cmd",
                         Int32,
                         self.regist_set_att,
                         callback_args=1)
        rospy.Subscriber("/dev/adios/__IP__/att2_cmd",
                         Int32,
                         self.regist_set_att,
                         callback_args=2)
        self.pub1 = rospy.Publisher("/dev/adios/__IP__/att1",
                                    Int32,
                                    queue_size=1)
        self.pub2 = rospy.Publisher("/dev/adios/__IP__/att2",
                                    Int32,
                                    queue_size=1)
        time.sleep(0.5)

        self.th = threading.Thread(target=self.loop)
        self.th.setDaemon(True)
        self.th.start()
        return
コード例 #2
0
ファイル: n9938a.py プロジェクト: ogawa-ros/rospkg-ogameasure
    def __init__(self):
        host = rospy.get_param("~host")
        port = rospy.get_param("~port")
        com = ogameasure.ethernet(host, port)
        self.sa = ogameasure.Keysight.N9938A(com)

        self.pub_data = rospy.Publisher("/dev/n9938a/__IP__/spec",
                                        Float64MultiArray,
                                        queue_size=1)
        self.pub_rbw = rospy.Publisher("/dev/n9938a/__IP__/rbw",
                                       Float64,
                                       queue_size=1)
        self.pub_vbw = rospy.Publisher("/dev/n9938a/__IP__/vbw",
                                       Float64,
                                       queue_size=1)

        rospy.Subscriber("/dev/n9938a/__IP__/freq_start_cmd", Float64,
                         self.start_freq_set)
        rospy.Subscriber("/dev/n9938a/__IP__/freq_stop_cmd", Float64,
                         self.stop_freq_set)
        rospy.Subscriber("/dev/n9938a/__IP__/freq_center_cmd", Float64,
                         self.center_freq_set)
        rospy.Subscriber("/dev/n9938a/__IP__/rbw_set_cmd", Float64,
                         self.resol_bw_set)
        rospy.Subscriber("/dev/n9938a/__IP__/vbw_set_cmd", Float64,
                         self.vid_bw_set)
        rospy.Subscriber("/dev/n9938a/__IP__/rbw_auto_cmd", Int32,
                         self.resol_bw_auto_set)
        rospy.Subscriber("/dev/n9938a/__IP__/rbw_query", Float64,
                         self.resol_bw_query)
        rospy.Subscriber("/dev/n9938a/__IP__/vbw_query", Float64,
                         self.vid_bw_query)

        self.flag = True
コード例 #3
0
    def __init__(self):
        host = rospy.get_param("~host")
        port = rospy.get_param("~port")
        com = ogameasure.ethernet(host, port)
        self.ps = ogameasure.KIKUSUI.PMX18_2A(com)

        self.pub_onoff = rospy.Publisher("/dev/pmx18/__IP__/onoff",
                                         Int32,
                                         queue_size=1)
        self.pub_curr = rospy.Publisher("/dev/pmx18/__IP__/curr",
                                        Float64,
                                        queue_size=1)
        self.pub_volt = rospy.Publisher("/dev/pmx18/__IP__/volt",
                                        Float64,
                                        queue_size=1)

        rospy.Subscriber("/dev/pmx18/__IP__/curr_cmd", Float64,
                         self.current_set)
        rospy.Subscriber("/dev/pmx18/__IP__/volt_cmd", Float64, self.volt_set)
        rospy.Subscriber("/dev/pmx18/__IP__/output_on_cmd", Float64,
                         self.output_on_set)
        rospy.Subscriber("/dev/pmx18/__IP__/output_off_cmd", Float64,
                         self.output_off_set)

        self.flag = True
コード例 #4
0
 def __init__(self):
     host = rospy.get_param("~host")
     port = rospy.get_param("~port")
     com = ogameasure.ethernet(host, port)
     self.sa = ogameasure.Keysight.N9343C(com)
     self.pub = rospy.Publisher("/dev/n9343c/__IP__/spec",
                                Float64MultiArray,
                                queue_size=1)
コード例 #5
0
    def __init__(self):
        host = rospy.get_param("~host")
        port = rospy.get_param("~port")
        com = ogameasure.ethernet(host, port)
        self.sg = ogameasure.Agilent.E8257D(com)

        self.pub_freq = rospy.Publisher("/dev/e8257d/__IP__/freq", Float64, queue_size=1)
        self.pub_power = rospy.Publisher("/dev/e8257d/__IP__/power", Float64, queue_size=1)
        self.pub_onoff = rospy.Publisher("/dev/e8257d/__IP__/onoff", String, queue_size=1)
        rospy.Subscriber("/dev/e8257d/__IP__/freq_cmd", Float64, self.set_freq)
        rospy.Subscriber("/dev/e8257d/__IP__/power_cmd", Float64, self.set_power)
        rospy.Subscriber("/dev/e8257d/__IP__/onoff_cmd", String, self.set_onoff)
コード例 #6
0
    def __init__(self):
        host = rospy.get_param("~host")
        port = rospy.get_param("~port")
        com = ogameasure.ethernet(host, port)
        self.sg = ogameasure.Phasematrix.FSW0010(com)

        rospy.Subscriber("/dev/fsw0010/__IP__/f_cmd", Float64, self.set_freq)
        rospy.Subscriber("/dev/fsw0010/__IP__/power_cmd", Float64,
                         self.set_power)
        rospy.Subscriber("/dev/fsw0010/__IP__/onoff_cmd", String,
                         self.set_onoff)

        self.freq_pub = rospy.Publisher("/dev/fsw0010/__IP__/freq",
                                        Float64,
                                        queue_size=1)
        self.onoff_pub = rospy.Publisher("/dev/fsw0010/__IP__/onoff",
                                         Float64,
                                         queue_size=1)

        self.flag = True

        self.sg.use_external_reference_source()