ThunderFly-aerospace / PX4-FlightGear-Bridge

FlightGear simulator to PX4 software stack connector
BSD 3-Clause "New" or "Revised" License
34 stars 42 forks source link

Ubuntu 18.04 VmWare flightgear SITL failure #23

Closed yusuf-5896 closed 4 years ago

yusuf-5896 commented 4 years ago

On Ubuntu 18.04, on a fresh system on virtual machine, flight gear SITL fails with the following error: When running, a black screen turns on and off, but running fgfs separately runs fine

make px4_sitl_nolockstep flightgear_rascal [0/4] Performing build step for 'flightgear_bridge' ninja: no work to do. [3/4] cd /home/yusuf/src/Firmware/build/px4_sitl_nolockstep/tmp && /home/yusuf/src/Fi...scal none /home/yusuf/src/Firmware /home/yusuf/src/Firmware/build/px4_sitl_nolockstep SITL ARGS sitl_bin: /home/yusuf/src/Firmware/build/px4_sitl_nolockstep/bin/px4 debugger: none program: flightgear model: rascal world: none src_path: /home/yusuf/src/Firmware build_path: /home/yusuf/src/Firmware/build/px4_sitl_nolockstep FG setup 0.07 [INFO]:gui UI languages: ("en-US") 0.07 [INFO]:gui Loaded translations for locale "en_US" 0.07 [INFO]:general FlightGear: Version 2020.1.1 0.07 [INFO]:general FlightGear: Build Type Dev 0.07 [INFO]:general Built with GNU C++ version 7.5 0.07 [INFO]:general Jenkins number/ID 0:none 0.07 [INFO]:general platform default fg_root = Path "/usr/share/games/flightgear" 0.08 [INFO]:input Reading user settings from Path "/home/yusuf/.fgfs/autosave_2020_1.xml" 0.08 [INFO]:general init package root at:Path "/home/yusuf/.fgfs/Aircraft" 0.08 [INFO]:input No user specified aircraft, using default 0.08 [INFO]:general Loading aircraft -set file from:Path "/usr/share/games/flightgear/Aircraft/c172p/c172p-set.xml" 0.10 [INFO]:general Found language resource for: en_US 0.10 [INFO]:general Reading localized strings for 'en' from Path "/usr/share/games/flightgear/Translations/default/sys.xml" 0.10 [INFO]:general Reading localized strings for 'en' from Path "/usr/share/games/flightgear/Translations/default/atc.xml" 0.10 [INFO]:general Reading localized strings for 'en' from Path "/usr/share/games/flightgear/Translations/default/tips.xml" 0.10 [INFO]:general option:version = 0.10 [INFO]:general Using default download dir: Path "/home/yusuf/.fgfs" 0.10 [INFO]:general Using default texture cache directory: Path "/home/yusuf/.fgfs/TextureCache" 0.10 [INFO]:general Using TerraSync dir: Path "/home/yusuf/.fgfs/TerraSync" 0.12 [INFO]:io Saving user settings to Path "/home/yusuf/.fgfs/autosave_2020_1.xml" 0.12 [WARN]:general SGSubsystemMgr::remove: not found: scenery None Rascal110-YASim https://github.com/ThunderFly-aerospace/FlightGear-Rascal/archive/master.zip 5 /controls/flight/aileron -1 7 /controls/flight/elevator -1 2 /controls/flight/rudder 1 4 /controls/engines/engine/throttle 1 fgfs --aircraft=Rascal110-YASim --fg-aircraft=./models --enable-terrasync --timeofday=noon --disable-sound --telnet=15400 --generic=socket,out,100,127.0.0.1,15200,udp,FGtoPX4 --generic=socket,in,100,,15300,udp,PX4toFG --model-hz=120 --disable-random-objects --prop:/sim/rendering/texture-compression=off --prop:/sim/rendering/quality-level=0 --prop:/sim/rendering/shaders/quality-level=0 --disable-ai-traffic --prop:/sim/ai/enabled=0 --prop:/sim/rendering/random-vegetation=0 --prop:/sim/rendering/random-buildings=0 --disable-specular-highlight --disable-ai-models --disable-clouds --disable-clouds3d --fog-fastest --visibility=2000 --disable-distance-attenuation --disable-real-weather-fetch --prop:/sim/rendering/particles=0 --prop:/sim/rendering/multi-sample-buffers=1 --prop:/sim/rendering/multi-samples=2 --prop:/sim/rendering/draw-mask/clouds=false --prop:/sim/rendering/draw-mask/aircraft=true --prop:/sim/rendering/draw-mask/models=true --prop:/sim/rendering/draw-mask/terrain=true --disable-random-vegetation --disable-random-buildings --disable-rembrandt --disable-horizon-effect & echo $! > /tmp/px4fgfspid_0 SITL COMMAND: "/home/yusuf/src/Firmware/build/px4_sitl_nolockstep/bin/px4" "/home/yusuf/src/Firmware"/ROMFS/px4fmu_common -s etc/init.d-posix/rcS -t "/home/yusuf/src/Firmware"/test_data INFO [px4] Creating symlink /home/yusuf/src/Firmware/ROMFS/px4fmu_common -> /home/yusuf/src/Firmware/build/px4_sitl_nolockstep/tmp/rootfs/etc


