KNOWN BUGS IN SaVi
==================
# $Id: BUGS,v 1.51 2005/04/24 20:07:34 lloydwood Exp $

This list of BUGS describes caveats and problems with use of the SaVi
satellite visualization software. This document contains the following
sections:

1. Caveats in use of SaVi. Be aware of these.

2. A detailed SaVi 1.2 wishlist. Notes on issues in these SaVi releases.
   a. Build issues
   b. Scalability
   c. Scriptability
   d. User interface
   e. Coverage view improvements
   f. Fisheye view improvements
   g. Geomview interaction
   h. Dynamic texturemapping with Geomview
   i. Various
   j. Interaction with other 3D renderers
   k. Interaction with the network simulator ns

3. Remaining integration work from unreleased SaVi 1.1.

4. The original SaVi 1.0 wishlist.



1. CAVEATS IN USE OF SAVI
=========================

Changing default simulation parameters (central body radius,
gravity, etc.) can cause unexpected behaviour; scripts generally
describe satellites in circular orbits via an altitude above the
body's surface. Use at own risk.

Two-line-element (TLE or 'elset') reading and constellation code
in tcl/constellations.tcl still needs considerable work. Reading
.tle files is experimental. This is not guaranteed for multiple
satellites of different epochs, so you can't yet just download
a .tle file, load it in and go.
Improving this would make SaVi much more practical.

Using sinusoidal coverage map, full coverage reads from 99.6% to 99.8%
due to rounding at curved edges of map. Coverage calculations for all
projections are estimates at best, and are limited to not exceed
the 100% threshold. Calculations should really reflect degree of
coverage overlap.

Mask elevation/satellite cone selection in coverage does not update
fisheye mask circle.

Selection: selected satellite is not visible as selected in Geomview
until a marker type is first selected or satellite orbital elements
are edited. Operations on multiple satellites (e.g. Cut) only work
on the last satellite selected.


2. A DETAILED SAVI 1.2 WISHLIST
===============================

This is an additional wishlist of improvements for SaVi
originally accumulated during work for the SaVi 1.2 release during
October-November 2001, and kept up-to-date with development.

Development takes place at:
http://www.ee.surrey.ac.uk/Personal/L.Wood/software/SaVi/src/unreleased/
http://savi.sourceforge.net/

Many suggestions (such as the user interface and fisheye
modifications) should be straightforward if you have some Tcl/Tk/C
experience and the spare time and interest. Others are difficult.



a. BUILD ISSUES

- Cygwin support isn't seamless, and needs some editing of
  the Tcl Makefile to support the version of Tcl Cygwin uses.
  This caveat only appears to apply to old versions of Cygwin; not
  Cygwin 1.5.6-1 and later.

- $HOST or $HOSTNAME? One or both have the machine info we need
  for the compile version info preserved in Help/About...

- src/Makefile uses $MACH to clean and remove binaries. But Cygwin
  identifies itself as linux, so savi-bin.cygwin is skipped.
  Can we use $ARCH somehow?

- Just typing 'make' on Solaris looks for Makefile_defs_sun4, as that
  is what $ARCH holds. There are probably similar gotchas for the
  various irix platforms.
 


b. SCALABILITY

- Scaling up.
  Can SaVi detect available CPU power and e.g. scale number of
  segments in drawn orbit circles/number of sides to a coverage cone
  appropriately for Geomview? A slider or command switch giving some
  control over this would be very useful. Scaling up the number of
  segments when drawing highly-elliptical orbits has been done, but
  ORBIT_SEGMENTS defined in include/constants.h needs to be passed
  to Tcl as a variable.
  More use of Geomview binary format (discussed below) may help.

