bethesirius / chosuntruck Goto Github PK
View Code? Open in Web Editor NEWEuro Truck Simulator 2 autonomous driving solution
Euro Truck Simulator 2 autonomous driving solution
Hello,
The compile is OK, but blocked when execute the file.
debian:~/ChosunTruck-master/linux$ ls
build ChosunTruck Makefile src tensorbox
debian:~/ChosunTruck-master/linux$ ./ChosunTruck
error: open: No such file or directory
I have found that using adaptiveThreshold works better for lane detection than the standard threshold being used here:
ChosunTruck/windows/src/main.cpp
Line 117 in 8896443
I used the following code to replace that line:
cv::adaptiveThreshold(sobel, contours, 255, ADAPTIVE_THRESH_GAUSSIAN_C, CV_THRESH_BINARY, 21, -3);
A comparison between my implementation of adaptivethreshold and the standard threshold can be viewed here:
https://www.youtube.com/watch?v=GT3MJb495Ak&feature=youtu.be
Finally got mouse input to (kind of) work. Still needs revisions, but it is something we can work with for now.
See my changes: ajchili@dc021d4
Linux input for reference: https://github.com/bethesirius/ChosunTruck/blob/master/linux/src/main2.cc#L237
SendInput was incredibly difficult to implement so I'm avoiding that for now. SetCursorPos should do what we need it to do.
We used WM_KEYINPUT function and keybd_event funtion to drive the truck automatically, but thevirtual key input with those functions is blocked. Specifically, virtual key input is working on other programs, such as notepad or ms word, but we could not handle the truck with virtual key input.
I was strictly following the instrctions provided in wiki. But an error appeared when I tried to build.
And the options are set to update packages automatically.
please note that I have used the .vcxproj file that founders offered us. And I have set all the required configuration correctly.
What's the reason of this error? How can I fix it?
Hi, thank you for the amazing work!
I have compiled and run the program in Windows, and it can show the output result on the terminal window, Road image output and Lines image output, as you can see on the image I show below:
I think it can produce the output of the steering value (+/- pixel's unit), but it seems the steering output does not control the truck's steer, I stil have use my mouse to control the truck.
I have altered the "control.ssi" file, resized the window size, and set the control setting into keyboard+mouse.
If you know what else do I miss, I will be very happy to hear it.
Thanks!
Hi i am using Windows 10 64bit but when i run the .pyc file it comes up with this error all the time but i had to record it and slow it down to 0.05x speed so i could see it but that only just managed to show it so i screenshotted it. It is below. Thanks!
With the new code suggested in #10, input works and the program can now move the truck. However, it is sending keys too fast, making it hard to accelerate or use other keys while the program is running. I tried adding Sleep() in different locations inside the code, however that only made the program freeze (crash / slow down significantly).
I also tried removing any commands that would be sent when the truck is going straight. This helped some, but didn't fix the problem.
If you want to help me test this, remember to go to C:\Users\YOURUSERNAME\Documents\Euro Truck Simulator 2\profiles and edit controls.sii from di8.keyboard/fusion.mouse to sys.keyboard/sys.mouse
I have been manually adjusting the findLines parameters and have come up with the following:
One of the most frequent issues I encounter with ChosunTruck's current implementation is the extraneous lines created by the guardrails along the road. Here are my observations and thoughts about this:
minLength
and maxGap
parameters had a small effect on line detection. However, I do believe our current values of 20 for minLength
and 120 for maxGap
may be sub-optimal. Through my own personal expirementation, I found the optimal range for minLength
to be from 5-35 and the optimal range for maxGap
to be from 70-75.setMinVote
had a significant impact on line detection. It is important to note that changing setMinVote
won't be effective by itself. This parameter is entirely dependent on the quality of the pre-proccessed image. I found the optimal value to be between 60 and 65.cv::blur(gray, blur, cv::Size(10, 10));
with cv2.GaussianBlur(gray, blur, (17,17),0)
and I believe it might be more effective at reducing noise. I am still experimenting with this.I will be creating a related issue regarding the use of the detected lines' angles to devise a way to filter the near-horizontal lines created by the guardrails. I'm also looking at calculating the average slope of the lines to implement cv::fitLine to extrapolate the lines detected. Implementing these features to our project may make the following suggestions above unnecessary.
Hi I did a Local Windows debugger on the program in VS 2017 it start but I get the error that the zlibd1.dll is missing and that I need to reinstall the program. I installed de zlibd1.dll in system32 and SysWOW64 but iI still get the error help me :)
This is for windows not linux
When running the release x64 exe, I ran into this error:
OpenCV Error: Assertion failed (ssize.area() > 0) in cv::remapBilinear, file C:\Users\bishnois.VITECNET\Downloads\opencv-master\modules\imgproc\src\imgwarp.cpp, line 3832
So I removed line 3832 (because it will run without it) in my imgwarp.cpp, however the error still appears. I don't know where it's referencing your imgwarp and I don't know how to change it so that it uses my imgwarp.cpp instead of yours.
Can u make a video of how to install on windows. Thank you
I changed IPM area code at windows/src/main.cpp
This area setting works well in Linux without an assertion error, but in Windows, assertion error occurs.
OpenCV Error: Assertion failed (ssize.area() > 0) in cv::remapBilinear, file ...\opencv\sources\modules\imgproc\src\imgwarp.cpp, line 3868
The error looks like this. It only occurs at the first execution after the build, and it does not occur after the second execution. The error can be ignored. Although the error occurs with the program stopped window, program runs well after a few seconds. Any ideas to deal with it?
Hi, basically this error is a continuation of error issue #17 posted by @gotope.
Previously, I have successfully ran the ChosunTruck on Windows.
Now on Ubuntu 16.04, I had the same problem as @gotope's issue #17 , and ended up here:
~/ChosunTruck/linux$ sudo ./ChosunTruck
OpenCV Error: Assertion failed (0 <= roi.x && 0 <= roi.width && roi.x + roi.width <= m.cols && 0 <= roi.y && 0 <= roi.height && roi.y + roi.height <= m.rows) in Mat, file /home/aqmar/OpenCV/modules/core/src/matrix.cpp, line 508
terminate called after throwing an instance of 'cv::Exception'
what(): /home/aqmar/OpenCV/modules/core/src/matrix.cpp:508: error: (-215) 0 <= roi.x && 0 <= roi.width && roi.x + roi.width <= m.cols && 0 <= roi.y && 0 <= roi.height && roi.y + roi.height <= m.rows in function Mat
My suspicion right now is in the ETS2 windowed mode size is not appropriate. (I have put the window in the right bottom though).
This is the screenshot:
But I am not sure how to fix this yet. I it possible that my monitor resolution has a role on the error?
This error occurs at startup while in Debug mode:
OpenCV Error: Assertion failed (src.checkVector(2, CV_32F) == 4 && dst.checkVect or(2, CV_32F) == 4) in cv::getPerspectiveTransform, file ...\opencv_sources\modules\imgproc\src\imgwarp.cpp, line 6353
This makes the program not run in Debug mode. This is a big problem for me, as Debug mode would allow for better debugging.
The program runs fine in Release mode.
Our lane detection code does not work properly at the very curvy lanes like highway entrance or exit.
I'm reading some papers which can improve our lane detection algorithm.
https://arxiv.org/pdf/1501.03124.pdf
http://research.ijcaonline.org/volume122/number13/pxc3905011.pdf
nils@gwendolene:~/ChosunTruck/linux$ make Drive pip install runcython Requirement already satisfied: runcython in /home/nils/.local/lib/python2.7/site-packages (0.2.5) Requirement already satisfied: Cython>=0.10 in /home/nils/.local/lib/python2.7/site-packages (from runcython) (0.29.2) makecython++ tensorbox/utils/stitch_wrapper.pyx "" "tensorbox/utils/stitch_rects.cpp tensorbox/utils/hungarian/hungarian.cpp" /home/nils/.local/lib/python2.7/site-packages/Cython/Compiler/Main.py:367: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /home/nils/ChosunTruck/linux/tensorbox/utils/stitch_wrapper.pyx tree = Parsing.p_module(s, pxd, full_module_name) nils@gwendolene:~/ChosunTruck/linux$ ^C nils@gwendolene:~/ChosunTruck/linux$ cd / nils@gwendolene:/$ ^C nils@gwendolene:/$ cd /home/nils/ChosunTruck/linux nils@gwendolene:~/ChosunTruck/linux$ make mkdir -p build g++ -c src/getScreen_linux.cc
pkg-config opencv --cflags --libs-std=c++11 -lX11 -Wall -fopenmp -O3 -march=native -o build/getScreen_linux.o Package opencv was not found in the pkg-config search path. Perhaps you should add the directory containing
opencv.pc'
to the PKG_CONFIG_PATH environment variable
No package 'opencv' found
mkdir -p build
g++ -c src/main2.cc pkg-config opencv --cflags --libs
-std=c++11 -lX11 -Wall -fopenmp -O3 -march=native -o build/main2.o
Package opencv was not found in the pkg-config search path.
Perhaps you should add the directory containing opencv.pc' to the PKG_CONFIG_PATH environment variable No package 'opencv' found src/main2.cc:8:10: fatal error: opencv2/core/core.hpp: Datei oder Verzeichnis nicht gefunden #include <opencv2/core/core.hpp> ^~~~~~~~~~~~~~~~~~~~~~~ compilation terminated. make: *** [Makefile:18: build/main2.o] Fehler 1
it looks like it tries to find a file that doesn't exist in src so can anybody help me please?
LG Revilum
Hy, is this still working ? if yes can i have an example how to build it and run ? i'm not very good with c++ ! Please ? Sorry if sound weird, but i really need it !
Hi, is this still working? if so can i have an example of how to build it and run it? For purposes of learning I want to be able to improve or try
I am getting stumped by this error. Log provided below.
~/ChosunTruck/linux$ make mkdir -p build g++ -c src/main2.cc
pkg-config opencv --cflags --libs -std=c++11 -lX11 -Wall -fopenmp -O3 -march=native -o build/main2.o src/main2.cc: In function ‘int main(int, char**)’: src/main2.cc:128:32: error: ‘CV_RGBA2RGB’ was not declared in this scope cv::cvtColor(image, sendImg, CV_RGBA2RGB); ^~~~~~~~~~~ src/main2.cc:128:32: note: suggested alternative: ‘CV_RGB’ cv::cvtColor(image, sendImg, CV_RGBA2RGB); ^~~~~~~~~~~ CV_RGB src/main2.cc:182:44: error: ‘CV_THRESH_BINARY’ was not declared in this scope cv::threshold(sobel, contours, 145, 255, CV_THRESH_BINARY); ^~~~~~~~~~~~~~~~ src/main2.cc:240:8: warning: unused variable ‘degree’ [-Wunused-variable] int degree = atan2 (last_centerline - first_centerline, count_centerline) * 180 / PI; ^~~~~~ src/main2.cc:42:7: warning: unused variable ‘python_on’ [-Wunused-variable] bool python_on = false; ^~~~~~~~~ src/main2.cc:76:10: warning: ignoring return value of ‘int system(const char*)’, declared with attribute warn_unused_result [-Wunused-result] system("python tensorbox/Car_detection.py"); ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Am I doing something wrong here? I followed the steps and correctly installed opencv and tensorflow.
If the log isn't readable, here's a ghostbin link: https://ghostbin.com/paste/9p8h4/raw
Hi this is to continue what was happening in the bad magic number in .pyc issue.
I cannot build the solution because i get FATAL ERROR all the time saying different LNKXXXX issues but now it is coming up with different ones that i had before.
See the results.txt
I used a program called "Dr. Memory" to find the errors. Lines 140 and 145 are causing the buffer overflow for me. (Note: Results.txt were produced before some changes to code, so line numbers don't match up. However 140 and 145 are definitely the ones causing issues from what I am seeing)
Hey! I am a noob needing help with this project. First, this project is awesome and is teaching me all sorts of stuff w/ OpenCV. You are awesome!!
I am wondering if CUDA 8.0 will work with this project, as that is what supports Ubuntu 16.04. Otherwise I can try to work-around for 7.5
Also, the ubuntu command references files aren't included in the source directory. "g++ -o auto_drive main2.cpp IPM.cpp lineinder.cpp uinput.c" <- those .cpp files aren't included.
When running "sudo ./auto_drive", a buffer overflow is detected:
==19523== Command: ./auto_drive
==19523==
*** buffer overflow detected ***: ./auto_drive terminated
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x89fa7e5]==19523== Command: ./auto_drive
==19523==
*** buffer overflow detected ***: ./auto_drive terminated
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x89fa7e5]
/lib/x86_64-linux-gnu/libc.so.6(__fortify_fail+0x5c)[0x8a9b56c]
/lib/x86_64-linux-gnu/libc.so.6(+0x116570)[0x8a99570]
/lib/x86_64-linux-gnu/libc.so.6(__strcat_chk+0x5d)[0x8a9887d]
./auto_drive[0x40797a]
./auto_drive[0x402863]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x89a3830]
./auto_drive[0x404189]
Valgrind Info:
Process terminating with default action of signal 6 (SIGABRT)
==19523== at 0x89B8428: raise (raise.c:54)
==19523== by 0x89BA029: abort (abort.c:89)
==19523== by 0x89FA7E9: __libc_message (libc_fatal.c:175)
==19523== by 0x8A9B56B: __fortify_fail (fortify_fail.c:37)
==19523== by 0x8A9956F: __chk_fail (chk_fail.c:28)
==19523== by 0x8A9887C: __strcat_chk (strcat_chk.c:34)
==19523== by 0x407979: setPath(char*) (in /home/brian/Desktop/ChosunTruck/auto_drive)
==19523== by 0x402862: main (in /home/brian/Desktop/ChosunTruck/auto_drive)
Currently our wiki links to the vc12 (VS2013) nuget package for opencv
https://github.com/bethesirius/ChosunTruck/wiki/Windows-Installation
Use Nuget Package Manager to grab these two packages:
https://www.nuget.org/packages/opencvcuda-release/
https://www.nuget.org/packages/opencvcuda-debug/
However, neither of these packages will work for VS2015 or VS2017. To be compatible with VS2017, we will need to use https://www.nuget.org/packages/opencv.win.native/320.1.1-vs141. The developer of that package claims this will work for VS2015, although I have not tested that specifically. I have used this package to successfully run Chosuntruck on VS2017.
So I'd recommend we drop support for VS2013 and use https://www.nuget.org/packages/opencv.win.native/320.1.1-vs141 from now on.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.