From: Chuck K. <chu...@ya...> - 2009-03-25 02:46:12
|
All, I am using version 1.7.15 of OSSIM planet for Windows. I have written a little program in C# to play back a list of way points in OSSIM planet. Basically, my program controls the OSSIM planet view by making repeated use of the "FlyTo" socket message command. The idea here is to have the cursor follow a road on my terrain view. So, everything starts working well in the beginning -- the cursor flies to the correct point and then you see the cursor follow the way points that I setup. However, the initial altitude is off -- my XML message commands OSSIM Planet for an altitude of 250, but OSSIM shows an altitude of about 2400. But the worse part is that as the program continues to run, the altitude gets lower and lower until the screen goes black and the OSSIM Alt reading is NaN. When my C# program finally stops sending "FlyTo" messages, the OSSIM planet display returns to an altitude of 2400 ft, and the cursor is placed at the last way point that I intended. As you can see from the code, I put a one second delay between transmissions of the "FlyTo" message, so I wouldn't think I was sending messages too fast or anything. Also, I'm using TCP, not UDP (using type Data rather than Navigation). Is this a bug, or am I doing something wrong? The code snippet follows: private void play(object sender, RoutedEventArgs e) { string line; string latitude = null, longitude = null; Regex r = new Regex("(.+),(.+)"); StreamReader freader = File.OpenText("waypoints.dat"); int i = 0; while ((line = freader.ReadLine()) != null) { Match m = r.Match(line); if (m.Success) { latitude = m.Groups[1].Value; longitude = m.Groups[2].Value; } else { MessageBox.Show("Unexpected value in the waypoints file"); } networkStreamWriteLine("<FlyTo target=\":navigator\">"); networkStreamWriteLine("<LookAt>"); networkStreamWriteLine("<longitude>" + longitude + "</longitude>"); networkStreamWriteLine("<latitude>" + latitude + "</latitude>"); networkStreamWriteLine("<altitude>250.0</altitude>"); networkStreamWriteLine("<heading>0</heading>"); networkStreamWriteLine("<pitch>0</pitch>"); networkStreamWriteLine("<roll>0</roll>"); networkStreamWriteLine("<altitudeMode>clampToGround</altitudeMode>"); networkStreamWriteLine("<range>250.0</range>"); networkStreamWriteLine("</LookAt>"); networkStreamWriteLine("</FlyTo>"); if (i == 0) Thread.Sleep(5000); else Thread.Sleep(1000); i++; } } |