Closed Caleb-J773 closed 7 years ago
Also the console is showing my joystick presses so it should be recording something.
To record data you have to run start_recording.bat or the python-script collect_data.py. This script saves the images to captured.
After you have collected many data you execute start_training.bat. This script creates your autopilot model. And then you can run start_autopilot.bat to let the computer steer for you.
And have you activated the recording by pressing the autopilot button you set in the settings.py?
I did, and it trained but now when i got to turn it on, the camera just shoots up out of the truck into the sky like looks at the sky, it doesn't turn or gas the truck at all. Even after turning it off it continues to have the camera forced up in the sky.
All right. It seems like your controller configuration isn't correct. Please open the settings in ETS2 and go to the controller settings. There you have to choose Keyboard + vJoy Device. Then set the steering axis by moving your joystick or steering wheel. You need to have start_autopilot.bat running. After that just add your normal controller from the list on top and set your keys etc. like before.
Now it's not doing anything no input nothing.
Here's a controller layout ^^
Nice. Thank you for the image :D For the first row you have to choose "Keyboard + vJoy Device". The second should be "Controller (XBOX 360 For Windows)" and the last "XInput Gamepad 1".
So far so good. That is the order. To let the computer steer for you you have to set the right steering axis. For that set row 2 and 3 to "undefined", click on the Steering axis field and move your joystick or steering wheel. The value of the field should change. After that, set row 2 and 3 to what I've written before.
Still doing the same thing even after doing what you said. I have the correct right steering axis and it keeps doing the look axis.
Then scroll a bit down on the settings page. There is an other axis. View axis or something like that. You have to unassign that axis.
idk why this isn't working at all I either get no input, or if i do it's just pointing the camera up. I unassigned that axis and well i get the no input
My controller layout Keyboard + vJoy Device Controller (XBOX 360 For Windows) XInput Gamepad 1
Is it possible vjoy isn't working or did the ai bot get confused on the controls?
Okay. For the record:
^^ It's working but it's doing that right now.. I guess it needs more training data?
Jep. That's right. If you want you can try out my trained model. https://www.ets2autopilot.com/model.zip Just download and extract the content into the save folder.
Maybe you have to set the controller subtype to gamepad because I used one.
But I really recommend to collect your own data with the steering wheel. ;)
Now, it's doing this again. It's like it's locked on steering
Something's off with vjoy or something
That's strange. If you could open the windows menu and open the program "vJoy analyzer" or something like that? This program shows the states of the axes and buttons of the vJoy Device. When it's running please activate the autopilot and look if the bar of the y-axis is moving. If the bar goes up, the autopilot is steering to the right. Down means left. Is this bar equivalent to the steering wheel image?
None of them are moving. Something with vjoy or the script?
The autopilot isn't activated. It shows False. You have to push the autopilot button (the same button for recording).
Turned it on, shows up on bar, tries the game, no input it's not steering.
The game isn't receiving any input from vjoy however other controllers, keyboard works fine. I have the same setup keyboard + vjoy thing going on here.
Okay. Then assign the steering axis in the game settings again please. Set the other devices top undefined and then move the steering wheel while start_autopilot.bat is running and the autopilot is deactivated (you see False in the console).
Yea again still no input from vjoy in the game autopilot on.
But the steering axis is set to "Joy Y Axis"? And when you assign this axis, can you see the yellow bar in the field indicating the joystick position? When you are in-game can you steer manually? The vjoy device seems to work normally.
Yes, I can steer with the second controller on the JOY y Axis, Vjoy isn't sending any input to the game at all
I don't think this is working at all. My controllers everything works fine, Joy Y axis etc.
You know what, I think it was saying something like JOY 2 as in 2nd controller, How do i change it for the 1st controller aka keyboard + vjoy?
You have to set the other controllers to undefined or none. The list should look like: keyboard + vjoy undefined undefined
Then you have to assign the steering axis. Click into the field and move your steering wheel while start_autopilot.bat is running and showing False. The autopilot has to be disabled (IMPORTANT!). After that the steering axis should be assigned to the vjoy controller.
At the end you set your 2nd and 3rd controller.
I don't have a steering wheel, I just have a gamepad. aka xbox controller, besides you can't set anything cause vjoy isn't attached to my xbox controller or so.
Okay. I thought you had one but the gamepad does work too. Have you set JOYSTICK in settings.py? You can find out the id with the gamepad_analyzer.py.
Correct
And when start_autopilot.bat is running, can you see changing values when you move the steering joystick?
Yes.
Then the settings for the autopilot are correct and the problem are the ETS2 settings. Can you send me a screenshot with the controller list and the steering axis config please?
This should work right? Should i test?
Thank you. Yeah. This should work.
Huh it looks like it was working, then the game crashes. What gives?
Wow! It's getting stranger xD Just restart the game and try again.
Ah nevermind it was because i alt tabbed but it's working it's finnaly steering, Had to correct it's steering a bit but im sure it learns from it's mistakes? Or just some more training will do 👍
Love to show off some more demo videos.
Thank you for the all the help 👍 I'll come to you if I need anymore help
Also, When does the windows version detect cars? Cause it's only on linux, would love to have it on windows
No problem. Good to hear that it's finally working. Currently the self steering part and the recording part are separated. That means any corrections you do have no influence on the autopilot training. I think I will add this soon after the GUI is working (which could be soon).
This version is only for keeping lanes. So cars wont get detected. But I also want to include that feature in future.
Have fun! And collect as much data as you can. The model I sent you was trained with 50,000 pictures (or even more? I don't know ^^)
Can i add on or does it start a new save file with my pictures?
Also it's doing a dang better job on this turn then me LOL
It's starting a new save file. I have to do some testing to find out if it is posible to add more data to an existing model.
Haha. Nice :D
The data files aka the captured folders have 0 bytes of any info and attempting to train them results in this error Traceback (most recent call last): File "train.py", line 31, in
import driving_data
File "C:\Users\User1\Downloads\ETS2Autopilot-master\ETS2Autopilot-master\driving_data.py", line 99, in
xs, ys = zip(*c)
ValueError: not enough values to unpack (expected 2, got 0)