| \ \ \ / / / | | |/ / \ V / / /| | | / / \ / /_| | | | / /^\ \ __ | _| \/ \/ |/

px4 starting.

INFO [px4] Calling startup script: /bin/sh etc/init.d-posix/rcS 0 I'm Mavlink to FlightGear Bridge Targed Bridge Freq: 200, send data every step: 1 4 5 -1 7 -1 2 1 4 1 INFO [param] selected parameter default file eeprom/parameters_1033 [param] Loaded: eeprom/parameters_1033 INFO [dataman] Unknown restart, data manager file './dataman' size is 11798680 bytes INFO [simulator] Waiting for simulator to accept connection on TCP port 4560 INFO [simulator] Simulator connected on TCP port 4560. INFO [commander] LED: open /dev/led0 failed (22) 0.06 [INFO]:gui UI languages: ("en-US") 0.06 [INFO]:gui Loaded translations for locale "en_US" 0.06 [INFO]:general FlightGear: Version 2020.1.1 0.06 [INFO]:general FlightGear: Build Type Dev 0.06 [INFO]:general Built with GNU C++ version 7.5 0.06 [INFO]:general Jenkins number/ID 0:none 0.06 [INFO]:general platform default fg_root = Path "/usr/share/games/flightgear" 0.07 [INFO]:input Reading user settings from Path "/home/yusuf/.fgfs/autosave_2020_1.xml" 0.07 [INFO]:general init package root at:Path "/home/yusuf/.fgfs/Aircraft" 0.07 [INFO]:input aircraft = Rascal110-YASim 0.07 [INFO]:general Loading aircraft -set file from:Path "/home/yusuf/src/Firmware/Tools/flightgear_bridge/models/Rascal/Rascal110-YASim-set.xml" 0.07 [INFO]:general Found language resource for: en_US 0.07 [INFO]:general Reading localized strings for 'en' from Path "/usr/share/games/flightgear/Translations/default/sys.xml" 0.07 [INFO]:general Reading localized strings for 'en' from Path "/usr/share/games/flightgear/Translations/default/atc.xml" 0.07 [INFO]:general Reading localized strings for 'en' from Path "/usr/share/games/flightgear/Translations/default/tips.xml" 0.07 [INFO]:general option:aircraft = Rascal110-YASim 0.07 [INFO]:general option:fg-aircraft = ./models 0.07 [INFO]:general option:enable-terrasync = 0.07 [INFO]:general option:timeofday = noon 0.07 [INFO]:general option:disable-sound = 0.07 [INFO]:general Channel string = 15400 0.07 [INFO]:general option:telnet = 15400 0.07 [INFO]:general Channel string = socket,out,100,127.0.0.1,15200,udp,FGtoPX4 0.07 [INFO]:general option:generic = socket,out,100,127.0.0.1,15200,udp,FGtoPX4 0.07 [INFO]:general Channel string = socket,in,100,,15300,udp,PX4toFG 0.07 [INFO]:general option:generic = socket,in,100,,15300,udp,PX4toFG 0.07 [INFO]:general option:model-hz = 120 0.07 [INFO]:general option:disable-random-objects = 0.07 [INFO]:general option:prop = /sim/rendering/texture-compression=off 0.07 [INFO]:general option:prop = /sim/rendering/quality-level=0 0.07 [INFO]:general option:prop = /sim/rendering/shaders/quality-level=0 0.07 [INFO]:general option:disable-ai-traffic = 0.07 [INFO]:general option:prop = /sim/ai/enabled=0 0.07 [INFO]:general option:prop = /sim/rendering/random-vegetation=0 0.07 [INFO]:general option:prop = /sim/rendering/random-buildings=0 0.07 [INFO]:general option:disable-specular-highlight = 0.07 [INFO]:general option:disable-ai-models = 0.07 [INFO]:general option:disable-clouds = 0.07 [INFO]:general option:disable-clouds3d = 0.07 [INFO]:general option:fog-fastest = 0.07 [INFO]:general option:visibility = 2000 0.07 [INFO]:general option:disable-distance-attenuation = 0.07 [INFO]:general option:disable-real-weather-fetch = 0.07 [INFO]:general option:prop = /sim/rendering/particles=0 0.07 [INFO]:general option:prop = /sim/rendering/multi-sample-buffers=1 0.07 [INFO]:general option:prop = /sim/rendering/multi-samples=2 0.07 [INFO]:general option:prop = /sim/rendering/draw-mask/clouds=false 0.07 [INFO]:general option:prop = /sim/rendering/draw-mask/aircraft=true 0.07 [INFO]:general option:prop = /sim/rendering/draw-mask/models=true 0.07 [INFO]:general option:prop = /sim/rendering/draw-mask/terrain=true 0.07 [INFO]:general option:disable-random-vegetation = 0.07 [INFO]:general option:disable-random-buildings = 0.07 [INFO]:general option:disable-rembrandt = 0.07 [INFO]:general option:disable-horizon-effect = 0.07 [INFO]:general Using default download dir: Path "/home/yusuf/.fgfs" 0.07 [INFO]:general Using default texture cache directory: Path "/home/yusuf/.fgfs/TextureCache" 0.07 [INFO]:general Using TerraSync dir: Path "/home/yusuf/.fgfs/TerraSync" 0.07 [INFO]:general EmbeddedResourceManager: selected locale 'en_US' 0.07 [INFO]:opengl Using stock OSG implementation of GraphicsWindow StatsHandler::StatsHandler() Setting up GL2 compatible shaders 0.07 [INFO]:astro initializing cloud layers Now checking for plug-in osgPlugins-3.4.1/osgdb_nvtt.so INFO [init] Mixer: etc/mixers-sitl/plane_sitl.main.mix on /dev/pwm_output0 INFO [mavlink] mode: Normal, data rate: 4000000 B/s on udp port 18570 remote port 14550 INFO [airspeed_selector] No airspeed sensor detected. Switch to non-airspeed mode. 0.11 [INFO]:OSG Error: Not able to create requested visual. 0.11 [ALRT]:view getDefaultWindow: failed to create GraphicsContext 0.12 [INFO]:OSG Error: Not able to create requested visual. 0.12 [ALRT]:view getDefaultWindow: failed to create GraphicsContext 0.12 [WARN]:view CameraGroup::buildGUICamera: failed to build a window 0.12 [WARN]:general Enabling ATI/AMD viewport hack 0.12 [INFO]:general Configuration State 0.12 [INFO]:general ============= ===== 0.12 [INFO]:general aircraft-dir = "/home/yusuf/src/Firmware/Tools/flightgear_bridge/models/Rascal" 0.12 [INFO]:general fghome-dir = "Path "/home/yusuf/.fgfs"" 0.12 [INFO]:general download-dir = "/home/yusuf/.fgfs" 0.12 [INFO]:general terrasync-dir = "/home/yusuf/.fgfs/TerraSync" 0.12 [INFO]:general aircraft-search-paths = /home/yusuf/src/Firmware/Tools/flightgear_bridge/models 0.12 [INFO]:general scenery-search-paths = /home/yusuf/.fgfs/TerraSync /usr/share/games/flightgear/Scenery INFO [mavlink] mode: Onboard, data rate: 4000000 B/s on udp port 14580 remote port 14540 INFO [mavlink] mode: Onboard, data rate: 4000 B/s on udp port 14280 remote port 14030 INFO [logger] logger started (mode=all) INFO [logger] Start file log (type: full) INFO [logger] [logger] ./log/2020-07-03/20_10_50.ulg INFO [logger] Opened full log file: ./log/2020-07-03/20_10_50.ulg INFO [mavlink] MAVLink only on localhost (set param MAV_BROADCAST = 1 to enable network) INFO [px4] Startup script returned successfully pxh> PX4 Communicator: PX4 Connected.

slimonslimon commented 4 years ago

Maybe I'm blind, but I do not see any error message.... so I will try point you what can you test:

in the file: https://github.com/ThunderFly-aerospace/PX4-FlightGear-Bridge/blob/master/FG_run.py there are lots of lines (106-133). which reduces FG graphic quality. We expected, that they improve performance (FPS). You can simply try to comment some of them out (or all) by # at beginning of the line.

Exactly only these lines are obligatory: "--aircraft=" + model, "--fg-aircraft=" + fgmodelsdir, "--generic=socket,out,100,127.0.0.1,"+str(15200+px4id)+",udp,FGtoPX4", "--generic=socket,in,100,,"+str(15300+px4id)+",udp,PX4toFG",

Then I think that following set is usefull: "--enable-terrasync", "--timeofday=noon", "--disable-sound", "--telnet="+str(15400+px4id),

You can try tune graphic quality parameters. Let us know If you success. (Last but not least - if you starting FG separatly, you can either start it from comand line or from FGLauncher. You can try to find out somehow, what parameters FGLouncher use)