Code Monkey home page Code Monkey logo

self-driving-car-sim's Introduction

Deprecated Repository

The code in the master branch of this repository is deprecated. Currently enrolled learners, if any, can:

Welcome to Udacity's Self-Driving Car Simulator

This simulator was built for Udacity's Self-Driving Car Nanodegree, to teach students how to train cars how to navigate road courses using deep learning. See more project details here.

All the assets in this repository require Unity. Please follow the instructions below for the full setup.

Available Game Builds (Precompiled builds of the simulator)

Term 1

Instructions: Download the zip file, extract it and run the executable file.

Version 2, 2/07/17

Linux Mac Windows

Version 1, 12/09/16

Linux Mac Windows 32 Windows 64

Term 2

Please see the Releases page for the latest version of the Term 2 simulator (v1.45, 6/14/17).

Source code can be obtained therein or also on the term2_collection branch.

Term 3

Please see the Releases page for the latest version of the Term 3 simulator (v1.2, 7/11/17).

Source code can be obtained therein or also on the term3_collection branch.

System Integration / Capstone

Please see the CarND-Capstone Releases page for the latest version of the Capstone simulator (v1.3, 12/7/17).

Source code can be obtained therein.

Unity Simulator User Instructions

  1. Clone the repository to your local directory, please make sure to use Git LFS to properly pull over large texture and model assets.

  2. Install the free game making engine Unity, if you dont already have it. Unity is necessary to load all the assets.

  3. Load Unity, Pick load exiting project and choice the self-driving-car-sim folder.

  4. Load up scenes by going to Project tab in the bottom left, and navigating to the folder Assets/1_SelfDrivingCar/Scenes. To load up one of the scenes, for example the Lake Track, double click the file LakeTrackTraining.unity. Once the scene is loaded up you can fly around it in the scene viewing window by holding mouse right click to turn, and mouse scroll to zoom.

  5. Play a scene. Jump into game mode anytime by simply clicking the top play button arrow right above the viewing window.

  6. View Scripts. Scripts are what make all the different mechanics of the simulator work and they are located in two different directories, the first is Assets/1_SelfDrivingCar/Scripts which mostly relate to the UI and socket connections. The second directory for scripts is Assets/Standard Assets/Vehicle/Car/Scripts and they control all the different interactions with the car.

  7. Building a new track. You can easily build a new track by using the prebuilt road prefabs located in Assets/RoadKit/Prefabs click and drag the road prefab pieces onto the editor, you can snap road pieces together easily by using vertex snapping by holding down "v" and dragging a road piece close to another piece.

Self-Driving Car Simulator

self-driving-car-sim's People

Contributors

awbrown90 avatar baumanab avatar mvirgo avatar olivercameron avatar sshiv avatar sudkul avatar tariqrafique avatar

Stargazers

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

Watchers

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

self-driving-car-sim's Issues

Simulator crashes on startup inside a virtual machine

I'm trying to run the linux build of the simulator in an Amazon EC2 VM. I get the initial screen that asks for screen resolution and graphics quality, but not matter what options I choose for those two, my application ends crashing and core dumping. I ran strace and it showed me that the program received SIGABRT. I also tried the following things:

  • I installed gnome desktop manager and vnc to ensure that I can interact with GUI applications.
  • I did x-forwarding over SSH from the Amazon EC2 VM to a local linux VM on my laptop.

None of these options helped with the crash. I passed the logfile option while running the simulator and the output of that can be found here: http://pastebin.com/S9KbDbyA

How do I get to the bottom of this problem? I'm beginning to sense that this might be a problem with the unity3d engine.

Release 1.4: The application “term2_sim.app” can’t be opened

I downloaded the release 1.4, but I wasn't able to run it and I was prompt with this error "The application “term2_sim.app” can’t be opened."
For some reason it was missing the +x flag to the main binary, a quick fix is to run the following in a terminal:

chmod +x /Applications/term2_sim.app/Contents/MacOS/term2_sim_mac

maybe just an issue with my configuration.

Materials and/or textures seem to be missing