- Scaling down.
  Geomview rendering is optional; you can conserve CPU by running
  SaVi standalone. SaVi 1.2 doesn't do Geomview calculations when run
  standalone, although 1.0 did.
  Why shouldn't Tk and a graphical display also be optional?
  You do need a Tcl parser - that's essential - but we
  can execute scripts to build satellites and get results; we can
  make use of command-line switches, and we can pipe graphics to
  stdout for a variety of uses, including building web cgis
  (a la Chris Meenan's footprint generator).



c. SCRIPTABILITY

As well as scripts that get results there needs to be a
scriptable interface to record tracefiles. Scriptable recording of
satellite-related values over time periods would be very useful;
the self-scheduling Tcl procedure model that is used in the
network simulator ns (see below) may be worth emulating.



d. USER INTERFACE

Multiple selections: although it's possible to select more than one
satellite in the list by e.g. shift-clicking, only one satellite
at a time is tagged/untagged and shown as selected in coverage
groundtracks and in Geomview, since a single satellite number,
rather than all current cursor selection, is passed through to
the C tag/untag code.

The Tk procedures in tcl/tcl_utils.tcl (inherited from dsTool)
are straightforward to use, but are not that efficient in
using screen real estate. This makes SaVi cluttered, even on a
1024x768 display. SaVi 1.2 has improved things, but this still
needs more work.

* Main panel:
  A realtime push-hold button next to Time Interval would be useful;
  removes Rendering menu (->Geomview menu) when Geomview is not present.
  Move current time into reworked playbar line instead?

* Coverage panel:
  Some wasted space here. When -large-map is selected the playbar
  at end is drawn below the bottom of a 1024x768 screen, which
  is a problem if you can't move windows from available edges.
  Reaching the coverage angle options also becomes tricky.

* Edit satellite:
  Layout can be improved.
  Apply button was removed since values do update live - but does
  that also hold for older versions of Tcl?
  There's no easy way to select multiple satellites so that
  you can change a checkbox setting for all of them.
  Panel can be left open when inappropriate, e.g. when a new
  constellation is loaded in. Should switch to editing a new
  satellite.


Create 'Show all {satellites | orbits | cones | footprints }'
checkboxes that, when checked, force related checkbox (in satellite
Edit parameters) on and the feature visible for all satellites.
When checked off, disable the feature for all satellites. These would
be entries on the Rendering menu, under 'Real-time mode' when
SaVi is run under Geomview.

In 'Edit satellite parameters', the display satellite and display
orbit checkboxes are used only by Geomview, but there is no selectivity
for individual footprints or groundtracks in the 2D coverage window.
Could add more checkboxes.

Update all Earth maps to track more recent political boundaries.

Provide menu of colour choices for highlights etc.



e. COVERAGE VIEW IMPROVEMENTS

When choosing new colour shades after animating forwards then
stopping, the satellites move on an interval unexpectedly as
the map is updated with new colours. Is this due to computed
coverage finally being shown by tk_update()?

Add further shading levels, so that five-level diversity can
be seen and more sense can be made of e.g. GPS coverage.

Improve newly-added spherical projection, which needs better-drawn
maps from Geomview. Longitude calculation for fisheye clicks needs
doing. Edge calculation methods have visible differences (as does
sinusoidal). Area calculation hasn't been attempted; calculations
of areas in general for all projections are poor estimates anyway.
Look at applying a longitude offset so that Europe/Africa
aren't cut between spheres.

Last longitude/latitude clicked could be shown in panel in place
of last filename, rather than being reported to stderr if fisheye
is not open, or reported in fisheye if it is.

Project groundtracks for the next n hours only projects forwards in
time, even if the simulator is currently being run backwards - is
this the least confusing approach?

When altering the coverage map and tiling, remember to run the
Teledesic (840) simulation to check that the top and bottom
of the map are visible as a single line of uncovered (blue or
white) pixels. Tk does require a unit offset.

Add option to fade groundtracks to background over time, just
as interval decay works for coverage areas.

Coverage areas of the selected satellite(s) can be shown in
different shades - possibly shades of green.

Add optional latitude/longitude lines.

Earth outline on sinusoidal map is drawn using different algorithm
to backdrop. Overlap is poor; both should be drawn on the
cached map, rather than on each coverage map drawn. Similarly,
coverage colors should be updated only when changed, rather than
recomputed each time coverage is drawn.

How much work would be required to enable multiple coverage windows
to be spawned, so that multiple projections could be seen, and
any available cylindrical projection used for texturemapping if
desired? Probably a lot.

Opening the coverage window when animating means that the coverage
playbar is not immediately updated with playbar status, and
playbars only sync when the next playbar button is pressed.



f. FISHEYE VIEW IMPROVEMENTS

Under Insight Tk running under Cygwin, SaVi spawns a window native
to Windows. However, the fisheye view relies on X, and opening the
fisheye view would crash SaVi. Tcl/Tk can be compiled, or the xtcltk
package used, so that SaVi lives in the X window with Geomview.
With -no-X and detection we decide that the Tk window is not in an X
display and disable the fisheye menu option as a short-term option.

As a longer-term effort replacing this undesirable -no-X option,
we need to rewrite the fisheye to depend on pure Tk rather
than on Tk and X, or at least make the fisheye and X dependency a
compile-time option. (This problem may also affect building SaVi with
native Cocoa or similar Tk under Mac OS X, but that has not yet been
tried.)

Open fisheye does not update automatically when new constellation is
loaded in.

Mask elevation/satellite cone selection in coverage does not update
the fisheye mask circle. If satellite cone is selected, could disable
green mask circle and use of mask option.
(COVERAGE_ANGLE_TYPE is unused in C.)

Provide dropdown menu of large cities that sets latitude and
longitude for the ground terminal.

Now that the fisheye window is resizable, having controls partially
obscured at small sizes is messy. Can this be improved? Not resizing
the window when recording tracks is a deliberate choice, given the
complexity of the alternative.

Add slider to select size of fisheye crosshairs; will need to adjust
text positioning slightly. Can we add this on buttonbar?

How much work would be required to enable multiple fisheye windows
to be spawned? Probably a lot, if pass times are to be recorded in the
SL list structures on a per-view basis.



g. GEOMVIEW INTERACTION

Under Cygwin, the large list structures used in writing footprints and
cones cause complaints about not being able to seek back far enough in
pipe. This appears to relate to how piping is handled under Windows;
an alternative to the oogl used in:
footprints.c::write_footprints_geom()
cones.c::write_cones_geom()
would be good to have. Footprints and cones are off by default to
avoid this problem.

Geomview binary format is only used in one place at present (the
default satellite marker if the architecture permits it), but
offers a scaling advantage. Note that e.g. Geomview 1.8.0 (Linux,
some glibc) has problems with handling binary format; selecting
a more complicated marker type than the default green dot avoids
use of binary format entirely, but an explicit option would be
better.

Rotation of satellite markers as they approach the poles is inaccurate;
detailed satellite solar panels should be at right angles to the ecliptic
and rotate to follow the sun (if there's a sun...), rather than pointing
east-west, in order to get maximum sunlight. That's reality; for
visualization, having panels at right angles to the planes
increases visibility - when the planes are drawn.
Could use inclination of orbit.

Make this unwieldy SaVi/Geomview combination run in root window under
Xscreensaver, in long tradition of overdone OpenGL hacks. To do that,
more command switches must be passed to SaVi through Geomview.

Can central blue sphere rendering be rotated so that lat/long
lines map to barely-visible rendering of sphere segments?
Can we draw latitude/longitude lines that rotate with the
central body as an option? This would be like Geomview's
'Draw Unit Sphere Projection' Camera menu option, but rotating
with the Earth.

Replace equatorial plane with more detailed sectored concentric
circles.

Can Geomview postscript output be improved and made useful by
tweaking SaVi's oogl? This probably requires work on Geomview.

Translucent surfaces (e.g. yellow selection cubes) may not
be that visible in some renderers.

Add a 'Sky view' rendering option that combines the following:
  - switches Geomview to spherical geometry, so we're looking
    out from the centre of the Earth;
  - turns off central body, so that we look through outline
    continents.
  - turns on footprints, turns off spotbeams.



h. DYNAMIC TEXTUREMAPPING WITH GEOMVIEW

Dynamic texturemapping is described in the file
README-COVERAGE-TEXTUREMAP
which can be found in the same directory as this README file.

Dynamic satellite coverage passing over the poles shows an interesting
'circle' effect where coverage diversity appears to be evaluated once
for the entire around-the-pole circular region. Look into this.

When detailed Earth is turned off and Geomview is drawing a simple blue
sphere, we could choose to show coverage sans map via a texturemapped
sphere sans Earth map.

gcc 3.3.5 (Debian) complains about our texturemap tmpfile strategy:
In function `coverage_tempfile_created':
: warning: the use of `tmpnam' is dangerous, better use `mkstemp'



i. VARIOUS

Improve time display, so that groundtrack drawing has useful
'elapsed time', and the time that the fisheye and coverage
displays are stopped can be easily read from their respective
windows. Average coverage display needs to count number of intervals
sampled, since time between intervals can be changed.

Allow switching between a set of default values for various planets
(e.g. Venus, Earth, Mars) with matching surface maps, and even a default
Constellations menu for each planet. Accurate gravitational models for
each planet would be useful.

Makefiles, header files and #include dependencies could be much better.
There's little attempt to optimise with judicious use of inlines,
but since we spend most of our time in the Tcl interpreter, gains
could be minimal. Adding -O2 in src/Makefile (and turning off -g debug)
has produced a smaller and faster executable.



j. INTERACTION WITH OTHER 3D RENDERERS

Are there other 3D renderers with piped input for which SaVi could
add support?



k. INTERACTION WITH OTHER SIMULATORS

network simulator ns - http://www.isi.edu/nsnam/

SaVi could generate output in a format suitable for Lloyd Wood's perl
ns satplotscripts. This really requires working intersatellite-link
functionality to be useful; satellite positions alone doesn't give
much unless you need a postscript map.

ns could write the simplest SaVi format that describes satellites
(the simple Tcl scripts that SaVi saves files as...) to allow SaVi
to show where ns satellites are. Over time the ns and SaVi simulations
will diverge, since SaVi has the more complex orbital model -
a simple model could be made an option in SaVi.

As of ns 2.1b8, the default ns output format for Lloyd Wood's perl ns
satplotscripts describes long/lat position, but does not include
orbital information such as altitude, making it useless for SaVi as
it stands. A new format is needed.



3. REMAINING INTEGRATION WORK FROM UNRELEASED SAVI 1.1
======================================================

This work requires detailed knowledge of relevant geometry,
satellite requirements, SaVi and Geomview in order to build on
Patrick Worfolk's efforts.

- Intersatellite link simulation in SaVi and Geomview - although
  this really needs a good scripting interface, and must also
  consider visibility, handoff, and configuration.

- Sunlight simulation for Geomview. An accurate terminator a la
  the coverage-panel-like sunclock would be nice; the sun can be
  thought of as a very distant satellite in an orbit inc 23.5 deg
  from an Earth-fixed frame of reference, and this has been
  simulated with a simple Tcl script. Problems with Geomview's
  lighting remaining consistent when the Earth is rotated in
  Geomview have prevented this being added to SaVi.
  (use of merge-ap instead of merge-baseap may be related here.)



4. THE ORIGINAL SAVI 1.0 WISHLIST
=================================

- A user manual!

- Ability to input satellite positions correctly in two-line-element
  format, allowing multiple satellites with different epoch
  times to be simulated correctly simultaneously.

- Incorporation of actual time into program so that the evolution
  of real satellites can be monitored.

- Ability to change lighting in 3D view to visualize night and day
  on the Earth and dynamic evolution of the sunlight.
  (This has been prototyped in Patrick Worfolk's unreleased SaVi 1.1.)

- Full incorporation of NORAD SGP4/SDP4 propagation models for
  NORAD two-line element sets for added realism.

- Additional map projections for the coverage display.
  (An unprojected map has since been added as of SaVi 1.2.2.)


Lloyd Wood <L.Wood@ee.surrey.ac.uk>
