Difference between revisions of "GCS Configuration"

From PaparazziUAV
Jump to: navigation, search
(Configuration Options)
m (Video plugin: Made some grammatical changes near the ending. changed the last line to direct people to the discussion if all else fails)
 
(10 intermediate revisions by 7 users not shown)
Line 1: Line 1:
 +
<categorytree style="float:right; clear:right; margin-left:1ex; border: 1px solid gray; padding: 0.7ex;" mode=pages>GCS</categorytree>
 +
__TOC__
 +
 
== Paparazzi Center ==
 
== Paparazzi Center ==
 
The paparazzi center is launched with the following command:
 
The paparazzi center is launched with the following command:
Line 6: Line 9:
 
===Configuration Options===
 
===Configuration Options===
  
Here are the different Configuration Options for launching the GCS. They are a bit crude since they are simply pasted here from the code but give a good overview.<br>
+
Here all the commandline parameter to set specific option(s) while launching the GCS. To use these edit the file conf/control_panel.xml in the line that says <program name="GCS" command="sw/ground_segment/cockpit/gcs"> add the options, for example:  <br>
  "-auto_ortho", Arg.Set auto_ortho, "IGN tiles path";
+
<program name="GCS" command="sw/ground_segment/cockpit/gcs -fullscreen"><br>
  "-b", Arg.String (fun x -> ivy_bus := x),(sprintf "<ivy bus> Default is %s" !ivy_bus);
+
 
  "-center", Arg.Set_string center, "Initial map center (e.g. 'WGS84 43.605 1.443')";
+
'''-auto_ortho''', IGN tiles path
  "-center_ac", Arg.Set auto_center_new_ac, "Centers the map on any new A/C";
+
'''-b''', <ivy bus> Default is 127.255.255.255:2010
  "-edit", Arg.Unit (fun () -> edit := true; layout_file := "editor.xml"), "Flight plan editor";
+
'''-center''', Initial map center (e.g. 'WGS84 43.605 1.443')
  "-fullscreen", Arg.Set fullscreen, "Fullscreen window";
+
'''-center_ac''', Centers the map on any new A/C
  "-maps_fill", Arg.Set GM.auto, "maps auto fill";
+
'''-edit''', Flight plan editor
  "-ign", Arg.String (fun s -> ign:=true; IGN.data_path := s), "IGN tiles path";
+
'''-fullscreen''', Fullscreen window
  "-lambertIIe", Arg.Unit (fun () -> projection:=G.LambertIIe),"Switch to LambertIIe projection";
+
'''-maps_fill''', Automatically start loading background maps
  "-layout", Arg.Set_string layout_file, (sprintf "<XML layout specification> GUI layout. Default: %s" !layout_file);
+
'''-maps_zoom''', Background maps zoomlevel (default: 18, max: 22)
  "-m", Arg.String (fun x -> map_files := x :: !map_files), "Map XML description file";
+
'''-ign''', IGN tiles path
  "-maximize", Arg.Set maximize, "Maximize window";
+
'''-lambertIIe''', Switch to LambertIIe projection
  "-mercator", Arg.Unit (fun () -> projection:=G.Mercator),"Switch to (Google Maps) Mercator projection, default";
+
'''-layout''', <XML layout specification> GUI layout. Default: horizontal.xml
  "-mplayer", Arg.Set_string mplayer, "Launch mplayer with the given argument as X plugin";
+
'''-m''', Map XML description file
  "-no_alarm", Arg.Set no_alarm, "Disables alarm page";
+
'''-maximize''', Maximize window
  "-maps_policy_no_http", Arg.Unit (fun () -> Gm.set_policy Gm.NoHttp), "Switch off Maps downloading - only cache!";
+
'''-mercator''', Switch to (Google Maps) Mercator projection, default
  "-ortho", Arg.Set_string get_bdortho, "IGN tiles path";
+
'''-mplayer''', Launch mplayer with the given argument as X plugin
  "-osm", Arg.Unit (fun () -> Gm.set_maps_source Gm.OSM), "Use OpenStreetMap database (default is Google)";
