Code Monkey home page Code Monkey logo

eurotruckautopilot's People

Contributors

zappybiby avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

eurotruckautopilot's Issues

Hidden treatment images

I can't see the windows of
"original_warped"
"adaptiveTreshold"
"merge"

The windows are invisible.
capture

screenshot_1

Any idea how to fix that ?

Find positions of lines

Once #2 is resolved, we would need to find the positions of the lines detected in order to calculate the center of the lane.

One way to do that would be to create a histogram of the merged binary threshold we currently use to isolate the road lines.

Then we would determine the two highest peaks in that histogram to find the left (closest to 0) and right (closest to width) lines. Afterwards, we would calculate the midpoint of the two peaks to find the center of the lane.

Here is an example of how we can do this in Python.

Not running !

Hy, when i run it , i got only this

of lines: 59 found: 19 -961105

of lines: 60 found: 25 43874

of lines: 67 found: 22 53505

of lines: 68 found: 18 40867

of lines: 65 found: 13 40890

of lines: 62 found: 23 43883

of lines: 57 found: 17 40866

of lines: 59 found: 18 69844

of lines: 53 found: 28 54840

of lines: 49 found: 8 44881

of lines: 62 found: 23 69837

but he don't steering ! :-\ what i do wrong...

Mouse Movement

Implementing mouse movement into our program will allow it to drive the truck autonomously.
The two modules that could be used to do this are pyautogui using its moveTo() function and win32api using its mouse_event function as done here.

We can find the midpoint of the line that connects the left and right lane lines produced by our program in the Experimental branch
https://github.com/zappybiby/EuroTruckAutopilot/blob/EXPERIMENTAL/hough_lines.py#L16 to determine the center of the lane.

Here wot I think

  1. Calculate current x position by dividing width by 2
  2. Calculate difference between current x position and midpoint of third line.
  3. Use PID controller to determine amount to move mouse cursor by
    3a. Calculate max amount of pixels that the cursor can move before the lane is lost (approx. 65 pixels)
    3b. Divide #2 by #3a
    3c. Create a variable called turning_speed which dictates the rate at which the wheel will turn (usually 1 / #3a
    3d. Multiply #3b by #3c
    3e. [optional] if #3d is > some_number, initiate turn (to prevent overcorrection)

Remember Previous Lines

Having ETA remember lines will prevent noise from causing sudden deviations in the detected lane.

An example of this can be seen in this image which is taken from this website. The blue lines represent the current frame and the green lines represent the averaged past frames polynomial fit. In this example, the current frame has lines that significantly deviate from the averaged lines. A secondary objective would be to compare the line in the current frame against the averaged line in order to ignore lines that significantly deviate from the previous x lines.
0_vrpdrg2qmkql0t2-_

One way of doing this would be to create an empty array that will store the previous x number of lanes which would then be averaged to draw a single extrapolated lane. This method is discussed here.

Adaptive Rescaling of Windows

Currently ETA uses hardcoded coordinates to display OpenCV windows. This means that the windows may not display correctly for those that don't have a 1920x1080 monitor. We need to implement a way to have the windows resize/move so that they display alongside the ETS2 Window.

It might be beneficial to have ETA detect if there are two monitors available so that those windows can be displayed on the monitor opposite of ETS2

Using ctypes (windows only): https://code.activestate.com/recipes/460509-get-the-actual-and-usable-sizes-of-all-the-monitor/

Currently looking for a environment-agnostic method of doing this (future goal to make ETA work for mac/linux)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.