views:

276

answers:

1

I am using the OrbitTools library to develop a satellite tracking system using the Bing Maps Silverlight control similar to http://karhukoti.com.

I am not knowledgeable in this domain and lack a lot of the information related to satellite tracking but have started teaching myself as this particular project was chosen by my supervisor as a graduation project.

However, i faced numerous difficulties, a major one is how to convert Two Line Elements (TLE) information to longitude latitude and altitude to display the satellite and satellite path on the map.

I tried the following C# code:

protected void DisplaySatellitePath(List<Eci> Pos)
{
  MapLayer myRouteLayer = new MapLayer();
  myMap.Children.Add(myRouteLayer);

  foreach (Eci e in Pos)
  {
    CoordGeo coordinates = e.toGeo();

    Ellipse point = new Ellipse();
    point.Width = 10;
    point.Height = 10;
    point.Fill = new SolidColorBrush(Colors.Orange);
    point.Opacity = 0.65;

    //Location location = new Location(e.Position.X, e.Position.X);
    Location location = new Location(coordinates.Latitude, coordinates.Longitude);

    MapLayer.SetPosition(point, location);
    MapLayer.SetPositionOrigin(point, PositionOrigin.Center);
    myRouteLayer.Children.Add(point);
  }
}

and also tried

protected void DisplaySatellitePathSecondGo(List<Eci> Pos)
  {
  MapLayer myRouteLayer = new MapLayer();
  myMap.Children.Add(myRouteLayer);

  foreach (Eci e in Pos)
  { 

    Ellipse point = new Ellipse();

    point.Width = 10;
    point.Height = 10;
    point.Fill = new SolidColorBrush(Colors.Yellow);
    point.Opacity = 0.65;

    Site siteEquator = new Site(e.Position.X, e.Position.Y, e.Position.Z); 
    Location location = new Location(siteEquator.Latitude, siteEquator.Longitude);
    MapLayer.SetPosition(point, location);
    MapLayer.SetPositionOrigin(point, PositionOrigin.Center);
    myRouteLayer.Children.Add(point);
  }
}

Can you please tell me what i'm doing wrong here? I searched the net for examples or documention about OrbitTools but with no luck.

I really hope that someone using this library could help me or suggest a better .NET library.

Thank you very much.

A: 

Is this still something you are struggling with? I noticed when I pulled down the code that they have a demo that they provide along with the library. In it they show the following method which I'm sure you must have looked at:

static void PrintPosVel(Tle tle) { Orbit orbit = new Orbit(tle); ArrayList Pos = new ArrayList();

     // Calculate position, velocity
     // mpe = "minutes past epoch"
     for (int mpe = 0; mpe <= (360 * 4); mpe += 360)
     {
        // Get the position of the satellite at time "mpe".
        // The coordinates are placed into the variable "eci".
        Eci eci = orbit.getPosition(mpe);

        // Push the coordinates object onto the end of the array
        Pos.Add(eci);
     }

     // Print TLE data
     Console.Write("{0}\n", tle.Name);
     Console.Write("{0}\n", tle.Line1);
     Console.Write("{0}\n", tle.Line2);

     // Header
     Console.Write("\n  TSINCE            X                Y                Z\n\n");

     // Iterate over each of the ECI position objects pushed onto the
     // position vector, above, printing the ECI position information
     // as we go.
     for (int i = 0; i < Pos.Count; i++)
     {
        Eci e = Pos[i] as Eci;

        Console.Write("{0,4}.00 {1,16:f8} {2,16:f8} {3,16:f8}\n",
                      i * 360,
                      e.Position.X,
                      e.Position.Y,
                      e.Position.Z);
     }

     Console.Write("\n                  XDOT             YDOT             ZDOT\n\n");

     // Iterate over each of the ECI position objects in the position
     // vector again, but this time print the velocity information.
     for (int i = 0; i < Pos.Count; i++)
     {
        Eci e = Pos[i] as Eci;

        Console.Write("{0,24:f8} {1,16:f8} {2,16:f8}\n",
                      e.Velocity.X,
                      e.Velocity.Y,
                      e.Velocity.Z);
     }
  }

In this it seems that they are making the conversion that you are looking for. Am I missing something as to what the problem is that you are actually having?

spinon