+
'''-no_alarm''', Disables alarm page
  "-ms", Arg.Unit (fun () -> Gm.set_maps_source Gm.MS), "Use Microsoft maps database (default is Google)";
+
'''-no_confirm_kill''', Disable the additional kill conformation dialog
  "-particules", Arg.Set display_particules, "Display particules";
+
'''-maps_no_http''', Switch off downloading of maps, always use cached maps
  "-plugin", Arg.Set_string  plugin_window, "External X application (launched with the id of the plugin window as argument)";
+
'''-ortho''', IGN tiles path
  "-ref", Arg.Set_string geo_ref, "Geographic ref (e.g. 'WGS84 43.605 1.443')";
+
'''-osm''', Use OpenStreetMap database (default is Google)
  "-[[speech]]", Arg.Set Speech.active, "Enable vocal messages";
+
'''-ms''', Use Microsoft maps database (default is Google)
  "-[[Maps#SRTM_Data|srtm]]", Arg.Set srtm, "Enable SRTM elevation display";
+
'''-particules''', Display particules
  "-track_size", Arg.Set_int Live.track_size, (sprintf "Default track length (%d)" !Live.track_size);
+
'''-plugin''', External X application (launched with the id of the plugin window as argument)
  "-utm", Arg.Unit (fun () -> projection:=G.UTM),"Switch to UTM local projection";
+
'''-ref ''',Geographic ref (e.g. 'WGS84 43.605 1.443')
  "-wid", Arg.String (fun s -> wid := Some (Int32.of_string s)), "<window id> Id of an existing window to be attached to";
+
'''-speech''', Enable vocal messages
  "-zoom", Arg.Set_float zoom, "Initial zoom";
+
'''-srtm''', Enable SRTM elevation display
 +
'''-track_size''', Default track length (500)
 +
'''-utm''', Switch to UTM local projection
 +
'''-wid''', <window id> Id of an existing window to be attached to
 +
'''-zoom''', Initial zoom
 +
'''-auto_hide_fp''', Automatically hide flight plans of unselected aircraft
 +
'''-help''', Display a list of options
  
 
=== Video plugin ===
 
=== Video plugin ===
Line 55: Line 64:
 
Locate the line in the "control_panel.xml" usually located in /Your Paparazzi directory/conf/ (mine is in "/paparazzi/conf/")
 
Locate the line in the "control_panel.xml" usually located in /Your Paparazzi directory/conf/ (mine is in "/paparazzi/conf/")
 
that looks similar to the below line:
 
that looks similar to the below line:
 
+
<source lang="xml">
'''<program name="GCS" command="sw/ground_segment/cockpit/gcs -layout horizontal.xml">'''
+
<program name="GCS" command="sw/ground_segment/cockpit/gcs -layout horizontal.xml">
 +
</source>
  
 
Then edit it so it looks like this:
 
Then edit it so it looks like this:
  
'''<program name="GCS" command="sw/ground_segment/cockpit/gcs -layout horizontal.xml -mplayer 'tv:// -tv driver=v4l2:width=320:height=240:norm=NTSC:input=1:device=/dev/video1:alsa:adevice=hw.2,0:amode=1:audiorate=48000:forceaudio:volume=100:immediatemode=0'">'''
+
<source lang="xml">
 +
<program name="GCS" command="sw/ground_segment/cockpit/gcs -layout horizontal.xml -mplayer 'tv:// -tv driver=v4l2:width=320:height=240:norm=NTSC:input=1:device=/dev/video1:alsa:adevice=hw.2,0:amode=1:audiorate=48000:forceaudio:volume=100:immediatemode=0'">
 +
  <arg flag="-b" variable="ivy_bus"/>
 +
</program>
 +
</source>
  
 
The above line is one complete and uninterrupted line but it is just too long to show it in one line here.
 
The above line is one complete and uninterrupted line but it is just too long to show it in one line here.
Line 68: Line 82:
 