I cloned the repository using git lfs and it seems like I have all the files, however when I launch any scene, I don't see any materials and the UI looks broken. Any help much appreciated, I'd love to contribute to this project!
self-driving-car-issue

The sim can't run on my ubuntu

Hi,

I try to run the sim on my ubuntu, and I have changed the permission to allow the sim to be running as a program, but the sim can only start with the configuration step. After I confirm the configuration of the sim, the sim just close.

can anybody know this?

Udacity Simulator does NOT compile in Unity

I downloaded your simulator source code from your github, unzipped the folder, and then loaded this folder to Unity. When Unity opens after loading and compiling scripts, it returns 218 errors most of them saying that certain files cannot be read.

Please update your current source code.

Having trouble loading in Unity 5.4.2f2-GVR12

I'm trying to work with a freshly cloned repository and after opening either training scene I don't see any of the ground textures. I think something must be broken with loading the assets from disk, but the warnings don't say much.

Here's a screenshot:
screen shot 2017-05-11 at 5 20 17 pm

Any idea what's wrong?

Spaming Log File

The log file gets spammed with the following lines:

19/05/2017 21:46:37|Fatal|WebSocket.acceptException|System.Net.Sockets.SocketException: Connection refused
                            at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP, Boolean requireSocketPolicy) [0x00000] in <filename unknown>:0 
                            at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP) [0x00000] in <filename unknown>:0 
                            at System.Net.Sockets.TcpClient.Connect (System.Net.IPEndPoint remote_end_point) [0x00000] in <filename unknown>:0

This is Term 2 Simulator V1.3 Updated MPC
In just a few seconds of running the application a log file of 100MB was generated.

This was run on Linux. The log file can be found at : ~/.config/unity3d/Udacity/self_driving_car_nanodegree_program/Player.log

Simulator with Windows 7

I can not for company reasons upgrade to Windows 10, we use Windows 7 Premium. The simulator runs fine, until I try to record, then when I select the folder nothing else occurs. The menu selection just stays highlighted and no recording gets done. Is it possible to run the simulator with Windows 7, or is there user error on my part?

Training mode is missing on windows 10?

I've tried all the releases on my 64 bit windows 10 machine and none of them allowed me to record (pressing R key does nothing) because the exe, once opened, doesn't offer the posibility to choose "Training mode" as you can see here:

issue

Am I missing some config to enable the training mode?

White layer over simulator problem

Hey people,

I'm experiencing some issue with my simulator. The background of the UI is white in the menu and also during the simulator there is a white layover. I though it might have something to do with the Build Settings and already tried if I need to include maybe UISetupScene from the assets but it didn't help. Any ideas or did some of you experience the same problem? I'm quite a beginner with Unity so far, so sorry if that's an easy question, though couldn't find anything online.

Screenshots are attached:

screen shot 2017-08-11 at 13 33 02
screen shot 2017-08-11 at 13 33 30
screen shot 2017-08-11 at 13 30 46

Please add option to discard latest recording

It is very easy to screw up and go off track and ruin an entire run of recording. If there was just a button to say delete last recording, that would help. I have to do it manually now and it is painful.

Feature Request: Support the 'reset' message

The version of the simulator that we used for the PID control project (v0.1.1 here) supported a reset message that put the car back at the start of the track.

This feature was very useful for automatically running the simulator for parameter tuning.

It would be nice if it was supported for the other projects, e.g. MPC, which also require some parameter tuning.

Workaround

At least on Mac, I found the following workaround for automating the simulator for the MPC project, which is based on actually clicking the buttons using Applescript and the cliclick utility:

#
# The MPC sim does not support reset, so automate clicking the buttons.
# Note: this only works on Mac.
#
# 1. This assumes that the sim is already running, and that it starts on the
# default loading screen with project 1 selected.
#
# 2. You need to `brew install cliclick`.
#
# 3. You may need to allow your terminal application Accessibility privileges:
# go to System Preferences > Security & Privacy > Privacy > Accessibility and
# then tick the box for your terminal application. (It doesn't look like this
# is required for the standard Mac terminal application, but if you use one,
# such as iTerm, it is.)
#
# 4. Do not move the mouse while the tuning script is running, just to be safe.
#
# 5. At least for me, this does not work if the screen is locked. You can it seems
# turn it down to zero brightness, however.
#

