-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GSoC 2015: Initial GPX support #2939
Conversation
It looks like in some cases the waypoints get the correct elevation (but the track stays on the ground) and in other cases the opposite happens (the track in the air and the waypoints are on the ground) It might just magically get fixed when you add the dynamic track code, but I wanted to let you know it was happening. The sample file I just emailed you shows it pretty well. |
Does course mean yaw? As in roll-pitch-yaw. These are not on the official GPX schema, I guess those are extensions but I could look into implementing these as well. That elevation bug is strange, I'll see if I forgot something related to coordinate reading |
About the elevation, on the sample file you've emailed me the waypoints don't have an elevation tag, so it is set to 0 as default. The track points (trkpt) have elevation, that's why the track floats in the air while the waypoints stay on the ground... I believe that's working as intended |
They are basically the same thing, but everyone has subtle differences, Cesium uses heading/pitch/roll. It looks like this data is specifically coming from ardupilot, which is an open source drone platform. I have a feeling it's pretty popular. If it's easy to add support for these fields, let's do it (we can always change it later). If you run into problems, then we'll skip it for now.
Okay, Google Earth has similar results, so I guess it's just a data problem. I'll probably play around with it at some point and see if we can improve anything. Let me know when the dynamic tracks are ready to look at. Do I have commit access to your fork? If not, would you mine giving it to me? I might make some final tweaks when we're done before things get merged so I want to have it just in case. |
I gave you commit access. My main issue with dynamic tracks is that in GPX the If all track points have a timestamp (# positions = # timestamps), the track is time dynamic. What do you think? |
That sounds like a good strategy to me. |
Source/DataSources/GpxDataSource.js
Outdated
|
||
//trk represents a track - an ordered list of points describing a path. | ||
function processTrk(dataSource, geometryNode, entityCollection, sourceUri, uriResolver) { | ||
var entity = getOrCreateEntity(geometryNode, entityCollection); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mramato, could you take a look at this function (processTrk)? Not sure why time dynamic tracks aren't working yet. What am I doing wrong?
You can use exampleTrk.gpx
as an example of a time dynamic track.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have entity.positions
instead of entity.position
on line 508.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'll also want to make sure that there's a default billboard for time-dynamic entities, so you see more than just the track.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, the time-dynamic track seems to be working now!
Hey @mramato I just added more tests, I think that test coverage is pretty good right now, can you look into it and tell me if I missed something? Other than that what is missing for us to wrap this up? Thanks |
Source/DataSources/GpxDataSource.js
Outdated
return undefined; | ||
} | ||
var hrefResolved = false; | ||
if (defined(uriResolver)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
uriResolver
is a left over from the KML code you copied, it's not actually used anywhere in this file and should be removed from all of the function signatures (along with this defined block). This also means that the hrefResolved
bool can be removed as well.
|
Done, managed to find and fix a couple of bugs while adding the missing tests. Thanks a lot! |
That's exactly why we write the tests 😄 |
Looking at heading/pitch/roll right now. A few questions: ´ I'm also assuming this orientation info is only relevant for time-dynamic tracks. |
I have this code (simplified to omit checks for defined,etc) to process the orientation on a single track point: function processOrientation(node){
var heading = defaultValue(CesiumMath.toRadians(queryNumericValue(node, 'course', namespaces.gpx)), 0.0);
var pitch = defaultValue(CesiumMath.toRadians(queryNumericValue(node, 'pitch', namespaces.gpx)), 0.0);
var roll = defaultValue(CesiumMath.toRadians(queryNumericValue(node, 'roll', namespaces.gpx)), 0.0);
var center = Cartesian3.fromDegrees(0.0, 0.0);
var quartenion = Transforms.headingPitchRollQuarternion(center, heading, pitch, roll);
var orientationProperty = new SampledProperty(quartenion);
...
} What should the default value be for each one of heading/pitch/roll and what do I do with the sampled property afterwards |
You assign it to |
Hey @mramato, what's needed to merge this? It will be hard for me to get orientation in before next weekend |
Does anyone in the community have the bandwidth to take this over the finish line? Twitter fame and Cesium swag await! 🥇 |
I merged this into a new I'm going to close this PR but anyone interested in taking this over the home stretch should use Thanks again for the original work @Andre-Nunes! |
I'm opening this PR right now to facilitate code reviewing. Most of the visual stuff is done.
There's still some things I need to work on, see below.
What's missing:
Please review so we can get this to a decent state ASAP