From a32fe80d392027290bdf3be35269dcc42d9cd5fe Mon Sep 17 00:00:00 2001 From: littlemountainman Date: Sun, 1 Mar 2020 19:50:03 +0100 Subject: [PATCH] Make Nui tests work. Framereader moved to tools/clib (#1185) * add more deps * setup is now working,removing brackets * Fixing tests in nui * make it eveno * readme markdown and town not needed since set via client * adding explanations for sim in readme * make it markdown buildable * revert changes in setup * work now --- tools/nui/test/TestFrameReader.cpp | 2 +- tools/nui/test/test.pro | 4 ++-- tools/sim/{README => README.md} | 36 +++++++++++++++++++++--------- tools/sim/lib/replay.sh | 2 +- tools/sim/start_carla.sh | 3 +-- tools/ubuntu_setup.sh | 1 - 6 files changed, 31 insertions(+), 17 deletions(-) rename tools/sim/{README => README.md} (61%) diff --git a/tools/nui/test/TestFrameReader.cpp b/tools/nui/test/TestFrameReader.cpp index 944dbd4416..55327ac312 100644 --- a/tools/nui/test/TestFrameReader.cpp +++ b/tools/nui/test/TestFrameReader.cpp @@ -1,4 +1,4 @@ -#include "FrameReader.hpp" +#include "../../clib/FrameReader.hpp" #include "TestFrameReader.hpp" void TestFrameReader::frameread() { diff --git a/tools/nui/test/test.pro b/tools/nui/test/test.pro index baf95826b5..2e345f66d4 100644 --- a/tools/nui/test/test.pro +++ b/tools/nui/test/test.pro @@ -8,8 +8,8 @@ TARGET = test INCLUDEPATH += . ../ # Input -SOURCES += TestFrameReader.cpp ../FrameReader.cpp -HEADERS = TestFrameReader.hpp ../FrameReader.hpp +SOURCES += TestFrameReader.cpp ../../clib/FrameReader.cpp +HEADERS = TestFrameReader.hpp ../../clib/FrameReader.hpp CONFIG += c++14 diff --git a/tools/sim/README b/tools/sim/README.md similarity index 61% rename from tools/sim/README rename to tools/sim/README.md index c924453685..969a38cb8c 100644 --- a/tools/sim/README +++ b/tools/sim/README.md @@ -1,24 +1,40 @@ +Openpiltot Simulator +===================== Needs Ubuntu 16.04 -== Checkout openpilot == +## Checkout openpilot +``` cd ~/ git clone https://github.com/commaai/openpilot.git + # Add export PYTHONPATH=$HOME/openpilot to your bashrc # Have a working tensorflow+keras in python3.7.3 (with [packages] in openpilot/Pipfile) - -== Install (in tab 1) == - +``` +## Install (in tab 1) +``` cd ~/openpilot/tools/sim ./start_carla.sh # install CARLA 0.9.7 and start the server - -== openpilot (in tab 2) == - +``` +## openpilot (in tab 2) +``` cd ~/openpilot/selfdrive/ PASSIVE=0 NOBOARD=1 ./manager.py - -== bridge (in tab 3) == - +``` +## bridge (in tab 3) +``` # links carla to openpilot, will "start the car" according to manager cd ~/openpilot/tools/sim ./bridge.py +``` +## Controls +Now you can control the simulator with the keys: + +1: Cruise up 5 mp/h + +2: Cruise down 5 mp/h + +3: Cruise cancel + +q: Exit all + diff --git a/tools/sim/lib/replay.sh b/tools/sim/lib/replay.sh index 351d76c9ec..38c2140096 100755 --- a/tools/sim/lib/replay.sh +++ b/tools/sim/lib/replay.sh @@ -1,5 +1,5 @@ #!/bin/bash -cd ~/one/tools/nui +cd ~/openpilot/tools/nui # vision, boardd, sensorsd, gpsd ALLOW=frame,can,ubloxRaw,health,sensorEvents,gpsNMEA,gpsLocation ./nui "02ec6bea180a4d36/2019-10-25--10-18-09" diff --git a/tools/sim/start_carla.sh b/tools/sim/start_carla.sh index fd5034b039..42c956c2f7 100755 --- a/tools/sim/start_carla.sh +++ b/tools/sim/start_carla.sh @@ -15,5 +15,4 @@ if [ ! -d carla ]; then fi cd carla -./CarlaUE4.sh Town04 - +./CarlaUE4.sh diff --git a/tools/ubuntu_setup.sh b/tools/ubuntu_setup.sh index 14278a8b0b..4a2f6a1d0b 100755 --- a/tools/ubuntu_setup.sh +++ b/tools/ubuntu_setup.sh @@ -94,4 +94,3 @@ pip install tensorflow-gpu==2.0 # TODO: PC should log somewhere else #sudo mkdir -p /data/media/0/realdata #sudo chown $USER /data/media/0/realdata -