require 'English'

#
# Run a command and capture the stdout and stderr.
#
def run(*args, **options)
  Dir.mktmpdir do |tmp|
    out_pathname = File.join(tmp, 'out')
    err_pathname = File.join(tmp, 'err')
    options[:out] = out_pathname
    options[:err] = err_pathname
    options[:in] = '/dev/null'

    command = args.map(&:to_s)
    Process.waitpid(Process.spawn(*command, **options))

    [
      $CHILD_STATUS.exitstatus,
      File.read(out_pathname),
      File.read(err_pathname)
    ]
  end
end

CLICK_DELAY = 500 # ms

def osascript(*commands)
  arguments = commands.map { |command| ['-e', command] }.flatten
  status, out, err = run('osascript', *arguments)
  raise "osascript failed: #{status}: #{err}" unless status.zero?
  out
end

def find_sim_position
  out = osascript(
    'tell application "self_driving_car_nanodegree_program" to activate',
    'tell application "System Events" to' \
      ' tell application process "self_driving_car_nanodegree_program" to' \
      ' get position of window 1'
  )
  position = out.split(',').map(&:strip).map(&:to_i)
  raise "bad position: #{position}" unless position.size == 2
  position
end

def cliclick(*commands)
  status, out, err = run('cliclick', '-w', CLICK_DELAY.to_s, '-r', *commands)
  raise "cliclick failed: #{status}: #{err}" unless status.zero?
  out
end

def check_color_is_green(color)
  color = color.split.map(&:to_i)
  raise "bad color: #{color}" unless color.size == 3
  unless color[0] < 100 && color[1] > 250 && color[2] < 100 # RGB
    STDERR.puts "Unexpected MPC line color: #{color} (wrong project?)"
  end
end

def start_sim
  position = find_sim_position

  # Click the left arrow to get project 5, and then check that we're on project
  # 5 by looking for the green MPC line, then click the button.
  mpc_line_color = cliclick(
    "c:#{[position[0] + 110, position[1] + 320].join(',')}",
    'cp:+220,-57',
    'c:+210,+85'
  )

  check_color_is_green(mpc_line_color)
  sleep 5
end

def stop_sim
  position = find_sim_position
  top_left = [position[0] + 20, position[1] + 30] # to focus
  cliclick "c:#{top_left.join(',')}", 'kp:esc'
  sleep 2
end

To use this script, you'd do something like:

start_sim
# run build/mpc and collect the output
stop_sim

It's not as reliable as the reset method, but it has run for ~12h at a time on my machine without incident. This was with the 1.4 version of the simulator from this repo on Mac OS X El Capitan 10.11.6.

This repository is over its data quota. Purchase more data packs to restore access.

I got this error while trying git clone. I'm not sure if this is from my end or not.

git clone https://github.com/udacity/self-driving-car-sim.git
Cloning into 'self-driving-car-sim'...
remote: Counting objects: 7608, done.
remote: Total 7608 (delta 0), reused 0 (delta 0), pack-reused 7608
Receiving objects: 100% (7608/7608), 132.32 MiB | 1.40 MiB/s, done.
Resolving deltas: 100% (1987/1987), done.
Checking connectivity... done.
Downloading Assets/1_SelfDrivingCar/Sprites/Background.png (6.83 MB)
Error downloading object: Assets/1_SelfDrivingCar/Sprites/Background.png (36e4565): Smudge error: Error downloading Assets/1_SelfDrivingCar/Sprites/Background.png (36e4565319a778a53538a2c1419174cac59597859e5a8616c1b94a08d6221ac3): batch response: This repository is over its data quota. Purchase more data packs to restore access.

Can I try this projects on my Ubuntu?

Can I try this project on my Ubuntu?But Unity just on win or mac.
And I try download beta-simulator-linux.zip ,then get beta_simulator.x86_64,beta_simulator.x86,beta_simulator_Data.

But I can't run it. Is that some steps or files I miss ? I love this project, hope for your help!

Version 2, 2/07/17

