本文整理汇总了Python中networktables.NetworkTable.setIPAddress方法的典型用法代码示例。如果您正苦于以下问题:Python NetworkTable.setIPAddress方法的具体用法?Python NetworkTable.setIPAddress怎么用?Python NetworkTable.setIPAddress使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类networktables.NetworkTable
的用法示例。
在下文中一共展示了NetworkTable.setIPAddress方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from networktables import NetworkTable [as 别名]
# 或者: from networktables.NetworkTable import setIPAddress [as 别名]
def main():
NetworkTable.setIPAddress('10.19.37.2')
NetworkTable.setClientMode()
NetworkTable.initialize()
sd = NetworkTable.getTable('SmartDashboard')
#ms_list = []
while True:
time.sleep(0.1)
start_time = datetime.now()
# returns the elapsed milliseconds since the start of the program
vision(sd)
dt = datetime.now() - start_time
ms = (dt.days * 24 * 60 * 60 + dt.seconds) * 1000 + dt.microseconds / 1000.0
#ms_list.append(ms)
print ms
#print np.mean(ms_list)
cv2.destroyAllWindows()
示例2: main
# 需要导入模块: from networktables import NetworkTable [as 别名]
# 或者: from networktables.NetworkTable import setIPAddress [as 别名]
def main():
NetworkTable.setIPAddress('10.19.37.2')
NetworkTable.setClientMode()
NetworkTable.initialize()
sd = NetworkTable.getTable('SmartDashboard')
#ms_list = []
while True:
time.sleep(0.1)
start_time = datetime.now()
# returns the elapsed milliseconds since the start of the program
vision(sd)
dt = datetime.now() - start_time
ms = (dt.days * 24 * 60 * 60 + dt.seconds) * 1000 + dt.microseconds / 1000.0
print ms
cv2.destroyAllWindows()
示例3: main
# 需要导入模块: from networktables import NetworkTable [as 别名]
# 或者: from networktables.NetworkTable import setIPAddress [as 别名]
def main():
print('Initializing NetworkTables')
NetworkTable.setClientMode()
NetworkTable.setIPAddress('localhost')
NetworkTable.initialize()
print('Creating video capture')
cap = cv2.VideoCapture(0)
print('Creating pipeline')
pipeline = GripPipeline()
print('Running pipeline')
while cap.isOpened():
have_frame, frame = cap.read()
if have_frame:
pipeline.process(frame)
extra_processing(pipeline)
print('Capture closed')
示例4: __init__
# 需要导入模块: from networktables import NetworkTable [as 别名]
# 或者: from networktables.NetworkTable import setIPAddress [as 别名]
def __init__(self, options):
NetworkTable.setIPAddress(options.ip)
NetworkTable.setClientMode()
NetworkTable.initialize()
logger.debug('Networktables Initialized')
self.current_session = None
self.sd = NetworkTable.getTable('/')
self.sd.addConnectionListener(self)
with open(options.config) as config_file:
self.config = json.load(config_file)
self.run()
示例5: __init__
# 需要导入模块: from networktables import NetworkTable [as 别名]
# 或者: from networktables.NetworkTable import setIPAddress [as 别名]
def __init__( self, capture, log, settings ):
# port="",filters="", hsv=False, original=True, in_file="", out_file="", display=True
self.limits = {}
# Pass the log object
self.log = log
log.init( "initializing saber_track Tracker" )
self.settings = settings
# If the port tag is True, set the
if settings["port"] != "":
logging.basicConfig( level=logging.DEBUG )
NetworkTable.setIPAddress( settings["port"] )
NetworkTable.setClientMode( )
NetworkTable.initialize( )
self.smt_dash = NetworkTable.getTable( "SmartDashboard" )
# initialize the filters. If the filter is the default: "", it will not create trackbars for it.
self.init_filters( settings["filters"] )
# Deal with inputs and outputs
self.settings["out_file"] = str( self.settings["out_file"] ) # set the file that will be written on saved
if settings["in_file"] != "":
self.log.init( "Reading trackfile: " + settings["in_file"] + ".json" )
fs = open( name + ".json", "r" ) # open the file under a .json extention
data = json.loads( fs.read() )
self.limits.update( data )
fs.close( )
# Localize the caputure object
self.capture = capture
# if there are any color limits (Upper and Lower hsv values to track) make the tracking code runs
self.track = len( self.limits ) > 0
self.log.info( "Tracking: " + str(self.track) )
# The self.init_filters( filters ) function will take a string of filters and break it up by spaces
# Each whitespace isolated string will become the name of a limit and trackbar.
# Example, the self.init_filters( "hello world") would split the string into two windows, "hello" and "world"
# The windows will be trackbars and will get their own tracking bounding box, tag, and binary color window
示例6: main
# 需要导入模块: from networktables import NetworkTable [as 别名]
# 或者: from networktables.NetworkTable import setIPAddress [as 别名]
def main():
print('Initializing NetworkTables')
#TODO: change to ip address for your roboRIO
NetworkTable.setIPAddress("10.52.54.98") #IP address of roboRIO
NetworkTable.setClientMode()
NetworkTable.initialize()
print('Creating video capture')
#TODO: pick input method and set address for IP camera
#USB Camera
cap = cv2.VideoCapture(0)
#IP Camera
#cap = cv2.VideoCapture("http://10.52.54.3/mjpg/video.mjpg") #address of video stream
bytes = ''
first = False
print('Creating pipeline')
pipeline = GripPipeline()
print('Running pipeline')
while cap.isOpened():
have_frame, frame = cap.read()
if have_frame:
pipeline.process(frame)
extra_processing(pipeline)
print('Capture closed')
示例7: main
# 需要导入模块: from networktables import NetworkTable [as 别名]
# 或者: from networktables.NetworkTable import setIPAddress [as 别名]
def main():
print('Initializing NetworkTables')
NetworkTable.setIPAddress("10.52.55.98")
NetworkTable.setClientMode()
NetworkTable.initialize()
print('Creating video capture')
cap = cv2.VideoCapture("http://10.52.55.3/mjpg/video.mjpg")
print("here")
bytes = ''
first = False
print('Creating pipeline')
pipeline = GripPipeline()
print('Running pipeline')
while cap.isOpened():
have_frame, frame = cap.read()
if have_frame:
pipeline.process(frame)
extra_processing(pipeline)
print('Capture closed')
示例8: __init__
# 需要导入模块: from networktables import NetworkTable [as 别名]
# 或者: from networktables.NetworkTable import setIPAddress [as 别名]
def __init__(self):
print "Initializing NetworkTables..."
NetworkTable.setClientMode()
NetworkTable.setIPAddress("roborio-4761-frc.local")
NetworkTable.initialize()
self.table = NetworkTable.getTable("vision")
print "NetworkTables initialized!"
示例9: init_networktables
# 需要导入模块: from networktables import NetworkTable [as 别名]
# 或者: from networktables.NetworkTable import setIPAddress [as 别名]
def init_networktables():
#TODO: Check to see if NetworkTables is already initialized
if not using_networktables:
raise Exception("Attempted to initialize NetworkTables while NetworkTables is disabled!")
NetworkTable.setIPAddress(args.networktables_ip)
NetworkTable.setClientMode()
NetworkTable.initialize()
global table
table = NetworkTable.getTable("vision")
log.info("Initialized NetworkTables")
# Loads dict into networktables
示例10: init_network_tables
# 需要导入模块: from networktables import NetworkTable [as 别名]
# 或者: from networktables.NetworkTable import setIPAddress [as 别名]
def init_network_tables(ip='127.0.0.1'):
"""Initialize NetworkTables as a client to receive and send values
:param ip: ip address or hostname of the server
"""
NetworkTable.setIPAddress(ip)
NetworkTable.setClientMode()
NetworkTable.initialize()
LOG.info('Network Tables connected as client to {}'.format(ip))
# TODO receiver and publisher can probably be combined into one cozy rx.Subject