Skip to content
This repository has been archived by the owner on Nov 25, 2021. It is now read-only.

Commit

Permalink
Merge pull request #2 from udacity/poly
Browse files Browse the repository at this point in the history
Better API + Polynomials + Eigen
  • Loading branch information
domluna authored May 2, 2017
2 parents f1c96c9 + d40d4e5 commit e4d85b2
Show file tree
Hide file tree
Showing 1,615 changed files with 314,835 additions and 51 deletions.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ set(CMAKE_CXX_FLAGS, "${CXX_FLAGS}")

set(sources src/MPC.cpp src/main.cpp)

include_directories(src/Eigen-3.3)

if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")

include_directories(/usr/local/include)
Expand All @@ -24,3 +26,4 @@ endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
add_executable(mpc ${sources})

target_link_libraries(mpc ipopt z ssl uv uWS)

8 changes: 4 additions & 4 deletions DATA.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ Fields:
* ptsx (Array<float>) - The global x positions of the waypoints.
* ptsy (Array<float>) - The global y positions of the waypoints. This corresponds to the z coordinate in Unity
since y is the up-down direction.
* psi (float) - The orientation of the vehicle in **radians**.
* psi_converted (float) - The orientation of the vehicle in **radians** converted from the Unity format to the standard format expected in most mathemetical functions (more details below).
* psi (float) - The orientation of the vehicle in **radians** converted from the Unity format to the standard format expected in most mathemetical functions (more details below).
* psi_unity (float) - The orientation of the vehicle in **radians**.
* x (float) - The global x position of the vehicle.
* y (float) - The global y position of the vehicle.
* steering_angle (float) - The current steering angle in **radians**.
Expand All @@ -18,12 +18,12 @@ since y is the up-down direction.

### Unity Degree Conversion

The degree representation does not correspond to the following representation below, standard in most mathematical functions. `psi_converted` is the mapping to the below orientation representation.
The degree representation does not correspond to the following representation below, standard in most mathematical functions. `psi` is the mapping to the below orientation representation.

