Download and install cmake:
https://cmake.org/files/v3.8/cmake-3.8.2-win64-x64.msi
Choose Add CMake to User Path so that you can access it from the command line:
Clone vcpkg from https://github.com/Microsoft/vcpkg.git into c:\vcpkg (or any folder of your choice)
Run bootstrap
C:\vcpkg> .\bootstrap-vcpkg.bat
Open command prompt as administrator and run:
C:\vcpkg> .\vcpkg integrate install
Install pre-requisites:
C:\vcpkg> .\vcpkg install openssl zlib libuv
Since udacity's project are not using the latest master branch of uWebSockets, we need to install the same commit as is done for Ubuntu/Mac. I've already compiled the particular commit and have included the library/include files in carnd-term2-libs-ports.zip. Just unzip and copy the 'carnd-term2-libs' folder from the zip file to c:\vcpkg\ports
Install carnd-term2-libs using:
C:\vcpkg> .\vcpkg install carnd-term2-libs
Make sure you have a uWS folder in C:\vcpkg\installed\x86-windows\include:
git clone https://github.com/udacity/CarND-Extended-Kalman-Filter-Project.git
Towards the very bottom where target_link_libraries are mentioned, change:
add_executable(ExtendedKF ${sources})
target_link_libraries(ExtendedKF z ssl uv uWS)
To:
if (WIN32)
set(VCPKG_INSTALL ${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET})
message("Using vcpkg_install ${VCPKG_INSTALL}")
include_directories(${VCPKG_INSTALL}/include)
link_directories(${VCPKG_INSTALL}/lib)
endif()
add_executable(ExtendedKF ${sources})
if (NOT WIN32)
target_link_libraries(ExtendedKF z ssl uv uWS)
else()
target_link_libraries(ExtendedKF ssleay32 libuv uWS ws2_32)
target_link_libraries(ExtendedKF optimized zlib )
target_link_libraries(ExtendedKF debug zlibd )
endif()
Or you can download the CMakeLists.txt and use that.
cd CarND-Extended-Kalman-Filter-Project
mkdir build
cd build
cmake .. -DCMAKE_TOOLCHAIN_FILE=c:\vcpkg\scripts\buildsystems\vcpkg.cmake -G "Visual Studio 14"
Open Visual Studio 2015 and load ExtendedKF.sln from the build directory. Once loaded, make sure that the include directory is correctly set by right clicking on ExtendedKF Project in the solution explorer and choose properties:
Also, make sure Linker is set correctly:
Build the project, you will get about 37 warnings related to code written inside uWS and two errors for our own project, which makes sense since we need to finish those functions before the code can compile.
For testing purposes, open tools.cpp and complete those two functions. e.g. just return 1,2,3,4 as RMSE:
VectorXd Tools::CalculateRMSE(const vector<VectorXd> &estimations,
const vector<VectorXd> &ground_truth) {
/**
TODO:
* Calculate the RMSE here.
*/
VectorXd temp(4);
temp << 1, 2, 3, 4;
return temp;
}
MatrixXd Tools::CalculateJacobian(const VectorXd& x_state) {
/**
TODO:
* Calculate a Jacobian here.
*/
MatrixXd temp(3,4);
return temp;
}
Build the project again. Hopefully you should not get any errors.
One minor change to main.cpp for the simulator to connect on windows:
Open main.cpp line #175:
Change From:
if (h.listen(port))
to:
if (h.listen("127.0.0.1", port))
Mark ExtendedKF as the startup project (Right click ExtendedKF in the solution explorer and choose "Set as Startup Project").
Copy Zlib1.dll There is a bug some where and zlib1.dll is not automatically copied to the output folder. So please copy C:\vcpkg\installed\x86-windows\bin\zlib1.dll to CarND-Extended-Kalman-Filter-Project\build\Debug folder
Press F5 (or menu option Debug->Start Debugging)
Download v1.4 from term2_sim_windows
Start simulator and as soon as you click on "Select" button you should see "Connected!!!" on the output window.
Click on start and you should see 1,2,3,4 as the RMSE:
You can put a breakpoint on line # 69 of main.cpp and re-run the program (F5) and re-run the simulator.
The program should stop when it gets data from the simulator and you should be able to inspect values in the debugger local / auto window.
For easier debugging, download eigen.natvis and add that to the solution:
Without eigen.natvis:
With eigen.natvis added to the solution, Dynamic Matrix
With eigen.natvis added to the solution, Fixed Matrix