Any scripts for documentation related to running simulations such as colosseum, airsim, gazebo, PX4 SITL/HITL
- Colosseum is very lacking in official documentation but thankfully the setup process is pretty straight forward and even easier than the original AirSim
- You must run Colosseum/PX4/QGC on Ubuntu 20.04 LTS, other versions and OSes won't work quite as well.
- You can get 20.04 here https://releases.ubuntu.com/focal/
- Write it to a USB and boot from it and run through the install process.
- You can run it in a virtual machine if you know how to get GPU passthrough to work.
- Unreal Engine 5 requires you to have VSCode in order to open Colosseum files.
- Head to the https://code.visualstudio.com/Download page and download the "deb" installer
- Double click the .deb file once it is downloaded and be patient as it opens the installer software.
- Click install and enter your password.
- Alternatively you can use the command line
sudo dpkg -i name_of_file.deb
- In many cases you won't start out with the correct graphics drivers.
- To know if you have the right drivers open a terminal and type
nvidia-smi- Output should be similar to Appendix A 1
- Most notably you will see the correct version of nvidia driver and cuda displayed and the model of your GP
- If you do not have the drivers here is how you can install them
sudo apt install nvidia-driver-535-open- This driver is the best currently and should work for most modern nvidia GPUs
- If you run into any issues consider installing again but omit the
-openat the end.
- reboot and confirm that the install worked by running
nvidia-smiagain.
- Thanks to leaps of improvements the process to install UE5 on linux is far easier than it was for UE4
- You will need exactly version 5.2.1 of Unreal Engine 5
- Go to https://www.unrealengine.com/en-US/linux
- Login with an Epic Games account or make one.
- You will need to browse older versions of UE5 using
show earlier releases - Look for version 5.2.1 and download it (make sure it's unreal engine and not the "bridge" think.
- It's a large file so wait some time for it to download.
- Extract the folder into a directory you wish to store UE5
- Test it out by running the file at
Linux_Unreal_Engine_5.2.1/Engine/Binaries/Linux/UnrealEditor- It is recommended to create a symlink to this file on your desktop so its easy to launch it.
ln -s /home/myusername/Desktop/UnrealEditor /path/to/UnrealEditor
- It is recommended to create a symlink to this file on your desktop so its easy to launch it.
- It may take some time to initialize and get ready. Be sure to fully test by creating a basic project.
- You will also want to disable limiting FPS in the background as it will cause airsim to lag when you switch to other windows which is often the case.
- Edit >> Editor Preferences >> Performance >> Uncheck "Limit FPS In Background"
- You're done!
- Installing Colosseum is fairly straight forward and automated.
- Create a folder somewhere you'd like to store AirSim and compile it.
- clone the repo into the folder
git clone https://github.com/CodexLabsLLC/Colosseum.git - cd Into
Colosseum - run
./setup.sh - May take some time to run
- now once that is done run
./build.sh - May also take some time
- When that is finished you will have a folder in the main folder
Unreal/Environments/Blocks - This is the folder where the UE5 project is stored keep that in mind.
- Test out airsim now
- Launch UnrealEditor
- Use the file selector to browse for project files and look for the Blocks.uproject file we mentioned.
- You will be asked if you want to convert the project in place or work on a copy.
- Select convert-in-place
- UnrealEngine5 might disappear for a minute or two don't worry this is normal it will be right back.
- Once the project is loaded you can click play and then click "No" if asked if you want to use the car sim.
- Should start processing shaders and loading the default drone.
- In the future you can launch this by just opening UnrealEditor and select it in the previously open projects.
- Create a folder where you would like to compile and run PX4 in SITL mode
- cd into the folder
- Retrieve the source code for PX4.
- In the folder you are working in
git clone https://github.com/PX4/PX4-Autopilot.git --recursive- Make sure you add that
--recursiveflag.- This ensures that all the code that PX4 depends on is also cloned.
- (optional but recommended) Switch to a stable release
- Start over from step 3.1 but this time don't clone recursively.
git clone https://github.com/PX4/PX4-Autopilot.gitcd PX4-Autopilot- Go to the releases page and identify the latest stable version number https://github.com/PX4/PX4-Autopilot/releases
- As of writing this it is
v1.14.0
- As of writing this it is
git checkout v1.14.0- Update submodules
make submodulesclean
- In the folder you are working in
- Run the script to install all dependencies
bash ./PX4-Autopilot/Tools/setup/ubuntu.sh- This step can have issues. Pay close attention to the output and identify any issues that arise and be sure to resolve them manually before proceeding.
- The reason this happens is because we are running on 20.04 an older version of ubuntu.
- Some issues can be ignored. I'll list any that I find and fix or ignore in Appendix A 2
- Build PX4 in SITL mode
make px4_sitl none_iris- This will take some time on first run but from now on this is how you launch PX4 SITL
- Consider writing a script to automatically do this conveniently
- Common issue
AttributeError: module 'em' has no attribute 'Interpreter'- This happened from a recent update. To fix it simply
pip uninstall empip install empy==3.3.4
- You can use almost any version of QGC with any version of PX4
- Weird prerequisite install
libxcb-cursor0sudo apt install libxcb-cursor0
- Download the QGroundControl daily AppImage
- https://docs.qgroundcontrol.com/master/en/qgc-user-guide/releases/daily_builds.html
- Select the Linux build and you will get a .AppImage file
- Make the AppImage executable
- Method 1 from the GUI
- Right click the file and click Properties
- Go to Permissions tab and select "Allow executing file as a program"
- Method 2 command line
chmod +x QGroundControlFileName.AppImage
- Method 1 from the GUI
- Run the AppImage file
- Method 1 from gui
- Right click and click Run or double click
- Method 2 command line
./QGroundControlFileName.Appimage
- Method 1 from gui
- You will be able to test it once we get everything else configured but it should launch just fine.
- Colosseum needs to be configured to work with PX4
- Edit your AirSim configuration file (Yeah its still called AirSim)
- It is located in
/home/myusername/Documents/AirSim/settings.json - Use the basic configuration in Appendix A 3 and paste it in the file overwriting existing settings.
- It is located in
- For more about how this settings file works see https://microsoft.github.io/AirSim/settings/
- Launch PX4
make px4_sitl none_iris
- Launch Colosseum
- ./UnrealEditor
- Once loaded press play
- PX4 should detect the simulator and show feedback that it is ready
- Launch QGroundControl
- It should auto connect to PX4
- Now you can give commands to PX4 in simulation from QGroundControl and you can also write software to interact with PX4
- Have lots of fun!
animallocator@colosseum-1:~/Documents/src/Colosseum/Colosseum/Unreal/Environments/Blocks$ nvidia-smi
Sat Mar 2 09:41:12 2024
+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 535.161.07 Driver Version: 535.161.07 CUDA Version: 12.2 |
|-----------------------------------------+----------------------+----------------------+
| GPU Name Persistence-M | Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap | Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|=========================================+======================+======================|
| 0 NVIDIA GeForce GTX 1080 Off | 00000000:00:10.0 On | N/A |
| 0% 50C P5 14W / 180W | 1390MiB / 8192MiB | 2% Default |
| | | N/A |
+-----------------------------------------+----------------------+----------------------+
+---------------------------------------------------------------------------------------+
| Processes: |
| GPU GI CI PID Type Process name GPU Memory |
| ID ID Usage |
|=======================================================================================|
| 0 N/A N/A 945 G /usr/lib/xorg/Xorg 150MiB |
| 0 N/A N/A 1237 G /usr/bin/gnome-shell 45MiB |
| 0 N/A N/A 2609 G /usr/lib/firefox/firefox 145MiB |
| 0 N/A N/A 32644 C+G .../Engine/Binaries/Linux/UnrealEditor 1009MiB |
| 0 N/A N/A 33691 G ...sion,SpareRendererForSitePerProcess 31MiB |
+---------------------------------------------------------------------------------------+- Pandas incompatible library error
- Can be safely ignored it seems.
- Warnings
- All warnings can likely be safely ignored they are just warnings after all.
AttributeError: module 'em' has no attribute 'Interpreter'- This happened from a recent update. To fix it simply
pip uninstall empip install empy==3.3.4
- This happened from a recent update. To fix it simply
{
"SettingsVersion": 1.2,
"SimMode": "Multirotor",
"ClockType": "SteppableClock",
"Vehicles": {
"PX4": {
"VehicleType": "PX4Multirotor",
"UseSerial": false,
"LockStep": true,
"UseTcp": true,
"TcpPort": 4560,
"ControlPortLocal": 14550,
"ControlPortRemote": 14580,
"Sensors":{
"Barometer":{
"SensorType": 1,
"Enabled": true,
"PressureFactorSigma": 0.0001825
}
},
"Parameters": {
"NAV_RCL_ACT": 0,
"NAV_DLL_ACT": 0,
"COM_OBL_ACT": 1,
"LPE_LAT": 47.641468,
"LPE_LON": -122.140165
}
}
}
}x11vnc -listen 0.0.0.0 -loop -forever -bg -rfbport 5901 -xkb -noxrecord -noxfixes -noxdamage -shared -norc[Unit]
Description=Start x11vnc at startup.
After=multi-user.target
[Service]
Type=simple
ExecStart=/usr/bin/x11vnc -listen 0.0.0.0 -loop -forever -bg -rfbport 5900 -xkb -noxrecord -noxfixes -noxdamage -shared -norc -auth /run/user/121/gdm/Xauthority
[Install]
WantedBy=multi-user.target