Linux beta_simulator.x86 this one do not work
./beta_simulator.x86_64: Permission denied
(have to run this,and now it work agian :) chmod 777 ./beta_simulator.x86_64)

Version 1, 12/09/16

Linux Default Linux desktop Universal.x86_64 this one work!
relaybot@ubuntu:~/Downloads/simulator-linux$ ./Default\ Linux\ desktop\ Universal.x86_64
Set current directory to /home/relaybot/Downloads/simulator-linux
Found path: /home/relaybot/Downloads/simulator-linux/Default Linux desktop Universal.x86_64
Mono path[0] = '/home/relaybot/Downloads/simulator-linux/Default Linux desktop Universal_Data/Managed'
Mono path[1] = '/home/relaybot/Downloads/simulator-linux/Default Linux desktop Universal_Data/Mono'
Mono config path = '/home/relaybot/Downloads/simulator-linux/Default Linux desktop Universal_Data/Mono/etc'
displaymanager : xrandr version warning. 1.4
client has 3 screens
displaymanager screen (0)(LVDS1): 1366 x 768
Using libudev for joystick management

Importing game controller configs

Adding traffic signs

Is it possible to add traffic signs as Assets (correct me if I'm wrong) and place them on the side of the road? I just need some help so that I know which components in the project I should focus on.

Term 3 Simulator Sources

The sources of this repository don't seem to relate to the term 3 release (even the corresponding tags don't). Could somebody commit and push those sources and/or explain why this hasn't been done so far?

This repository is over its data quota

Hi, I'm facing the following issue when I try to clone:

Error downloading object: Assets/1_SelfDrivingCar/Sprites/Background.png (36e4565): Smudge error: Error downloading Assets/1_SelfDrivingCar/Sprites/Background.png (36e4565319a778a53538a2c1419174cac59597859e5a8616c1b94a08d6221ac3): batch response: This repository is over its data quota. Purchase more data packs to restore access.

Is the repository over its allotted data quota ?

beta version (feb) won't turn left or right with gamepad

Get this version: https://d17h27t6h515a5.cloudfront.net/topher/2017/February/58983385_beta-simulator-mac/beta-simulator-mac.zip

Connect gamepad
Start simulator

Expected:
Be able to turn left and right with gamepad controller

Actual:
Can only go straight.

Details
OS: macOS. Tried Windows too
Gamepad: PS3 controller. Tried xbox one controller too

It works fine if you use the older version from November:
https://d17h27t6h515a5.cloudfront.net/topher/2016/November/5831f290_simulator-macos/simulator-macos.zip

problem with assets model

Hi,
What does it mean "please make sure to use Git LFS to properly pull over large texture and model assets."?

When I import the project Unity is not able to find some prefabs, I think that maybe is because I just used Unzip but I don´t really understand what Git is for...

Camera distortion correction needed?

I'm interested in applying all the knowledge I gained in the Advanced Lane Detection project and put it into the Car Simulator.

How do I know that the left, right and center camera are corrected or non-corrected?

Kidnapped vehicle control data seems to have an error at line 238

Hi!
I noticed that I was getting yaw_rate input values of 62.697(!) around step 250. Because of which yaw error always remains above the threshold. Even though the particle filter works.

I looked up the files of self driving car simulator and notice that in version 1.45 the file Assets/Resources/observations/control_data.txt, has the following entry at line 238:

8.9471 62.697

Which seems much higher than all the other values. Is this an error?

Finding location of car with respect to the road

To make this simulator work with Reinforcement Learning, I need to add a reward function with respect to the car's position on the road. Is there any way the simulator can calculate the car's position?

Term 3 integration: unpredictable reactions to throttle\brake commands

Filling ~/.config/unity3d/Udacity/self_driving_car_nanodegree_program/Player.log if connection fails

The simulator generates a lot of log entrys like this if ros is not running int the Player.log file:

9/5/2017 1:59:25 AM|Fatal|WebSocket.acceptException|System.Net.Sockets.SocketException: Connection refused
at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP, Boolean requireSocketPolicy) [0x00000] in :0
at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP) [0x00000] in :0
at System.Net.Sockets.TcpClient.Connect (System.Net.IPEndPoint remote_end_point) [0x00000] in :0

