def main(): mfc = alicat.FlowController(port=2,address='B') print 'created mfc' ret = mfc.get() print "type(ret): ",type(ret) print "ret",ret for key in ret: print key,ret[key]
def __init__(self, port="/dev/ttyUSB0", address="A", publish_rate=1, publish_name='/alicat_flow_rate', subscribe_name='/alicat_flow_control', driver_version=1): self.port = port self.address = address self.flow_controller = alicat.FlowController(port, address, driver_version) self.publish_rate = publish_rate self.publish_name = publish_name self.publisher = rospy.Publisher(publish_name, Float32, queue_size=10) self.subscriber = rospy.Subscriber(subscribe_name, Float32, self.flow_control_callback, queue_size=10) self.data = None self.desired_flow_rate = None
def __init__(self, port="/dev/alicat_bb9", addresses=['A', 'B'], publish_rate=1, publish_name_base='/alicat_flow_rate', subscribe_name='/alicat_bb9'): self.port = port self.publish_rate = publish_rate self.addresses = addresses self.flow_controllers = { address: alicat.FlowController(port, address, 2) for address in addresses } self.subscriber = rospy.Subscriber(subscribe_name, bb9, self.flow_control_callback, queue_size=10) self.publishers = { address: rospy.Publisher(publish_name_base + '_' + address, Float32, queue_size=10) for address in addresses }