Hi,
Really excited to me part of formula pi!
I'm trying to get the simulation running and having a few issues - I have the java part running on a windows machine, that seems to be working ok. I'm then running simulationFull.py on a raspberry pi zero W, that as well appears to run ok, it gives me 'WaitForGo()' and then begins printing FPS values, but when I say go on the simulation (green/red/green) the AI cars all go and mine doesn't...
Does anyone have any suggestions on what I could try or thoughts on what might be going wrong?
Thanks!
Got slightly further... the console output on the Pi now shows it seeing the lights, and then appears to start working through the code in Race.py, but on the simulation it still doesn't move...
When I try running SimulationFull.py on the windows machine (same machine as the java part), it fails with 'AttributeError: 'module' object has no attribute 'CV_LOAD_IMAGE_COLOR'. I read somewhere on the forum that to get round that quickly you could change a line in RaceCodeFunctions.py to use ImageProcessor.FIRST_STRAIGHT instead of ImageProcessor.WAIT_FOR_LIGHTS, when I do that I get the same situation as when running on the Pi, in the console the code appears to be executing but on the simulation the car doesn't move...
Have you set the IP address in SimulationFull.py on the Pi too that of the Windows machine?
Yep, that's set - the Pi see's the lights change (the console output shows that) so it is seeing it correctly, but then nothing happens only the simulation when the car should start moving.
That is very odd. Normally these problems are because the images are not transmitted correctly, however that prevents the light sequence from working.
Can you attach a screenshot of the simulation?
The error running on Windows is because you have a different version of OpenCV installed. Unfortunately they renamed some of the values which is the cause of the problem. To install the version used on the robots see OpenCV under Windows.
Finally got chance to have another go today!
The first time I ran it, the car moved (and just drove straight off the track), each time after that it just stays still again (as in the screenshot)
Now if I exit everything and restart it all, it drives the first time, but then I can't stop/reset/restart - most likely I'm just doing something wrong there.
Any idea why it would just drive straight off the track, the code in use is the BetterLap code at the moment.
Given that the code is now starting I think the simulation is probably working correctly
My guess is that the Python script has an error which causes the script to fail after it has set the initial speed, hence the robot drives straight on instead of following the track.
I know we have had a bug in the past where sample code for Race.py had the line:
which should be:
so I would check for that first.
If that is not the problem then it would help to see the output from the Python script.
To reset the robots to start again:
Add new comment