KNOWN BUGS IN SaVi
==================
# $Id: BUGS,v 1.64 2006/07/17 06:29:40 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. Remaining items from 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 and be consistent across all views. See
Kantsiper and Weiss, An Analytic Approach to Calculating Earth Coverage,
AAS 97-620, while they were at MIT, for an analytical integration
approach using the inclusion/exclusion principle.

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 may need 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.

- Under cygwin, specifying -mno-cygwin to gcc in src/Makefile in
  order to build using MinGW generates errors. We're a long way from a
  standalone Windows executable.

- $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

A user manual has been written and placed in the manual/ directory,
but more detail is needed.

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 overriding 'Show all {satellites | orbits | coverage }'
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'.

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.

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? Enter negative number to project
backwards.

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 in cylindrical view. 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.

Coverage map does not immediately update if a satellite or coverage
area is hidden in the Edit dialog.


f. FISHEYE VIEW IMPROVEMENTS

Having new parameters in textboxes at top while having to press button
at bottom is confusing. Lower textboxes; print current coordinates in
corner of fisheye.

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

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 would be 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 BUGS 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. This may be dependent
on Geomview rendering options.

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.

Coverage texturemap is not immediately updated when turning 'project
groundtracks forward in time' on or off, so it is out of sync with
coverage window until next animation step.

SaVi should write to and tell Geomview to read from multiple tmpfiles
alternately, so that SaVi is writing one tmpfile while Geomview is
reading from the other. This would improve handling of large
uncompressed texturemaps by preventing interruption of reads as the
read file is overwritten by the next texturemap iteration.
(This property is arguably a failing in unix filesystem design.)

gcc 3.3.5 (Debian) and 3.4.4 (FreeBSD) complain 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. REMAINING ITEMS FROM THE ORIGINAL SAVI 1.0 WISHLIST
======================================================

- 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.


Lloyd Wood <lloydwood@users.sourceforge.net>