Read the mplayer documentation so you can tweak the resolution etc. later to suit your particular setup.
 
Read the mplayer documentation so you can tweak the resolution etc. later to suit your particular setup.
 
The resolution above is set to 320x240 here but you can set it to 640x480 by replacing the numbers in the command line above.
 
The resolution above is set to 320x240 here but you can set it to 640x480 by replacing the numbers in the command line above.
 +
If You forget to set the arg parameter, then GCS will not meet through window handlers with mplayer and the video will not appear! This time you see an mplayer <defunct> on the process list.
  
 
Finally you have to add the plugin widget to your GCS layout configuration file.
 
Finally you have to add the plugin widget to your GCS layout configuration file.
 
If you noticed the GCS command line in the "control_panel.xml" file, a part of it reads "-layout horizontal.xml"  
 
If you noticed the GCS command line in the "control_panel.xml" file, a part of it reads "-layout horizontal.xml"  
so our configuration file is the "horizontal.xml" which is located always in "/Your Paparazzi directory/conf/gcs/"  
+
so our configuration file is the "horizontal.xml" which is located always in "/Your Paparazzi directory/conf/gcs/".
(mine is in "/paparazzi/conf/gcs/").
+
Open the file and add or uncomment the line below (in "horizontal.xml" the plugin widget is there but commented out):
Open the file and add or uncomment the below line (in "horizontal.xml" the plugin widget is there but commented out):
 
  
'''<widget NAME="plugin" SIZE="300"/>'''
+
<source lang="xml">
 +
<widget NAME="plugin" SIZE="300"/>
 +
</source>
  
 
Now the file should look like this:
 
Now the file should look like this:
  
'''
+
<source lang="xml">
 
  <rows>
 
  <rows>
 
   <widget size="500" name="map2d"/>
 
   <widget size="500" name="map2d"/>
Line 91: Line 107:
 
   </columns>
 
   </columns>
 
  </rows>
 
  </rows>
'''
+
</source>
  
