Euro Truck Simulator 2 autonomous driving solution
Python C++ Other
Latest commit 0351ab8 Feb 22, 2017 @chi3236 chi3236 Apply adaptive IPM area




ChosunTruck is an autonomous driving solution for Euro Truck Simulator 2. Recently, autonomous driving technology has become a big issue and as a result we have been studying technology that incorporates this. It is being developed in a simulated environment called Euro Truck Simulator 2 to allow us to study it using vehicles. We chose Euro Truck Simulator 2 because this simulator provides a good test environment that is similar to the real road.


  • You can drive a vehicle without handling it yourself.
  • You can understand the principles of autonomous driving.
  • (Experimental) You can detect where other vehicles are.

How To Run It



  • OS: Windows 7 (64bit)

  • IDE: Visual Studio 2013

  • OpenCV version: 3.2

  • Cuda Toolkit 7.5 (Note: Do an ADVANCED INSTALLATION. ONLY install the Toolkit + Integration to Visual Studio. Do NOT install the drivers + other stuff it would normally give you. Once installed, your project properties should look like this:

Required to allow input to work in Windows:

Note: Input is not currently working correctly.
  • 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. (thanks Komat!)


  • Open the visual studio project and build it.
  • Run ETS2 in windowed mode and set resolution to 1024 * 768.(It will work properly with 1920 * 1080 screen resolution and 1024 * 768 window mode ETS2.)



Build the source code with the following command (inside the linux directory).



  • Run ETS2 in windowed mode and set its resolution to 1024 * 768. (It will work properly with 1920 * 1080 screen resolution and 1024 * 768 windowed mode ETS2)
  • It cannot find the ETS2 window automatically. Move the ETS2 window to the right-down corner to fix this.
  • In ETS2 Options, set controls to 'Keyboard + Mouse Steering', 'left click' to acclerate, and 'right click' to brake.
  • Go to a highway and set the truck's speed to 40~60km/h. (I recommend you turn on cruise mode to set the speed easily)
  • Run this program!

To enable car detection mode, add -D or --Car_Detection.

./ChosunTruck [-D|--Car_Detection]


OpenCV CUDA Libraries

Having trouble building OpenCV libraries with CMake? No worries, just use the prebuilt OpenCV libraries provided through nuget.

Linker Errors

Getting Linker Errors (LNKxxxx)?

Go to:

 My Project --> properties --> linker --> input --> additional dependencies

and change the path of your Linker dependencies to


Then, go to

C/C++ --> general --> additional #include dependencies

and change the path to where your opencv libraries are located

Assertion failed

Getting an error that looks like this when 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
  • Switch to Release build for now. Usually this is caused by a wrong Mat type being used (in this case, CV_32F).

Or this?

OpenCV Error: Assertion failed (ssize.area() > 0) in cv::remapBilinear, file ...\opencv\sources\modules\imgproc\src\imgwarp.cpp, line 3868 

If you have some problems running this project, reference the demo video below. Or, open a issue to contact our team.

Demo Video

Lane Detection (Youtube link)

youtube link

Lane Detection + Vehicle Detection (Youtube link)

youtube link



How To Contribute

Anyone who is interested in this project is welcome! Just fork it and pull requests!


ChosunTruck, Euro Truck Simulator 2 auto driving solution Copyright (C) 2017 chi3236, bethesirius, uoyssim

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see