Exemplo n.º 1
0
# Python standard library
import ctypes
import platform
import sys

# cisst
if platform.system() == 'Linux':
    sys.setdlopenflags(sys.getdlopenflags() | ctypes.RTLD_GLOBAL)
import time
import os
import cisstMultiTaskPython as mts
import cisstParameterTypesPython as prm

print 'starting sawMedtronicStealthlinkClientComponent.py...'
manager = mts.mtsManagerLocal.GetInstance('localhost', 'TREK')
stealth = mts.mtsComponentWithManagement('stealthProxy')
print 'Created stealthProxy'
manager.AddComponent(stealth)
print 'added stealthProxy Component to local manager'

time.sleep(1.0)

# print 'Before adding Controller Interface'
# stealth.AddInterfaceRequiredAndConnect(('ProcessServer', 'Stealthlink', 'Controller'))
# print 'After adding Controller Interface'
# time.sleep(1.0)
print 'Before adding Pointer Interface'
#import rpdb2; rpdb2.start_embedded_debugger('password')
stealth.AddInterfaceRequiredAndConnect(('ProcessServer', 'Stealthlink', 'Pointer'))
print 'After adding Pointer Interface'
time.sleep(1.0)
Exemplo n.º 2
0
import sys
import time

if platform.system() == 'Linux':
    sys.setdlopenflags(sys.getdlopenflags() | 8)  # RTLD_GLOBAL = 0x08
import cisstMultiTaskPython as mts

name = 'My Tracker'
period = 0.01
configuration = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'configClaronMicronTracker.xml')

manager = mts.mtsManagerLocal.GetInstance()
manager.CreateAllAndWait(5.0)
manager.StartAllAndWait(5.0)

proxy = mts.mtsComponentWithManagement('{}Proxy'.format(name))
manager.AddComponent(proxy)
proxy.CreateAndWait(5.0)
time.sleep(0.5)

services = proxy.GetManagerComponentServices()
result = services.Load('sawClaronMicronTracker')
assert result, 'Failed to load {} using component services'.format('sawClaronMicronTracker')

args = mts.mtsTaskPeriodicConstructorArg(name, period)
result = services.ComponentCreate('mtsMicronTracker', args)
assert result, 'Failed to create {} of type {}'.format(name, 'mtsMicronTracker')

component = manager.GetComponent(name)
# component.Configure(configuration)
Exemplo n.º 3
0
import sys
import time

if platform.system() == "Linux":
    sys.setdlopenflags(sys.getdlopenflags() | 8)  # RTLD_GLOBAL = 0x08
import cisstMultiTaskPython as mts

name = "My Tracker"
period = 0.01
configuration = os.path.join(os.path.dirname(os.path.abspath(__file__)), "configClaronMicronTracker.xml")

manager = mts.mtsManagerLocal.GetInstance()
manager.CreateAllAndWait(5.0)
manager.StartAllAndWait(5.0)

proxy = mts.mtsComponentWithManagement("{}Proxy".format(name))
manager.AddComponent(proxy)
proxy.CreateAndWait(5.0)
time.sleep(0.5)

services = proxy.GetManagerComponentServices()
result = services.Load("sawClaronMicronTracker")
assert result, "Failed to load {} using component services".format("sawClaronMicronTracker")

args = mts.mtsTaskPeriodicConstructorArg(name, period)
result = services.ComponentCreate("mtsMicronTracker", args)
assert result, "Failed to create {} of type {}".format(name, "mtsMicronTracker")

component = manager.GetComponent(name)
# component.Configure(configuration)
Exemplo n.º 4
0
# Python standard library
import ctypes
import platform
import sys

# cisst
if platform.system() == 'Linux':
    sys.setdlopenflags(sys.getdlopenflags() | ctypes.RTLD_GLOBAL)
import time
import os
import cisstMultiTaskPython as mts
import cisstParameterTypesPython as prm

print 'starting sawMedtronicStealthlinkClientComponent.py...'
manager = mts.mtsManagerLocal.GetInstance('localhost', 'TREK')
stealth = mts.mtsComponentWithManagement('stealthProxy')
print 'Created stealthProxy'
manager.AddComponent(stealth)
print 'added stealthProxy Component to local manager'

time.sleep(1.0)

# print 'Before adding Controller Interface'
# stealth.AddInterfaceRequiredAndConnect(('ProcessServer', 'Stealthlink', 'Controller'))
# print 'After adding Controller Interface'
# time.sleep(1.0)
print 'Before adding Pointer Interface'
#import rpdb2; rpdb2.start_embedded_debugger('password')
stealth.AddInterfaceRequiredAndConnect(
    ('ProcessServer', 'Stealthlink', 'Pointer'))
print 'After adding Pointer Interface'
Exemplo n.º 5
0
cisstCommon.cmnLogger.SetMaskFunction(cisstCommon.CMN_LOG_ALLOW_VERBOSE)
cisstCommon.cmnLogger.SetMaskDefaultLog(cisstCommon.CMN_LOG_ALLOW_VERBOSE)
cisstCommon.cmnLogger.AddChannelToStdOut(
    cisstCommon.CMN_LOG_ALLOW_ERRORS_AND_WARNINGS)


def log():
    os.system('tail cisstLog.txt')


import cisstMultiTaskPython as cisstMultiTask
import numpy

LCM = cisstMultiTask.mtsManagerLocal_GetInstance()
print 'Creating UR client'
URclient = cisstMultiTask.mtsComponentWithManagement('URclient')
LCM.AddComponent(URclient)
LCM.CreateAll()
LCM.StartAll()

Manager = URclient.GetManagerComponentServices()
print 'Loading sawUniversalRobotController'
if not Manager.Load('sawUniversalRobotController'):
    print 'Failed to load sawUniversalRobotController (see cisstLog.txt)'

print 'Creating UR server (mtsUniversalRobotScriptRT)'
# Or, could use LCM.CreateComponentDynamically
Manager.ComponentCreate('mtsUniversalRobotScriptRT', 'URserver')
URserver = LCM.GetComponent('URserver')
print 'Configuring UR server.'
ipAddr = raw_input('Enter IP address: ')