Skip to content

GTASim is an open-source simulator for drones, planes, cars, boats, and various other vehicles based on GTA V

License

Notifications You must be signed in to change notification settings

BabakAkbari/GTASim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GTASim

GTASim is an open source simulator based on GTA V for drones, planes, cars, boats and various other vehicles integrated with ArduPilot, a popular full-featured and reliable open source autopilot software.

alt text

How to use it

Installing FiveM client

GTASim is built on a customized dedicated FiveM server. You need to install FiveM client to connect to the server. Follow the instructions in the link to install FiveM Client.

  • Make sure you have installed and updated GTA V.
  • Download FiveM off the website.
  • Run FiveM.exe. If you run the installer in an empty folder, FiveM will install there. Otherwise, it will install in %localappdata%\FiveM.

Setting up a server

Follow the instructions in the link to set up your FXServer. You can install FXServer on both Windows and Linux. Throughout this instruction, we assume that we are using Windows to run the server.

After you set up the server, you need to clone GTASim in your resources under the path FXServer\server-data\resources\[local] and run the server.


cd FXServer\server-data\resources\[local]
git clone https://github.com/BabakAkbari/GTASim.git
cd FXServer\server-data
FXServer\server\FXServer.exe +exec server.cfg

Connecting to the Server

Run FiveM.exe, click on the localhost button in the developer mode to connect to the server or simply press F8. This will open up your client console then type connect loalhost:30120 to connect to your server. After the game is loaded, go back to your server console and execute start GTASim to run GTASim scripts. For more information, visit Scripting manual

Using GTASim with ArduPilot

Follow the instructions in the link to set up SITL. Currently suport for copter has been developed in GTASim. The JSON SITL backend allows GTASim to easily interface with ArduPilot using a standard JSON interface. Execute the following commands to launch SITL using JSON backend. This will open up MAVProxy's command line.

cd ardupilot
sim_vehicle.py -v ArduCopter --console --map -f json:127.0.0.1

where 127.0.0.1 is replaced with the IP GTASim is running at. Go back to the game press t and type /drone in the text field. This will spawn a drone next to the PED on the ground in First-Person View. In order to switch between cameras press t and type /cam in the text field. Go back to MAVProxy's command line and type arm throttle to arm the motors and then type rc 3 1800 to lift the drone up. For more infomation, visit Using SITL.

Using Lidar

Press F8 to open the client console. Use con_miniconChannels * command to display console messages on screen without needing to open the client console. Once you get into the game, press t and type /rover raiden to spawn a car. press f to get in the car. you must be able to see the measured distance on the bottom left corner. ( A list of available vehicle models is documented in List .)

Contributing Code

If you want to conbtribute to the code, go through the FiveM Documentaion. You can also find some useful information on how to get started scripting in the link Creating your first script in Lua. Also a full list of native functions is available on FiveM Natives.

About

GTASim is an open-source simulator for drones, planes, cars, boats, and various other vehicles based on GTA V

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published