All the above work fine in Ubuntu 10.04 LTS but probably the same method should work fine on different versions too.
+
All the above works fine in Ubuntu 10.04 LTS. It should work fine on different versions of Ubuntu too. If it does not, look for solution in other wiki pages and the PaparazziUAV documentations. If all else fails discuss your issue in the [https://gitter.im/paparazzi/discuss PaparazziUAV Gitter discussion].
  
 
== Layout ==
 
== Layout ==
 
The layout of the different components (map, strips, ...) of the gcs is configurable through a ''style'' XML file located in <tt>conf/gcs/</tt>. The specification is done via a combination of rows and columns. The default layout is given in the <tt>horizontal.xml</tt> file:
 
The layout of the different components (map, strips, ...) of the gcs is configurable through a ''style'' XML file located in <tt>conf/gcs/</tt>. The specification is done via a combination of rows and columns. The default layout is given in the <tt>horizontal.xml</tt> file:
<tt><!DOCTYPE layout SYSTEM "layout.dtd">
+
 
 +
<source lang="xml">  
 +
<!DOCTYPE layout SYSTEM "layout.dtd">
 
  <layout width="1024" height="768">
 
  <layout width="1024" height="768">
 
  <rows>
 
  <rows>
Line 110: Line 128:
 
   </columns>
 
   </columns>
 
  </rows>
 
  </rows>
  </layout></tt>
+
  </layout>
 +
</source>
  
 
Default size ('''1024x768''') of the whole window is specified in the root of the tree. The window is then divided in two rows:  
 
Default size ('''1024x768''') of the whole window is specified in the root of the tree. The window is then divided in two rows:  
Line 122: Line 141:
  
 
This second example (<tt>left_col.xml</tt>) sets the map and the notebook on the right and the other frames in a left column:
 
This second example (<tt>left_col.xml</tt>) sets the map and the notebook on the right and the other frames in a left column:
<tt><!DOCTYPE layout SYSTEM "layout.dtd">
+
 
 +
<source lang="xml">  
 +
<!DOCTYPE layout SYSTEM "layout.dtd">
 
  <layout width="1024" height="768">
 
  <layout width="1024" height="768">
 
  <columns>
 
  <columns>
Line 135: Line 156:
 
   </rows>
 
   </rows>
 
  </columns>
 
  </columns>
  </layout></tt>
+
  </layout>
 +
</source>
  
 
This layout file is chosen with the <tt>-layout</tt> option:
 
This layout file is chosen with the <tt>-layout</tt> option:
 
  <tt>path_to_ground_segment/cockpit/gcs -layout left_col.xml</tt>
 
  <tt>path_to_ground_segment/cockpit/gcs -layout left_col.xml</tt>
  
[[Category:Software]] [[Category:User_Documentation]]
+
[[Category:GCS]] [[Category:User_Documentation]]

Latest revision as of 10:25, 31 March 2017

Paparazzi Center

The paparazzi center is launched with the following command:

./sw/supervision/paparazzicenter

and is used to launch individual portions of the GCS (Programs) or the entire GCS (Sessions) with the modem and map settings defined in /conf/control_panel.xml

Configuration Options

Here all the commandline parameter to set specific option(s) while launching the GCS. To use these edit the file conf/control_panel.xml in the line that says <program name="GCS" command="sw/ground_segment/cockpit/gcs"> add the options, for example:
<program name="GCS" command="sw/ground_segment/cockpit/gcs -fullscreen">

-auto_ortho, IGN tiles path
-b, <ivy bus> Default is 127.255.255.255:2010
-center, Initial map center (e.g. 'WGS84 43.605 1.443')
-center_ac, Centers the map on any new A/C
-edit, Flight plan editor
-fullscreen, Fullscreen window
-maps_fill, Automatically start loading background maps
-maps_zoom, Background maps zoomlevel (default: 18, max: 22)
-ign, IGN tiles path
-lambertIIe, Switch to LambertIIe projection
-layout, <XML layout specification> GUI layout. Default: horizontal.xml
-m, Map XML description file
-maximize, Maximize window
-mercator, Switch to (Google Maps) Mercator projection, default
-mplayer, Launch mplayer with the given argument as X plugin
-no_alarm, Disables alarm page
-no_confirm_kill, Disable the additional kill conformation dialog
-maps_no_http, Switch off downloading of maps, always use cached maps
-ortho, IGN tiles path
-osm, Use OpenStreetMap database (default is Google)
-ms, Use Microsoft maps database (default is Google)
-particules, Display particules
-plugin, External X application (launched with the id of the plugin window as argument)
-ref ,Geographic ref (e.g. 'WGS84 43.605 1.443')
-speech, Enable vocal messages
-srtm, Enable SRTM elevation display
-track_size, Default track length (500)
-utm, Switch to UTM local projection
-wid, <window id> Id of an existing window to be attached to
-zoom, Initial zoom
-auto_hide_fp, Automatically hide flight plans of unselected aircraft
-help, Display a list of options

Video plugin

The -mplayer option of GCS allows to the user to display a video stream in a window of the GCS. The video window can also be exchanged with the map by clicking anywhere inside the frame. Use the following line in your /conf/control_panel.xml to enable the video window.

path_to_ground_segment/cockpit/gcs -mplayer rtsp://localhost:7070/video

A useful example follows: If you have an Avermedia DVB-T usb tuner like the Aver-Tv Hybrid Volar HX (Avermedia finally released Ubuntu Linux drivers) then in order to use the usb tuner as video input to the GCS you have to complete the following steps:

First download and install the drivers and check that the Usb tuner works well by opening a console window and typing:

mplayer tv:// -tv driver=v4l2:width=320:height=240:norm=NTSC:input=1:device=/dev/video1:noaudio

Of course you must connect a video signal to the composite input first. Then close the console and remove the Usb tuner. Now it is time to configure the control_panel.xml file by editing the GCS command line. Locate the line in the "control_panel.xml" usually located in /Your Paparazzi directory/conf/ (mine is in "/paparazzi/conf/") that looks similar to the below line:

<program name="GCS" command="sw/ground_segment/cockpit/gcs -layout horizontal.xml">

Then edit it so it looks like this:

<program name="GCS" command="sw/ground_segment/cockpit/gcs -layout horizontal.xml -mplayer 'tv:// -tv driver=v4l2:width=320:height=240:norm=NTSC:input=1:device=/dev/video1:alsa:adevice=hw.2,0:amode=1:audiorate=48000:forceaudio:volume=100:immediatemode=0'">
  <arg flag="-b" variable="ivy_bus"/>
</program>

The above line is one complete and uninterrupted line but it is just too long to show it in one line here. (There is a space after the"-tv" like this "-mplayer 'tv:// -tv driver=v4l2:...." but nowhere else after that). This will load the mplayer, select the composite video input of the tuner and enable the sound input. Please remember to change the "NTSC" with "PAL" if you do not use the NTSC video system (if your airborne camera is PAL for example). Read the mplayer documentation so you can tweak the resolution etc. later to suit your particular setup. The resolution above is set to 320x240 here but you can set it to 640x480 by replacing the numbers in the command line above. If You forget to set the arg parameter, then GCS will not meet through window handlers with mplayer and the video will not appear! This time you see an mplayer <defunct> on the process list.

Finally you have to add the plugin widget to your GCS layout configuration file. If you noticed the GCS command line in the "control_panel.xml" file, a part of it reads "-layout horizontal.xml" so our configuration file is the "horizontal.xml" which is located always in "/Your Paparazzi directory/conf/gcs/". Open the file and add or uncomment the line below (in "horizontal.xml" the plugin widget is there but commented out):

<widget NAME="plugin" SIZE="300"/>

Now the file should look like this:

 <rows>
  <widget size="500" name="map2d"/>
  <columns>
   <rows size="375">
    <widget size="200" name="strips"/>
   </rows>
   <widget size="400" name="aircraft"/>
   <widget name="alarms"/>  
   <widget NAME="plugin" SIZE="300"/> 
  </columns>
 </rows>

All the above works fine in Ubuntu 10.04 LTS. It should work fine on different versions of Ubuntu too. If it does not, look for solution in other wiki pages and the PaparazziUAV documentations. If all else fails discuss your issue in the PaparazziUAV Gitter discussion.

Layout

The layout of the different components (map, strips, ...) of the gcs is configurable through a style XML file located in conf/gcs/. The specification is done via a combination of rows and columns. The default layout is given in the horizontal.xml file:

 
 <!DOCTYPE layout SYSTEM "layout.dtd">
 <layout width="1024" height="768">
 <rows>
  <widget size="500" name="map2d"/>
  <columns>
   <rows size="350">
    <widget size="120" name="strips"/>
    <widget name="alarms"/>
   </rows>
   <widget size="400" name="aircraft"/>
   <widget size="00" name="plugin"/>
  </columns>
 </rows>
 </layout>

Default size (1024x768) of the whole window is specified in the root of the tree. The window is then divided in two rows:

  • the map2d with a requested height of 500
  • a set of columns containing
    • a set of rows of width 350 divided into
      the strips frame of height 120
      the alarms frame
    • the notebook frame (aircraft) of width 400
    • the video plugin frame

This second example (left_col.xml) sets the map and the notebook on the right and the other frames in a left column:

 
 <!DOCTYPE layout SYSTEM "layout.dtd">
 <layout width="1024" height="768">
 <columns>
   <rows size="360">
      <widget size="120" name="strips"/>
      <widget size="300" name="plugin"/>
      <widget name="alarms"/>
   </rows>
   <rows>
     <widget name="map2d"/>
     <widget name="aircraft"/>
   </rows>
 </columns>
 </layout>

This layout file is chosen with the -layout option:

path_to_ground_segment/cockpit/gcs -layout left_col.xml