All Projects → vinzeebreak → road-simulator

vinzeebreak / road-simulator

Licence: other
🛣️ Easy-to-use road simulator for little self-driving cars

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to road-simulator

Airsim
Open source simulator for autonomous vehicles built on Unreal Engine / Unity, from Microsoft AI & Research
Stars: ✭ 12,528 (+54369.57%)
Mutual labels:  simulator, self-driving-car
learning-to-drive-in-5-minutes
Implementation of reinforcement learning approach to make a car learn to drive smoothly in minutes
Stars: ✭ 227 (+886.96%)
Mutual labels:  simulator, self-driving-car
airsim ros
AirSim ROS packages: modified ros wrapper for airsim, and some vslam related tools. (Mainly focused on Car SimMode)
Stars: ✭ 28 (+21.74%)
Mutual labels:  simulator, self-driving-car
Carla
Open-source simulator for autonomous driving research.
Stars: ✭ 7,012 (+30386.96%)
Mutual labels:  simulator, self-driving-car
Uselfdrivingsimulator
Self-Driving Car Simulator
Stars: ✭ 48 (+108.7%)
Mutual labels:  simulator, self-driving-car
Duckietown.jl
Differentiable Duckietown
Stars: ✭ 29 (+26.09%)
Mutual labels:  simulator, self-driving-car
behavioral cloning
No description or website provided.
Stars: ✭ 26 (+13.04%)
Mutual labels:  simulator, self-driving-car
Simulator
A ROS/ROS2 Multi-robot Simulator for Autonomous Vehicles
Stars: ✭ 1,260 (+5378.26%)
Mutual labels:  simulator, self-driving-car
Awesome Carla
👉 CARLA resources such as tutorial, blog, code and etc https://github.com/carla-simulator/carla
Stars: ✭ 246 (+969.57%)
Mutual labels:  simulator, self-driving-car
multi-sdr-gps-sim
multi-sdr-gps-sim generates a IQ data stream on-the-fly to simulate a GPS L1 baseband signal using a SDR platform like HackRF or ADLAM-Pluto.
Stars: ✭ 53 (+130.43%)
Mutual labels:  simulator
drc-sim-client
Wii U Gamepad Simulator Frontend
Stars: ✭ 52 (+126.09%)
Mutual labels:  simulator
MetrostroiAddon
Metrostroi is an addon for Garry's Mod which puts you behind the controls of the real and fully simulated subway trains.
Stars: ✭ 21 (-8.7%)
Mutual labels:  simulator
openpilot
FOR PRE-AP/AP1/AP2 TESLA CARS ONLY: open source driving agent. You can help development by donating @ https://github.com/sponsors/BogGyver
Stars: ✭ 30 (+30.43%)
Mutual labels:  self-driving-car
react-native-ibeacon-simulator
Simulate device act as an iBeacon, or transmit as an iBeacon signal from your phone
Stars: ✭ 48 (+108.7%)
Mutual labels:  simulator
simso
Simulator of multiprocessor real-time scheduling
Stars: ✭ 55 (+139.13%)
Mutual labels:  simulator
Stubmatic
Mock HTTP calls without coding. Designed specially for testing and testers.
Stars: ✭ 118 (+413.04%)
Mutual labels:  simulator
Logic-Circuit-Simulator
A free and open-source Logic Circuit Simulator built in Godot Engine.
Stars: ✭ 23 (+0%)
Mutual labels:  simulator
aurora-sdk-mac
An SDK to develop effects for Nanoleaf Light Panels using features like frequency, beat, or tempo.
Stars: ✭ 43 (+86.96%)
Mutual labels:  simulator
ts-c99-compiler
ANSI C 16bit Compiler + NASM Assembler + Intel 8086 / 80186 + X87 emulator written entirely in TypeScript
Stars: ✭ 78 (+239.13%)
Mutual labels:  simulator
WorldSim
2D tile-based sandbox RPG with procedurally generated fantasy world simulator 🌏
Stars: ✭ 19 (-17.39%)
Mutual labels:  simulator

