FlightGear SITL can't run

Hi everyone!
I am using a virtual machine running ubuntu-20.04 environment, hosted on a Windows 10 system.
I want to run a simulation before starting my real flight.
So I followed the PX4 Installation to install the FlightGear Simulation (Ubuntu Linux).
I use “fgfs --launcher” to check the installation. FlightGear lanched successfully.

But, when i use “make px4_sitl_nolockstep flightgear_rascal” to lanch FlightGear, it failed.
The message box shows that “FlightGear was unable to create a window supporting 3D rendering(OpenGL)”.

I checked Graphic card and the driver. It is “VMware:SVGA II Adapter”, and the driver is “Open VMWare Tools for virtual machines hosted on VMware(GUI)” from open-vm-tools-desktop.

The console output as follow.

hooper@ubuntu:~/px4/Firmware$ make px4_sitl_nolockstep flightgear_rascal
[0/4] Performing build step for 'flightgear_bridge'
ninja: no work to do.
[3/4] cd /home/hooper/px4/Firmware/build/px4_sitl_nolockstep/tmp && /home/hooper/px4/Firmware/Tools/...flightgear rascal none /home/hooper/px4/Firmware /home/hooper/px4/Firmware/build/px4_sitl_nolockstep
SITL ARGS
sitl_bin: /home/hooper/px4/Firmware/build/px4_sitl_nolockstep/bin/px4
debugger: none
program: flightgear
model: rascal
world: none
src_path: /home/hooper/px4/Firmware
build_path: /home/hooper/px4/Firmware/build/px4_sitl_nolockstep
FG setup
    1.14 [WARN]:gui        UI languages: ("zh-CN", "en")
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/hooper/px4/Firmware/build/px4_sitl_nolockstep/bin/px4" "/home/hooper/px4/Firmware/build/px4_sitl_nolockstep"/etc -s etc/init.d-posix/rcS -t "/home/hooper/px4/Firmware"/test_data
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  [px4] Creating symlink /home/hooper/px4/Firmware/build/px4_sitl_nolockstep/etc -> /home/hooper/px4/Firmware/build/px4_sitl_nolockstep/tmp/rootfs/etc
    0.05 [WARN]:gui        UI languages: ("zh-CN", "en")
    
______  __   __    ___ 
| ___ \ \ \ / /   /   |
| |_/ /  \ V /   / /| |
|  __/   /   \  / /_| |
| |     / /^\ \ \___  |
\_|     \/   \/     |_/

px4 starting.

INFO  [px4] Calling startup script: /bin/sh etc/init.d-posix/rcS 0
Info: found model autostart file as SYS_AUTOSTART=1033
Now checking for plug-in osgPlugins-3.6.4/osgdb_nvtt.so
INFO  [param] selected parameter default file eeprom/parameters_1033
INFO  [parameters] BSON document size 437 bytes, decoded 437 bytes
[param] Loaded: eeprom/parameters_1033
INFO  [dataman] Unknown restart, data manager file './dataman' size is 11798680 bytes
PX4 SIM HOST: localhost
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)
INFO  [init] Mixer: etc/mixers-sitl/plane_sitl.main.mix on /dev/pwm_output0
INFO  [airspeed_selector] No airspeed sensor detected. Switch to non-airspeed mode.
INFO  [airspeed_selector] Airspeed estimation invalid
INFO  [mavlink] mode: Normal, data rate: 4000000 B/s on udp port 18570 remote port 14550
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  [mavlink] mode: Gimbal, data rate: 400000 B/s on udp port 13030 remote port 13280
INFO  [logger] logger started (mode=all)
INFO  [logger] Start file log (type: full)
INFO  [logger] [logger] ./log/2021-07-10/13_29_53.ulg
INFO  [mavlink] MAVLink only on localhost (set param MAV_{i}_BROADCAST = 1 to enable network)
INFO  [mavlink] MAVLink only on localhost (set param MAV_{i}_BROADCAST = 1 to enable network)
INFO  [px4] Startup script returned successfully
pxh> INFO  [logger] Opened full log file: ./log/2021-07-10/13_29_53.ulg
    1.62 [INFO]:OSG        Error: Not able to create requested visual.
ERROR [simulator] poll timeout 0, 0
ERROR [simulator] poll timeout 0, 0
ERROR [simulator] poll timeout 0, 0
ERROR [simulator] poll timeout 0, 0
PX4 Communicator: PX4 Connected.
ERROR [simulator] poll timeout 0, 0
ERROR [simulator] poll timeout 0, 0
ERROR [simulator] poll timeout 0, 0
ERROR [simulator] poll timeout 0, 0
ERROR [simulator] poll timeout 0, 0
ERROR [simulator] poll timeout 0, 0
ERROR [simulator] poll timeout 0, 0
ERROR [simulator] poll timeout 0, 0











fgfs --launcher

1

so please help me.

Hi,

You mentioned that you are able to open the FG launcher. And are you able to run a simulation from the launcher? Or just run the fgfs command (without --launcher argument).

Thanks for your help.

I can open the simulation, not just the lancher.

And can you run this command? If there is some parameter that is incompatible with your setup.

PX4-FG bridge launches FG with this command:

I can’t run FG using the command.
I shows the same message box :frowning:
“FlightGear was unable to create a window supporting 3D rendering (OpenGL). This is normally due to outdated graphics drivers, please check if updates are available.
Depending on your OS and graphics chipset, updates might come from AMD, nVidia or Intel.”

I checked the driver. It has already updated.

is that because i am using a virtrual machine, and the virtural graphic card does not support OpenGL?

Yes, it can be the reason. Doesn’t VMware offer any other graphical virtual interface?

Because you say that without those parameters, you can launch FG, so I would suggest find out which parameter causes it. Some parameters there are a bit extra. They are, for example, to reduce graphics complexity.

I had to set env var VGA_VGPU10=0 in my vm to workaround vmware complaining about an invalid ioctl (mentioned here: VMware: vmw_ioctl_command error Invalid argument. - VMware Technology Network VMTN)

Perhaps you are seeing a different manifestation of the same problem with FG?