-
Notifications
You must be signed in to change notification settings - Fork 20
Unreal Simulation Setup
- installed git large file storage (https://git-lfs.github.com)
git clone -b 4.21 git@github.com:EpicGames/UnrealEngine.git
cd UnrealEngine
./Setup.sh
./GenerateProjectFiles.sh
make
git clone --recursive git@github.com:VertexStudio/Simbotic.git
Environment variables:
export SIMBOTIC_UE4=/path/to/UE4_21
export SIMBOTIC_ROOT=/path/to/Simbotic
Generate project files and build:
cd $SIMBOTIC_ROOT
./generate.sh
./build_airsim.sh
./build.sh
Run sim:
./run.sh
Important: After launching Simbotic by calling run.sh you have to press play inside the running Unreal editor.
(Option 2) Using AirSim directly (instructions found here from https://microsoft.github.io/AirSim/docs/build_linux/)
Important: If you are using the most recent gpc-unreal branch (as per the clone above), your "using_airlib.mpb" file will be pointing to
Clone AirSim and build it: bash
# go to the folder where you clone GitHub projects
git clone https://github.com/Microsoft/AirSim.git
cd AirSim
./setup.sh
./build.sh
Set your $(AIRSIM_ROOT) to be wherever you installed AirSim.
Once AirSim is set up by following above steps, you can,
- Go to UnrealEngine folder and start Unreal by running UnrealEngine/Engine/Binaries/Linux/UE4Editor. When Unreal Engine prompts for opening or creating project, select Browse and choose 2. AirSim/Unreal/Environments/Blocks (or your custom Unreal project).
- If you get prompts to convert project, look for More Options or Convert-In-Place option. If you get prompted to build, chose Yes. If you get prompted to disable AirSim plugin, choose No.
- After Unreal Editor loads, press Play button. Tip: go to 'Edit->Editor Preferences', in the 'Search' box type 'CPU' and ensure that the 'Use Less CPU when in Background' is unchecked.
git clone -b gpc-unreal git@github.com:jredmondson/gams.git
export UNREAL_ROOT=/path/to/unreal
export SIMBOTIC_ROOT=/path/to/Simbotic
export SIMBOTIC_UE4=/path/to/unreal
./scripts/linux/base_build.sh madara gams airlib clang
Important: Add the environment variables which are printed by the base_build script to your .bashrc or activation script.
Launch Simbotic and press play inside the Unreal Editor.
$GAMS_ROOT/scripts/simulation/waypoints/waypoints.pl
If you are using Option 1 (AirSim directly) you may wish to try other demos out. These are all experimental at the moment and are currently pending bug fixes and on-going development. However, you may:
- Modify your ~/Documents/AirSim/settings.json file to add more or remove agents. The file looks like this:
{
"SettingsVersion": 1.2,
"SimMode": "Multirotor",
"Vehicles":
{
"agent.0":
{
"VehicleType": "SimpleFlight",
"X": 0,
"Y": 0,
"Z": -2,
"Yaw": -180
}
}
}
Adding more statements of agents with the vehicle name following the pattern of agent.XX (agent.1,... agent.2 etc) will tell AirSim to load in more agents with that vehicle name. These vehicle names are important as that is what the AirLib compiled GAMS controller will use to associate what commands to the respective robot over AirLib's RPC API.
- Modify the MADARA files (*.mf) inside of $GAMS_ROOT/scripts/simulation/
After adding more agents to the above .json, we must now configure the simulation files to reflect that there are more agents. In this example, we will add more agents to the waypoints.pl scripts.
2.1 Adding more agents to waypoints.pl