Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion dataset
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ from deepgtav.client import Client
import argparse
import time
import cv2
import pandas as pd
import random

# Stores a dataset file with data coming from DeepGTAV
if __name__ == '__main__':
Expand All @@ -16,6 +18,15 @@ if __name__ == '__main__':
parser.add_argument('-d', '--dataset_path', default='dataset.pz', help='Place to store the dataset')
args = parser.parse_args()

# Get a random start location
df = pd.read_csv("gtav.rand.locations.csv", header=None)
randIdx = random.randint(0,349)
startLocation = [0,0,0]
startLocation = df.iloc[randIdx].tolist()

# If you want a specific location specify it here:
# startLocation = [0,0,0]

# Creates a new connection to DeepGTAV using the specified ip and port.
# If desired, a dataset path and compression level can be set to store in memory all the data received in a gziped pickle file.
client = Client(ip=args.host, port=args.port, datasetPath=args.dataset_path, compressionLevel=9)
Expand All @@ -24,7 +35,7 @@ if __name__ == '__main__':
# See deepgtav/messages.py to see what options are supported
dataset = Dataset(rate=30, frame=[320,160], throttle=True, brake=True, steering=True, vehicles=True, peds=True, reward=[15.0, 0.0], direction=None, speed=True, yawRate=True, location=True, time=True)
# Send the Start request to DeepGTAV.
scenario = Scenario(drivingMode=[786603,15.0]) # Driving style is set to normal, with a speed of 15.0 mph. All other scenario options are random.
scenario = Scenario(location=startLocation, drivingMode=[786603,15.0]) # Driving style is set to normal, with a speed of 15.0 mph. All other scenario options are random.
client.sendMessage(Start(dataset=dataset,scenario=scenario))

# Start listening for messages coming from DeepGTAV. We do it for 80 hours
Expand Down