Jump to content
The simFlight Network Forums

Kent

Members
  • Posts

    5
  • Joined

  • Last visited

Profile Information

  • Gender
    Male
  • Location
    Philadelphia PA

Kent's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. I'm writing an interface to Garmin Pilot, the 3rd party apps out there didn't work well for me. All the positional data works fine, working on traffic and AHRS now, if GP supports it (still unsure if it even does... need someone with X-Plane to tell me if it does). I started looking at the GPS offsets to calculate the true groundtrack to feed to GP. After that I started taking a look at all of the other GPS offsets and comparing them to the non-GPS offsets for the same purpose. I started to consider if I should use all of the GPS offsets to Garmin Pilot so it more closely replicates GPS on the virtual aircraft. I decided my iPad updates at 10Hz IRL rather than 1Hz (with bluetooth GPS), so decided to send data to Garmin Pilot at 10Hz... but may change my mind again if this is plane-specific. (C# ground speed) this.groundspeed = Math.Round((((double)this.offGroundSpeed.Value) / 65536.0), 3); // 0x2b4 preferred var gs = Math.Round(this.offGpsGroundspeed.Value, 3); // 0x6030 only updates once/sec in tests.. not used (C# ground track) var variation = radiansToDegrees(offGpsMagneticVariation.Value); var magTrack= Math.Round(radiansToDegrees(offGpsMagneticTrack.Value),4); this.track = Math.Round(radiansToDegrees(offGpsMagneticTrack.Value) + variation, 4); I'll try giving a couple other planes a test and see what happens. Thanks!
  2. Wow I feel dumb. Apparently I copied the length into the offset name by accident and was reading the entirely wrong data! Figured it out right before I saw your post. Yes C# supports structures. My code is a simple test method to read/parse the data. It's very easy to convert it to assigning variables on a structure. The style of tracking the index as an iterator after each read is so that if I make a mistake in the length of any one field I don't have to rewrite the offsets manually. Perfect for when reading data sequentially. Code is cleaner (and way faster) in than using a binary stream reader. private Offset<byte[]> airborneTraffic = new Offset<byte[]>(0x3840, 3840); // AI airborne aircraft traffic data (same format as the entry for E080) should have been: private Offset<byte[]> airborneTraffic = new Offset<byte[]>(0xF080, 3840); // AI airborne aircraft traffic data (same format as the entry for E080) Thanks!
  3. XOFSX2GP doesn't send AHRS or Traffic data to garmin pilot. Also has a wobble that makes it useless for determining direction. you can write your own application without too much difficulty interfacing with FSUIPC
  4. Hi Pete, Quick question. I have been comparing the outputs of the following two offsets. My application processes FSUIPC data at 10Hz. 0x2b4 seems realtime (expected), and the GPS version 0x6030 seems updated every 1 second. Is the GPS update frequency coming from the virtual GPS installed to the current plane, a generic fixed amount assigned to all aircraft from P3d/FSX, or is it an update limit placed on the value from FSUIPC? (Also note: I am using WideClient for this test). private Offset<int> offGroundSpeed = new Offset<int>(0x2b4); // GS: Ground Speed, as 65536*metres/sec. Not updated in Slew mode! private Offset<double> offGpsGroundspeed = new Offset<double>(0x6030); // GPS: aircraft ground speed, floating point double, metres per second. Thanks! Kent
  5. Hey Pete, I have a C# application interfacing with WideClient. I'm able to read data just fine, however I am running into some problems reading traffic data. Setup: Prepar3d 3 with Ultimate Traffic 2 installed & running. FSUIPC installed running WideServer. Seperate computer runs WideClient & C# application. When running the simulator with UT2 there are maybe 50 or more AI aircraft loaded. The TCAS data I read seems unusable, no field is coming through as useful. I wonder if AI traffic is not transmitted to WideClient. When I view the raw bytes, for example, the first 8 or so are all 0. As I scroll through the raw data there are occasional bytes with values - however I can't find any 40-byte block that does not contains enough data to decode to anything useful. If you need I can reply with a screenshot of the raw byte data. My test method is as follows: private Offset<byte[]> airborneTraffic = new Offset<byte[]>(0x3840, 3840); // AI airborne aircraft traffic data (same format as the entry for E080) private void ProcessTraffic() { var t = airborneTraffic.Value; // (96x 40 byte array) for (int i = 0; i < 3840; i += 0) { // TCAS DATA var id = BitConverter.ToInt32(t, i); i += 4; // 0 = empty, otherwise this is an FSgenerated ID.FSUIPC makes this negative to distinguish FS entries from user added ones var lat = BitConverter.ToSingle(t, i); i += 4; var lon = BitConverter.ToSingle(t, i); i += 4; var alt = BitConverter.ToSingle(t, i); i += 4; var hdg = BitConverter.ToInt16(t, i); i += 2; var gs = BitConverter.ToInt16(t, i); i += 2; var vs = BitConverter.ToInt16(t, i); i += 2; var idAtc = Encoding.ASCII.GetString(t, i, 15).ToString(); i += 15; var bState = BitConverter.ToBoolean(t, i); i += 1; var com1 = BitConverter.ToInt16(t, i); i += 2; } } So question is, is my test method way off base, or is AI traffic not transmitted to WideClient? Thank you! Kent
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.