Road Simulator

The road_simulator is part of the 'ironcar' project. To see what the ironcar project is, go to the ironcar repository.
If you want to get the full tutorial for the entire project (ironcar hardware, software, simulator and model generation, you can also go there.

This simulator generates 'fake' pictures of a road as seen by a 1/10th car with a wide angle camera and creates a deep-learning model based on these images. We used it to get (250 * 70) RGB dimensional track pictures. It is quite fast (we can generate 100,000 images in 15 minutes which is faster than driving the car ourselves and capturing the images), and far more accurate in the learning process (less approximations of curves etc).

These are examples of what can be (very easily) generated:

dashed line 1 dashed line 2 dashed line 3 dashed line 4
plain line 1 plain line 2 plain line 3 plain line 4
dashed line 5 plain_line_5 plain_line_6 plain_line_7

With the model created in example/model_cnn.py and a dataset of 100,000 images created via simulator, we achieved a 94% accuracy and managed to get our car to successfully finish a lap on 2 different circuits it had never seen before !

Getting started

To install the library, do in the root folder:

$ pip install .

In this code, please adapt ./ground_pics to fit your current layout.

Each simulator is composed of layers to make it easy to adapt to your particular situation/track. The simpliest type of generator is the default Simulator object:

from roadsimulator.simulator import Simulator

simulator = Simulator()

Then, we add layers to our generator:

from roadsimulator.colors import White
from roadsimulator.layers.layers import Background, DrawLines, Perspective, Crop

white = White()

simulator.add(Background(n_backgrounds=3, path='./ground_pics', input_size=(250, 200)))
simulator.add(DrawLines(input_size=(250, 200), color_range=white))
simulator.add(Perspective())
simulator.add(Crop())

White object gives a range of white-ish colors to draw the lines. They may not appear exactly white on the images. There exists three colors for now (Yellow, White and DarkShadow) and a generic Color class. You can add more colors by replicating the yellow example.

Now, let's generate the images. We just need to write:

simulator.generate(n_examples=100, path='my_dataset')

where you need to set the number of images to be generated n_examples and the path you want them to be generated in path.

Creating a model

You can simply create a keras model.

First, let's load the images and their labels, split in a training and validation sets:

from roadsimulator.models.utils import get_datasets

train_X, train_Y, val_X, val_Y, _, _ = get_datasets('my_dataset', n_images=1000)

where n_images is the maximum number of images you want to get from the dataset 'my_dataset'.

Now, just create the model you want, using keras:

from keras.layers import Input, Convolution2D, MaxPooling2D, Activation
from keras.layers import Flatten, Dense
from keras.models import Model

img_in = Input(shape=(70, 250, 3), name='img_in')
x = img_in

x = Convolution2D(1, 3, 3, activation='relu', border_mode='same')(x)
x = MaxPooling2D(pool_size=(2, 2), strides=(2,2))(x)

x = Convolution2D(2, 3, 3, activation='relu', border_mode='same')(x)
x = MaxPooling2D(pool_size=(2, 2), strides=(2,2))(x)

x = Convolution2D(2, 3, 3, activation='relu', border_mode='same')(x)
x = MaxPooling2D(pool_size=(2, 2), strides=(2,2))(x)

x = Convolution2D(4, 3, 3, activation='relu', border_mode='same')(x)
x = MaxPooling2D(pool_size=(2, 2), strides=(2,2))(x)

flat = Flatten()(x)

x = Dense(20)(flat)
x = Activation('relu')(x)

x = Dense(5)(x)
angle_out = Activation('softmax')(x)

model = Model(input=[img_in], output=[angle_out])
model.compile(optimizer='adam', loss='categorical_crossentropy', metrics=['accuracy'])

model.fit([train_X], train_Y, batch_size=100, nb_epoch=20, validation_data=([val_X], val_Y))

And it's done !

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].