Automatic layout of windows in MAVProxy

Hello guys,

I just set up SITL on Windows 10 and the first thing I noticed is that all three windows of MAVProxy (terminal, console and map) open in cascade. It’s quite frustrating to re-align them every time, is it possible to automatize this process?

I couldn’t find any helpful hints on the website, possibly some startup script could help - but there’s not much documentation on available commands…

You can use the layout module in MAVProxy for this.

Once your windows are arranged how you want, type in layout save. Then whenever you start MAVProxy in the future, type in layout load to move/resize the windows to the saved layout.

It’s not documented (only became a feature ~8 weeks ago!) yet … hopefully I’ll have some time between now and Christmas to update the MAVProxy docuementation.

Thank you! I’ve wished for this for a long time. I tried loading module layout in 3.6 and it was not found, what else do I need to do to enable this, or not in the 3.6 tree?

It should be loaded by default. You can go straight into typing layout load and layout save

Hmm, I must have something wrong in my setup. Git says I’m up to date on Copter-3.6. In mavproxy there is no layout module in the list, and the layout command is not found. I’ll investigate some more. Where in the src tree is the module?

.\MAVProxy\modules\mavproxy_layout.py

Problem in my environment. Works well now. Thanks!

Hi guys,

I am also experimenting with the layout module on my Mavproxy in Windows 10 (Windows Subsystem for Linux). I am running 4 modules:

  • Console
  • Map
  • Horizon
  • Mission Editor

I notice that when I do “layout save” followed by “layout load”, only the map and console modules get laid out automatically, and nothing happens to the Horizon and Misseditor. The terminal output also states “Saved/Loaded layout for 2 windows”, from which I infer that it is only handling the map and console modules, and ignores the other 2.

Anyone faced a similar issue?

That’s by design - the layout module currently only works with map and console (plus our cuav software). There’ll need to be code changes to support other modules.

1 Like

Using the latest MAVProxy in Windows, I tried this procedure of saving the layout and received this error:

AUTO> layout save
AUTO> ERROR in command ['save']: global name 'opts' is not defined
Traceback (most recent call last):
  File "MAVProxy\mavproxy.py", line 558, in process_stdin
  File "MAVProxy\modules\mavproxy_layout.py", line 22, in cmd_layout
  File "MAVProxy\modules\lib\win_layout.py", line 99, in save_layout
  File "MAVProxy\modules\lib\win_layout.py", line 80, in layout_filename
NameError: global name 'opts' is not defined

Is there a way to pre-define options in an xml file? Or would delving into mavinit.scr help to fix this? (If so, where?)

Yep, that’s a bug! Thanks for reporting it - it’s now fixed.

You can either grab the updated source code from github, or download the updated installer from AppVeyor

Works now. Thanks for the prompt fix!