SITL install missing libraries. --osd parameter in sim_vehicle.py not working with multiple installs. Please help

This is my error (and I cannot find how to install libsfml-dev)

$ sim_vehicle.py -v ArduPlane -f plane-vtail -l 42.221875,-87.907888,0,90 --console --map --osd
SIM_VEHICLE: Start
SIM_VEHICLE: Killing tasks
SIM_VEHICLE: Starting up at 42.221875,-87.907888,0,90
SIM_VEHICLE: WAF build
SIM_VEHICLE: Configure waf
SIM_VEHICLE: “/home/marc/ardupilot/modules/waf/waf-light” “configure” “–board” “sitl” “–enable-sfml” “–sitl-osd”
Setting top to : /home/marc/ardupilot
Setting out to : /home/marc/ardupilot/build
Autoconfiguration : enabled
Setting board to : sitl
Using toolchain : native
Checking for ‘g++’ (C++ compiler) : /usr/bin/g++
Checking for ‘gcc’ (C compiler) : /usr/bin/gcc
Checking for c flags ‘-MMD’ : yes
Checking for cxx flags ‘-MMD’ : yes
Checking for need to link with librt : not necessary
Checking for feenableexcept : no
Checking for library sfml-graphics : not found
Missing SFML libraries - please install libsfml-dev
(complete log in /home/marc/ardupilot/build/config.log)
SIM_VEHICLE: (Configure waf) exited with code 256
SIM_VEHICLE: Killing tasks

It should be sudo apt install libsfml-dev. Which Linux are you running?

Cygwin64 in Win10. I did try that but I will give it another shot. When I figure it out maybe we can add it to the Powershell script used to install all this.

Ahh, there’s your issue. Cygwin doesn’t have libsfml-dev. You’ll likely need to try WSL instead.

WSL?? What is that? Sorry to be stupid.

WSL = Windows Subsystem for Linux. It’s a (Microsoft developed) method to run Linux within Windows via a VM-like environment.

Result is a full Linux environment running within Windows, helping reduce many compatibility issues.

I see. Is this official. I thought I saw a video demonstrating this feature with cygwin64 on the Ardupilot YouTube channel. Maybe I am wrong. I have just got comfortable with Eclipse and Cygwin64.

Both Cygwin and WSL are supported. Some features are not supported in Cygwin, but core build/upload and basic SITL are regularly tested. Most people are moving to WSL, as there’s better compatibility.

WSL instructions are at Setting up the Build Environment on Windows 10/11 using WSL1 or WSL2 — Dev documentation

Cool. Will give it a whirl.

Ok I have installed WSL and created the environment as per the instructions.

I have no issue with starting a SITL session but now I am getting no map or console (or OSD). I can connect with Mission Planner and everything is working fine.

Here is the interesting part of the screen dump. Any ideas? I highlighted what I think may be the important piece.

Connect tcp:127.0.0.1:5760 source_system=255
Unable to access the X Display, is $DISPLAY set properly?
Loaded module console
Loaded module map
Log Directory:
Telemetry log: mav.tlog
Waiting for heartbeat from tcp:127.0.0.1:5760
MAV> Unable to access the X Display, is $DISPLAY set properly?
Unloaded module map

This is indeed the important piece. There’s a few extra steps required to get the GUI working in WSL:

  1. Install a X server such as XMing

  2. You need to edit ~/.bashrc and insert this line:

export DISPLAY=localhost:0.0
  1. Launch the XMing server
  2. Launch WSL

Thank you. That works. Definitely better to be using Ubuntu than Cygwin.

I think that extra step needs to make it into the wiki at some point. Or can be added to the script that does most of the installation/configuration steps?

Now I am very nearly there. I am getting an OSD window but it is blank. The reason is clear --missing fonts–but the solution is not. I searched for a solution on the forums.

xterm: cannot load font “10x20”
xterm: cannot load font “-Misc-Fixed-bold-R---13-120-75-75-C-60-ISO8859-1”
xterm: cannot load font “-Misc-Fixed-medium-R---13-120-75-75-C-120-ISO10646-1”
xterm: cannot load font “-Misc-Fixed-bold-R---13-120-75-75-C-120-ISO10646-1”
xterm: cannot load font “-misc-fixed-medium-r-normal–20-200-75-75-c-100-iso10646-1”

Edit. This is a more general font issue with Xming. I am downloading and installing Xming fonts.
https://sourceforge.net/projects/xming/files/Xming-fonts/7.7.0.10/Xming-fonts-7-7-0-10-setup.exe/download

These fonts worked. Finally I have an osd!

Thanks for your help.

Two years later, after running:

../Tools/autotest/sim_vehicle.py --map --console

I also ran into:

Loaded module console

Unable to access the X Display, is $DISPLAY set properly?

Unable to access the X Display, is $DISPLAY set properly?

On the wiki page: Setting up the Build Environment on Windows 10/11 using WSL1 or WSL2 — Dev documentation
it mentions:

If using Windows 10 install an XWindows application to run graphical programs such as SITL by installing VcXsrv, Cygwin X or Xming on Windows. For Winodws 11 this is not necessary.

For me I’m on windows 11 on a Ubuntu WSL, and still ran into the problem of not having the $DISPLAY variable set after following the wiki up to that point.

I’m going to try installing Xming as mentioned above.

Alright got it working so I’m pretty sure that the issue was that sim_vehicle.py was relying on some windows 11 capabilities that my windows 11 machine didn’t have. Hence why trying the windows 10 methods ended up working. These methods are outlined here: Setting up the Build Environment on Windows 10/11 using WSL1 or WSL2 — Dev documentation

I used Xlaunch to create a Xming server (something that windows 11 is supposed to do automatically apparently)

left everything default except set “No Access Control” to true

I then added:

export DISPLAY=$(grep -m 1 nameserver /etc/resolv.conf | awk '{print $2}'):0

to the .bashrc file inside the WLS terminal

also I had followed this link Setting up the Build Environment (Linux/Ubuntu) — Dev documentation
up until the " Setup for other Distributions Using the STM Toolchain" section

then running sim_vehicle.py finally displayed the map, and two other windows with telemetry data on them