mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-09-14 19:44:05 +08:00
Cleanup simulator and add usage instructions (#1050)
* cleanup simulator files
* minor updates
* update readme
* keras runner builds
* hmm, still doesn't work
* keras runner works
* should work with python3 keras mod
* touchups
old-commit-hash: c50c718293
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
CARLA_*.tar.gz
|
||||
carla
|
||||
carla_tmp
|
||||
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
Needs Ubuntu 16.04
|
||||
|
||||
== 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 python2
|
||||
|
||||
== Install (in tab 1) ==
|
||||
|
||||
cd ~/openpilot/tools/sim
|
||||
./start_carla.sh # install CARLA 0.9.7 and start the server
|
||||
|
||||
== openpilot (in tab 2) ==
|
||||
|
||||
cd ~/openpilot/selfdrive/
|
||||
PASSIVE=0 NOBOARD=1 ./manager.py
|
||||
|
||||
== bridge (in tab 3) ==
|
||||
|
||||
# links carla to openpilot, will "start the car" according to manager
|
||||
cd ~/openpilot/tools/sim
|
||||
./bridge.py
|
||||
|
||||
@@ -7,11 +7,16 @@ import numpy as np
|
||||
import threading
|
||||
import random
|
||||
import cereal.messaging as messaging
|
||||
import argparse
|
||||
from common.params import Params
|
||||
from common.realtime import Ratekeeper
|
||||
from can import can_function, sendcan_function
|
||||
from lib.can import can_function, sendcan_function
|
||||
import queue
|
||||
|
||||
parser = argparse.ArgumentParser(description='Bridge between CARLA and openpilot.')
|
||||
parser.add_argument('--autopilot', action='store_true')
|
||||
args = parser.parse_args()
|
||||
|
||||
pm = messaging.PubMaster(['frame', 'sensorEvents', 'can'])
|
||||
|
||||
W,H = 1164, 874
|
||||
@@ -99,7 +104,9 @@ def go():
|
||||
|
||||
vehicle_bp = random.choice(blueprint_library.filter('vehicle.bmw.*'))
|
||||
vehicle = world.spawn_actor(vehicle_bp, random.choice(world_map.get_spawn_points()))
|
||||
#vehicle.set_autopilot(True)
|
||||
|
||||
if args.autopilot:
|
||||
vehicle.set_autopilot(True)
|
||||
|
||||
blueprint = blueprint_library.find('sensor.camera.rgb')
|
||||
blueprint.set_attribute('image_size_x', str(W))
|
||||
@@ -123,7 +130,6 @@ def go():
|
||||
print("done")
|
||||
atexit.register(destroy)
|
||||
|
||||
|
||||
# can loop
|
||||
sendcan = messaging.sub_sock('sendcan')
|
||||
rk = Ratekeeper(100)
|
||||
@@ -148,6 +154,7 @@ if __name__ == "__main__":
|
||||
from selfdrive.version import terms_version, training_version
|
||||
params.put("HasAcceptedTerms", terms_version)
|
||||
params.put("CompletedTrainingVersion", training_version)
|
||||
params.put("CommunityFeaturesToggle", "1")
|
||||
|
||||
threading.Thread(target=health_function).start()
|
||||
threading.Thread(target=fake_driver_monitoring).start()
|
||||
@@ -1,10 +0,0 @@
|
||||
#!/bin/bash -e
|
||||
FILE=CARLA_0.9.7.tar.gz
|
||||
if [ ! -f $FILE ]; then
|
||||
curl -O http://carla-assets-internal.s3.amazonaws.com/Releases/Linux/$FILE
|
||||
fi
|
||||
mkdir -p carla
|
||||
cd carla
|
||||
tar xvf ../$FILE
|
||||
easy_install PythonAPI/carla/dist/carla-0.9.7-py3.5-linux-x86_64.egg
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
#!/bin/bash
|
||||
cd carla
|
||||
./CarlaUE4.sh
|
||||
|
||||
Executable
+19
@@ -0,0 +1,19 @@
|
||||
#!/bin/bash -e
|
||||
|
||||
FILE=CARLA_0.9.7.tar.gz
|
||||
if [ ! -f $FILE ]; then
|
||||
curl -O http://carla-assets-internal.s3.amazonaws.com/Releases/Linux/$FILE
|
||||
fi
|
||||
if [ ! -d carla ]; then
|
||||
rm -rf carla_tmp
|
||||
mkdir -p carla_tmp
|
||||
cd carla_tmp
|
||||
tar xvf ../$FILE
|
||||
easy_install PythonAPI/carla/dist/carla-0.9.7-py3.5-linux-x86_64.egg
|
||||
cd ../
|
||||
mv carla_tmp carla
|
||||
fi
|
||||
|
||||
cd carla
|
||||
./CarlaUE4.sh
|
||||
|
||||
Reference in New Issue
Block a user