예제 #1
0
try:
  motionProxy = ALProxy("ALMotion", IP, PORT)
except Exception, e:
  print "Error when creating motion proxy:"
  print str(e)
  exit(1)

# Create a proxy to Vision module
try:
  visionProxy = ALProxy("vision", IP, PORT)
except Exception, e:
  print "Error when creating vision proxy:"
  print str(e)
  exit(1)

visionProxy.registerToVIM()

# ALMemory variable where the ALVisionLogo modules
# outputs its results
memValue = "/BURST/Vision/BallX"

# Create a proxy to ALMemory
try:
  memoryProxy = ALProxy("ALMemory", IP, PORT)
except Exception, e:
  print "Error when creating memory proxy:"
  print str(e)
  exit(1)

visionProxy.setCamera(1) # 0 - top camera, 1 - bottom camera
예제 #2
0
####
# Creat proxy on GVMsample module

print "Creating GVMsample proxy"

try:
    sampleProxy = ALProxy("vision", IP, PORT)
except Exception, e:
    print "Error when creating vision proxy:"
    print str(e)
    exit(1)

time.sleep(1)

print "Registering to VIM"
sampleProxy.registerToVIM()

print "done"
####
# Save image in remote mode
print "1"
sampleProxy.saveImageRemote("/var/tmp/img")  # /var/volatile/log/myBeautifullPictureRemote
print "2"
time.sleep(1)
a = sampleProxy.getBallAreaRemote()

print "3"
# sampleProxy.saveImage("/var/tmp/myBeautifullPictureLocal") #/var/volatile/log/myBeautifullPictureLocal

time.sleep(2)
print "4"