SITL OSD question - where do I type in "--osd" in SITL to get the GUI to show up?

Hi folks…on this page:

http://ardupilot.org/copter/docs/common-osd-overview.html

Near the bottom of the page It says:

A graphical OSD simulation in a separate window can be opened by adding the following option to sim_vehicle.py:

–osd

How does a person “add the following option” to sim_vehicle.py ??

This is what I am doing…

  1. Start Mission Planner
  2. Select SIMULATION
  3. Click on MULTIROTOR
  4. Simulation starts

I have found the sim_vehicle_py file…I assume I am supposed to add the text “–osd” somewhere in that file? Then save the file and restart the simulator?

Or do I enter “–osd” into the EXTRA COMMAND LINE box at the bottom of the simulator page?

Neither of those have worked for me…so I am apparently missing something. (Sure wish the Ardupilot/OSD page could explain the process better for dolts like me.)

Thanks…

It goes on the sim_vehicle.py command line. And it’s two hyphens: - - o s d

Hi Anthony…

So I found this bit of code (below)…where do I add “- - osd” ?

Thanks…


define and run parser

parser = CompatOptionParser(
“sim_vehicle.py”,
epilog=""
"eeprom.bin in the starting directory contains the parameters for your "
"simulated vehicle. Always start from the same directory. It is "
"recommended that you start in the main vehicle directory for the vehicle "
"you are simulating, for example, start in the ArduPlane directory to "
“simulate ArduPlane”)

on the command line issue

python sim_vehicle.py --osd

So we are saying where it says EXTRA COMMAND LINE, to type in “python sim_vehicle.py --osd”

Is that correct?

Because it doesn’t seem to work…nothing changes (that I can tell)…I can’t find any kind of OSD screen inside Mission Planner in it’s simulation mode.

Thanks…

No, what I am saying to to use a command line. If you are using windows, use the cmd.exe program
If you are using linux use xterm

OK…got it…I think…is this what the command line should look like?

c:\users\etc\etc\mission planner\sitl>sim_vehicle.py --osd

Then Windows asks with what program I want to open.
I select Mission Planner.
Mission Planner opens.
I select the simulation tab, click on multicopter.
Mission Planner downloads the SITL software (I wonder why it does that every time?).
The simulation starts…

But the OSD display is nowhere to be found.

Look I guess there is something quite basic here that I am not understanding.

The other thing is that I’ve discovered the OSD GUI section in Mission Planner when my vehicle is plugged in/connected…so maybe there is no need to go down this command line road anymore?

Thanks…

Hi @wsalopek,

I hope this would be an answer for you.

I assume that you already installed all environments to start for a SITL simulation. Please see the Simulating On-Board OSD section on the link below:
https://ardupilot.org/dev/docs/using-sitl-for-ardupilot-testing.html#using-sitl-for-ardupilot-testing

  1. Please open ‘New terminal’ on Ubuntu

  2. type in this command on the terminal:

  • cd ~/ardupilot/ArduCopter
  1. press ‘Enter’ key

  2. And then please type in this command on the terminal:

  • sim_vehicle.py --console --map --osd

Following up on this old thread… the instructions above are for Linux where the original question is on Windows. I am having the same issue on Windows, where sim_vehicle.py doesn’t actually run because of many missing dependencies. I Noticed that Mission Planner runs its own sim_vehicle through ArduCopter.exe but I can’t find any way to pass --osd to ArduCopter in a way that it launches sim_vehicle.py correctly. Any advice?

Hi,
got similar issue.

As I understood, looking at scripts and doing test…SITL OSD needs SFML libraries that are not available under cygwin.
In turn …WSL (Windows Subsystem for Linux) has a different network “box”, like VirtualBox, and is quite unstable at present, graphics panels/windows disappear, once in a while. There is a workaround explained somewhere googling, but is quite complex sequence of ops to do.
Moreover …
joystick on Linux in turn … relays on SFML that does not map all kind of joysticks, it is a bit limited, so
finally I got into a kind of “dead-lock”::

1)If You choose Ms-Windows You loose OSD on cygwin
2)if You choose WSL , than You need to specify IP addresses between GCS, FlightGear and SITL like Vmbox, in practice You are working with different virtual machines on same PC
3)If You choose Linux You loose full joystick feature ( I cannot map all my Taranis switches, SFML maps only 8 axis, for me actually 6 are usable).

What I found interesting is that:
1)MPlanner under MS-Windows can be used for joystick commands toward Sitl
2)Under Linux joystick must be handled by Sitl directly (through SFML), not by MPlanner.
So… this is why for ardupilot/arducopter many guys complain that joystick seems “dead” under Linux !!.
Conclusion:
All of this concerns are related to --osd and --sfml options for using python script, because
what I realized a bit late, is that sim_vehicle.py does compile SITL, and passes build options to SITL binary build system.
If You pay attention to console log while building, You notice that some errors on console log show SFML missing libraries…

Hope this helps…

Alfredo

Addendum :

I experimented to compile SFML under cygwin, but build immediately fails because it is necessary to check and adapt all source code to cygwin, at least for “udev” and “joystick” SFML features.
In theory I think it is possible to complete this task, but at present I have no time to carry on it.

Alfredo