The goal of my project is to program the NAO robot to detect and recognize robots using a neural network. I am using a neural network in MatLab to classify the objects and I am writing scripts for capturing an image through the NAO Robot in Python. I have all of the necessary imports (ALProxy from naoqi, Image from PIL, random, time, os, sys, cv2, and vision_definitions) and have configured the ip and the port in the python code for each proxy (postureProxy, motionProxy, speechProxy, anspeechProxy, sprecogProxy, memoryProxy, and photoCaptureProxy).
try:
photoCaptureProxy = ALProxy("ALPhotoCapture", ip, port)
#this was done for each proxy listed above
except Exception, error:
print("Connection error: ", error)
I printed out the error if I had any problems with connection and I did. I got a received notice of an error as follows:
RuntimeERror('\tALBroker::createBroker\n\tCannot connect to tcp://ip:port',))
I know since TCP is involved it, something is going wrong with the wired connection between the computer and the NAO Robot. Are there any fixes for this problem?
Here is a larger segment of code below:
ip = "192.168.208.254"
port = 9559
#ALProxy setups
try:
postureProxy = ALProxy("ALRobotPosture", ip, port)
motionProxy = ALProxy("ALMotion", ip, port)
speechProxy = ALProxy("ALTextToSpeech", ip, port)
anspeechProxy = ALProxy("ALAnimatedSpeech", ip, port)
sprecogProxy = ALProxy("ALSpeechRecognition", ip, port)
memoryProxy = ALProxy("ALMemory", ip, port)
photoCaptureProxy = ALProxy("ALPhotoCapture", ip, port)
except Exception, error:
print("Connection error: ", error)
resolution = vision_definitions.kVGA
colorSpace = vision_definitions.kYUVColorSpace
fps = 30