after one night leaving the program on, my Player log was 180GB.

Generated CSV file is locale-specific

While generating data for the Behavioral Cloning project, I found something interesting (and highly annoying) with the beta simulator in Linux (Ubuntu 16.10 x64). I was trying to generate new data and when finished recording, I tried to load my CSV file only to find out that the values didn't make sense. When checking it, I found that all the values had a comma instead of a period as the decimals separator (I live in Venezuela so my PC's locale is set as es_VE), so I got unintended extra columns in the file.
Running the simulator as $ LC_ALL ./beta_simulator.x86_64 & serves as a workaround.

Does not run in X11 Forwarded Mode - Feature Request

I am trying to run the Linux version of the simulator on the remote instance over ssh in X11 forward mode. The app only shows the initial settings screen and when clicked on start, it vanishes.

Can we add a feature so that it can run in X11 forwarded mode?

Thanks

Unable to load car in Unity 5.5.1f1

I tried running this simulator using Unity 5.5.6 and 5.5.1f1 and i receive the following error in both cases

TerrainData is missing splat texture 0.
TerrainData is missing splat texture 1.
TerrainData is missing splat texture 0.

The car is not rendered due to this error and a white strip is being is displayed instead.

Unity just freezes during import

  1. while project is getting imported progress bar freezes on " importing small assets" step.

This is how I load the project:

  • clone the repo with git lfs followingly:

git lfs clone https://github.com/udacity/self-driving-car-sim.git

Load the project from "Open" tab on the first screen. ( Unlike what you wrote on the Readme, there is no " Load up the cloned folder self-driving-car-sim inside Unity as a new project " option, either create New from blank or Open the existing one)

then it starts loading and then it stuck at "importing small assets" step on progress bar.

I am on mac.
intel hd 530
16 gb ram

can you guys help me ?

Term 2 Simulator Doesn't Run on Mac

I downloaded and unpacked term2_sim_mac.zip (release v1.0, May 3), but the app doesn't run, throwing the error: The application "term2_sim" can't be opened.

ROS Integration Simulator: Player data archive not found

parallels@ubuntu:~/Downloads/lights_no_cars$ chmod +x ros_test.x86_64 parallels@ubuntu:~/Downloads/lights_no_cars$ ./ros_test.x86_64 Set current directory to /home/parallels/Downloads/lights_no_cars Found path: /home/parallels/Downloads/lights_no_cars/ros_test.x86_64 Mono path[0] = '/home/parallels/Downloads/lights_no_cars/ros_test_Data/Managed' Mono config path = '/home/parallels/Downloads/lights_no_cars/ros_test_Data/Mono/etc' Preloaded 'ScreenSelector.so'
Player data archive not found at /home/parallels/Downloads/lights_no_cars/ros_test_Data/data.unity3d, using local filesystem
parallels@ubuntu:~/Downloads/lights_no_cars$ cd ros_test_Data/ parallels@ubuntu:~/Downloads/lights_no_cars/ros_test_Data$ ls

boot.config level3.resS sharedassets1.assets GI Managed sharedassets1.assets.resS globalgamemanagers Mono sharedassets2.assets globalgamemanagers.assets Plugins sharedassets2.assets.resS level0 Resources sharedassets2.resource level1 resources.assets sharedassets3.assets level2 resources.assets.resS sharedassets3.assets.resS level2.resS sharedassets0.assets StreamingAssets level3 sharedassets0.assets.resS

Potential display bug in simulator v1.4

I can run the simulator and I see the car moving, but all the blue and red marks for the sensor data are not shown. The vicinity around the car remains simply white. If I also run my EKF-Code, I get a connection to the simulator but the symbols of my output are also not shown.

I'm using Debian Jessie (stable) with Xorg 7.7 and the proprietary Nvidia driver. Simulator version is 1.4. If you need further information, please let me know.

Missing assembly?

I've imported the project into Unity, but when trying to view a scene I get the following error:

Assets/1_SelfDrivingCar/Scripts/CommandServer.cs(4,7): error CS0246: The type or namespace name `SocketIO' could not be found. Are you missing an assembly reference?

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.