I am streaming position data (lat, lon) of an airplane into Google Earth via NMEA 0183 ($GPRMC, $GPGGA sentences) and it works OK (I generate and stream these from my own software). Now I would also like to stream attitude (roll, pitch, yaw) but I can't find any NMEA sentence for this, except proprietary vendor sentences which Google Earth seem to ignore.
In Google Earth, I selected Tools -> GPS -> Real Time -> NMEA
, but I haven't tried "Garmin PVT" yet as I can't find any reference to the protocol in connection with roll, pitch and yaw (found this document though).
Is there any way? I know .kml files can include this information, but I can't stream a .kml file into GE (only one-time import).
This is what I see now. Notice no pitch, roll or yaw data:
Roll, pitch and yaw:
Best Answer
I have given up on my original idea to stream NMEA into Google Earth.. and found a better solution!
I was able to solve this by programmatically generating KML file for each position and attitude change and then opening up an instance of Google Earth with the generated KML file as parameter. This is happening in 250ms loop which makes the transitions smooth. Also, Google Earth detects that another instance is already running and therefore it only loads the KML file.
Here is a capture:
I was able to accomplish generating of KML using C# and SharpKml software library. Here is a code example:
If you also want custom viewpoint of the model in Google Earth, instantiate LookAt object and assign it to
model.Viewpoint
.