```
// 90
//
// 180 0
// 180 0/360
//
// 270
```
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ Self-Driving Car Engineer Nanodegree Program
* Linux: gcc / g++ is installed by default on most Linux distros
* Mac: same deal as make - [install Xcode command line tools]((https://developer.apple.com/xcode/features/)
* Windows: recommend using [MinGW](http://www.mingw.org/)
* [uWebSockets](https://github.com/uWebSockets/uWebSockets) == 0.13, but the master branch will probably work just fine
* Follow the instructions in the [uWebSockets README](https://github.com/uWebSockets/uWebSockets/blob/master/README.md) to get setup for your platform. You can download the zip of the appropriate version from the [releases page](https://github.com/uWebSockets/uWebSockets/releases). Here's a link to the [v0.13 zip](https://github.com/uWebSockets/uWebSockets/archive/v0.13.0.zip).
* [uWebSockets](https://github.com/uWebSockets/uWebSockets) == 0.14, but the master branch will probably work just fine
* Follow the instructions in the [uWebSockets README](https://github.com/uWebSockets/uWebSockets/blob/master/README.md) to get setup for your platform. You can download the zip of the appropriate version from the [releases page](https://github.com/uWebSockets/uWebSockets/releases). Here's a link to the [v0.14 zip](https://github.com/uWebSockets/uWebSockets/archive/v0.14.0.zip).
* If you have MacOS and have [Homebrew](https://brew.sh/) installed you can just run the ./install-mac.sh script to install this.
* [Ipopt](https://projects.coin-or.org/Ipopt)
* Mac: `brew install ipopt --with-openblas`
Expand All @@ -28,6 +28,7 @@ Self-Driving Car Engineer Nanodegree Program
* Mac: `brew install cppad`
* Linux `sudo apt-get install cppad` or equivalent.
* Windows: TODO. If you can use the Linux subsystem and follow the Linux instructions.
* [Eigen](http://eigen.tuxfamily.org/index.php?title=Main_Page). This is already part of the repo so you shouldn't have to worry about it.
* Simulator. You can download these from the [releases tab](https://github.com/udacity/CarND-MPC-Project/releases).


Expand All @@ -42,9 +43,11 @@ Self-Driving Car Engineer Nanodegree Program

## Tips

It's recommended to test the MPC on basic examples to see if your implementation behaves as desired. One possible example
1. It's recommended to test the MPC on basic examples to see if your implementation behaves as desired. One possible example
is the vehicle starting offset of a straight line (reference). If the MPC implementation is correct, after some number of timesteps
(not too many) it should find and track the reference line.
2. The `lake_track_waypoints.csv` file has the waypoints of the lake track. You could use this to fit polynomials and points and see of how well your model tracks curve. NOTE: This file might be not completely in sync with the simulator so your solution should NOT depend on it.
3. For visualization this C++ [matplotlib wrapper](https://github.com/lava/matplotlib-cpp) could be helpful.

## Editor Settings

Expand Down
5 changes: 3 additions & 2 deletions install-mac.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
brew install openssl libuv cmake
#! /bin/bash
brew install openssl libuv cmake zlib
git clone https://github.com/uWebSockets/uWebSockets
cd uWebSockets
git checkout e94b6e1
# git checkout e94b6e1
patch CMakeLists.txt < ../cmakepatch.txt
mkdir build
export PKG_CONFIG_PATH=/usr/local/opt/openssl/lib/pkgconfig
Expand Down
3 changes: 2 additions & 1 deletion install-ubuntu.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#! /bin/bash
sudo apt-get install libuv1-dev
git clone https://github.com/uWebSockets/uWebSockets
cd uWebSockets
git checkout e94b6e1
# git checkout e94b6e1
mkdir build
cd build
cmake ..
Expand Down
4 changes: 4 additions & 0 deletions src/Eigen-3.3/.hg_archival.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
repo: 8a21fd850624c931e448cbcfb38168cb2717c790
node: 67e894c6cd8f5f1f604b27d37ed47fdf012674ff
branch: 3.3
tag: 3.3.3
11 changes: 11 additions & 0 deletions src/Eigen-3.3/.hgeol
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[patterns]
*.sh = LF
*.MINPACK = CRLF
scripts/*.in = LF
debug/msvc/*.dat = CRLF
debug/msvc/*.natvis = CRLF
unsupported/test/mpreal/*.* = CRLF
** = native

[repository]
native = LF
34 changes: 34 additions & 0 deletions src/Eigen-3.3/.hgignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
syntax: glob
qrc_*cxx
*.orig
*.pyc
*.diff
diff
*.save
save
*.old
*.gmo
*.qm
core
core.*
*.bak
*~
build*
*.moc.*
*.moc
ui_*
CMakeCache.txt
tags
.*.swp
activity.png
*.out
*.php*
*.log
*.orig
*.rej
log
patch
a
a.*
lapack/testing
lapack/reference
32 changes: 32 additions & 0 deletions src/Eigen-3.3/.hgtags
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
2db9468678c6480c9633b6272ff0e3599d1e11a3 2.0-beta3
375224817dce669b6fa31d920d4c895a63fabf32 2.0-beta1
3b8120f077865e2a072e10f5be33e1d942b83a06 2.0-rc1
19dfc0e7666bcee26f7a49eb42f39a0280a3485e 2.0-beta5
7a7d8a9526f003ffa2430dfb0c2c535b5add3023 2.0-beta4
7d14ad088ac23769c349518762704f0257f6a39b 2.0.1
b9d48561579fd7d4c05b2aa42235dc9de6484bf2 2.0-beta6
e17630a40408243cb1a51ad0fe3a99beb75b7450 before-hg-migration
eda654d4cda2210ce80719addcf854773e6dec5a 2.0.0
ee9a7c468a9e73fab12f38f02bac24b07f29ed71 2.0-beta2
d49097c25d8049e730c254a2fed725a240ce4858 after-hg-migration
655348878731bcb5d9bbe0854077b052e75e5237 actual-start-from-scratch
12a658962d4e6dfdc9a1c350fe7b69e36e70675c 3.0-beta1
5c4180ad827b3f869b13b1d82f5a6ce617d6fcee 3.0-beta2
7ae24ca6f3891d5ac58ddc7db60ad413c8d6ec35 3.0-beta3
c40708b9088d622567fecc9208ad4a426621d364 3.0-beta4
b6456624eae74f49ae8683d8e7b2882a2ca0342a 3.0-rc1
a810d5dbab47acfe65b3350236efdd98f67d4d8a 3.1.0-alpha1
304c88ca3affc16dd0b008b1104873986edd77af 3.1.0-alpha2
920fc730b5930daae0a6dbe296d60ce2e3808215 3.1.0-beta1
8383e883ebcc6f14695ff0b5e20bb631abab43fb 3.1.0-rc1
bf4cb8c934fa3a79f45f1e629610f0225e93e493 3.1.0-rc2
da195914abcc1d739027cbee7c52077aab30b336 3.2-beta1
a8e0d153fc5e239ef8b06e3665f1f9e8cb8d49c8 before-evaluators
09a8e21866106b49c5dec1d6d543e5794e82efa0 3.3-alpha1
ce5a455b34c0a0ac3545a1497cb4a16c38ed90e8 3.3-beta1
69d418c0699907bcd0bf9e0b3ba0a112ed091d85 3.3-beta2
bef509908b9da05d0d07ffc0da105e2c8c6d3996 3.3-rc1
04ab5fa4b241754afcf631117572276444c67239 3.3-rc2
26667be4f70baf4f0d39e96f330714c87b399090 3.3.0
f562a193118d4f40514e2f4a0ace6e974926ef06 3.3.1
da9b4e14c2550e0d11078a3c39e6d56eba9905df 3.3.2
Loading

0 comments on commit e4d85b2

Please sign in to comment.