Hello, I am having trouble running the simulation on my network, everything seems to load, says wait for go etc but nothing happens when i change the lights.
what i do notice is that I have this error;
Exception in thread Thread-8: Traceback (most recent call last): File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner self.run() File "./SimulationFront.py", line 255, in run frame = cv2.imdecode(frame, cv2.CV_LOAD_IMAGE_COLOR) AttributeError: 'module' object has no attribute 'CV_LOAD_IMAGE_COLOR' 11:09:57.252507 WaitForGo()
So I was wondering if this is related? Is it a difference in open cv versions or have i missed a module. The Pi is a fresh version of raspbian stretch and full compiled opencv 3.3. I notice you have a recommended method of installation, are there module/version differences?
On a second note the Pi running the script seems to want to connect to 192.168.1.131, this ip is not on my network. Could it be that it does not find the server instead? I have changed the ip in the simulation.py script to match my java simulation server.
I think the fastest method is to format sdcard and follow this : https://www.formulapi.com/race-code/sd-card-monster-summer-2017
Agreed, I will go down this route then we are all on the same page thanks.
Unfortunately they changed the names of a number of variables in OpenCV between the older (2.X) and newer (3.X) versions. These changes also affect some of the function calls slightly. It would be possible to update the code to run with the newer OpenCV, but we would need a custom setup SD card to run your code for the racing :)
The version of OpenCV installed on our SD cards appears to be
2.4.9.1
(print cv2.__version__
). Any 2.X version should work fine though.The IP address for
simulationIP
should be set to the Java simulation server. The192.168.1.131
value is an old default, the latest code has127.0.0.1
as standard (same machine).I will re-install everything as per the instructions given above, that should iron out any differences in open cv version. Yes it's a pain when the devs make minor changes to libraries and things like this..
As for the IP address, I had set the 127x to my server IP so don't understand why it was looking for 192.168.1.131. I downloaded the code a few days ago, I will have to find out the link location I was given, but is it possible that I have an old version of the code then?
Thanks.
And you got to specify the java server IP in SimulationFull.py
Yes I had already set the IP in that file, thanks, just didn't understand the call to the 192.68.1.131.
By any chance are you entered into the RaceYourCode competition?
If so this would explain the connection to that machine. In the RaceYourCode setup this is the machine on our network which generates the live statistics view for the stream. Put simply the code is trying to send data to display to that IP address.
The IP address used for this is in the
ipDisplay
value insideSettings.py
. On race day this needs to be192.168.1.131
so you can see the values, but for local testing you can either set this to a different address to view the values usingDisplayReadings.py
, or simply ignore it. See theGuides\The scripts.txt
file for more details.By any chance are you entered into the RaceYourCode competition?
Yes that's correct.
Ah that is good to know thanks. So I assume that if I do change any of the code that I must preserve these variables so everyone can see what the borg thinks is happening and trying to do..? Although in the time I have I doubt I'll be making any substantial changes like that!
You can change them if you like, but we recommend that you keep them. Basically the display on the stream is mostly so that you can tell what is going on when the robots are racing.
All of the values are held in
Globals.dataToSend
, found inGlobals.py
. They are updated by theUpdateDataToSend
function inDataTransmission.py
.There are also three empty values which the code does not use, but will be displayed. They are
user-1
,user-2
, anduser-3
inGlobals.dataToSend
. They can contain numbers or text, whatever may be useful to know :)You'll be glad to know it's all running now using the recommended setup, thanks.
Good news, you can focus on the code now !
I am happy to hear that you have it all working now :)
The messages with registration information and links should have come from
info@formulapi.com
, so make sure it is on your spam filter allow list. The email with the code links has the subject "Formula Pi: Standard Race Code access - added"Add new comment