Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autopilot for player's agent? #100

Open
nrhinehart opened this issue Aug 7, 2018 · 2 comments
Open

Autopilot for player's agent? #100

nrhinehart opened this issue Aug 7, 2018 · 2 comments

Comments

@nrhinehart
Copy link

Is it possible to turn on autopilot for the player's agent? For example, give it a goal in world coordinates, and let GTA use a planner, if available?

@j-gassner
Copy link

You have to replace
if (_drivingMode >= 0) AI::TASK_VEHICLE_DRIVE_WANDER(ped, vehicle, _setSpeed, _drivingMode);
with
if (_drivingMode >= 0)AI::TASK_VEHICLE_DRIVE_TO_COORD(ped, vehicle, dir.x, dir.y, dir.z, _setSpeed, 1.0, vehicleHash, drivingStyle, 1.0, true); in Scenario.cpp.
dir.x, dir.y and dir.z are the coordinates you want to drive to.

@gdpinchina
Copy link

gdpinchina commented Sep 8, 2018

Yes, it is possible. In my repo, I extended the DeepGTAV. You may pickup the world coordinates first, and set up the python client script like this:

	# Creates a new connection to DeepGTAV using the specified ip and port 
	client = Client(ip=args.host, port=args.port, datasetPath=args.dataset_path, compressionLevel=9 , divideByTrip=True) 
	
	dataset = Dataset(rate=20 ,frame=[320,180],  throttle=True, brake=True, steering=True, speed=True, acceleration=True, yaw=True, yawRate=True, isCollide=True, location=True, 
		drivingModeMsg=True)# lidar=[3, True, 100.0, 1000, 60.0, 300.0, 20, 85.0, 115.0], , vehicles=True, peds=True
	# Automatic driving scenario
	scenario = Scenario(weather='EXTRASUNNY',vehicle='blista', time=[12,0], drivingMode=[-2, 3, 25.0, 1.0, 1.0], 
					route=[	\
			-1989.000000, -468.250000, 10.562500, 
			1171.351563, -1925.791748, 36.220097
]) 

The robot will drive for you in the GTAV world along the path you choose.
Have fun!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants