-
Notifications
You must be signed in to change notification settings - Fork 98
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
Add GPS / NavSat sensor to sdf9 #453
Conversation
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.
Thank you for the contribution! This is going in a good direction, but the API needs to be updated to match the XML spec.
Also, please also add a test for the GPS to test/integration/link_dom.cc
, similar to the IMU tests there. This should cover the code path from XML to C++.
I seem to have broken the DCO by using the github auto-edit feature, but each of the commits should be signed off.
|
Codecov Report
@@ Coverage Diff @@
## sdf10 #453 +/- ##
==========================================
+ Coverage 87.78% 87.81% +0.02%
==========================================
Files 62 63 +1
Lines 9577 9672 +95
==========================================
+ Hits 8407 8493 +86
- Misses 1170 1179 +9
Continue to review full report at Codecov.
|
How would you feel about changing this to be something like |
We could add NavSat and keep supporting GPS for a while as legacy, like we're doing for the ray sensors: |
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.
I just have minor comments, this is looking good to me.
What do you think of the NavSat idea, @Dotrar ? You'd need to change the new class to sdf::NavSat
, as well as the enum... As a reference, see how lidar / ray sensors are implemented.
Yeah no worries; I'll see if i can track down all references and change it to NavSat should it be as easy as a s/Gps/NavSat/g ? also I'll put in those other changes soon. |
Thanks! You may also need some |
Hi @Dotrar , are you planning to follow up on the NavSat idea? Thanks! |
yes, Sorry I'm being a little slow here, all sorts of stuff going on; I'll make sure I get this done soon. |
Hey @chapulina ; I've changed GPS to SATNAV, but I'm not sure if I went too far with changing stuff like the enum in Sensor.hh https://github.com/osrf/sdformat/blob/master/include/sdf/Sensor.hh#L72 do you want to see if I've got this right? I did try to copy the ray/lidar example but I don't know if that includes in the enum, as there isn't a also I think I've buggered up the commit log a little when I committed without signing then went back trying to sign previous commits; do you mind if I nuke this PR and write it all into a new one? or is this recoverable/not a huge drama? |
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.
Thank you for iterating! This is looking good!
I've changed GPS to SATNAV
Would it be possible to use NAVSAT
everywhere instead of SATNAV
?
I did try to copy the ray/lidar example but I don't know if that includes in the enum, as there isn't a RAY in the enum.
I think that one predated the enum, so we never added it. For GPS, let's keep it there for backwards compatibility. We can remove it in a future version.
do you mind if I nuke this PR and write it all into a new one? or is this recoverable/not a huge drama?
I'm fine with creating a new PR. This should be recoverable though. Try rebasing your branch onto sdf10
and make sure the signature is in every commit's comment. Alternatively, you can squash all commits into one and only sign that one.
I think we should add a navsat.sdf
file too, which is a copy of gps
. Like we have both ray.sdf
and lidar.sdf
.
@chapulina and @scpeters: I have addressed the latest review comments, and believe that this is ready for final review!
Done in b128c9c. Some files had to be re-named, so apologies if it's a bit of a pain to review these changes 😬
I added this in b128c9c. I also updated Regarding DCO: once final reviews are done and this PR has been approved, I can try to fix the Git history so that DCO will pass. |
Can I ask why Navsat is preferred over Satnav? The latter seems more generic to me. |
I think the original motivation came from #453 (comment). Maybe @mjcarroll or @chapulina can give their thoughts? |
Good question, Satellite Navigation refers to the navigation system, while to me "Navigation Satellite" seems to refer to the specific device, i.e. sensor, being used. But what motivated my original request was the equivalent ROS message sensor_msgs/NavSatFix. ROS messages are widely used and usually receive a lot of scrutiny (like the recent API review) so I think it's usually a good idea to follow their patterns unless we have a good reason not to. That said, I don't feel too strongly about this after giving it more thought. If there's enough interest in keeping SatNav I'm ok with that. |
Ah, I didn't know about |
If it helps at all, NAVSAT was the precursor to GPS https://en.wikipedia.org/wiki/Transit_(satellite) |
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.
The code looks good. I think it can go into sdf9
though.
Signed-off-by: Dre Westcook <[email protected]>
Co-authored-by: Louise Poubel <[email protected]> Signed-off-by: Dre Westcook <[email protected]>
Signed-off-by: Dre Westcook <[email protected]>
Signed-off-by: Dre Westcook <[email protected]>
Signed-off-by: Ashton Larkin <[email protected]>
Signed-off-by: Ashton Larkin <[email protected]>
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.
Rebased to sdf9
, LGTM!
Here is a basic GPS implementation built on SDF10
this is related to the following issue: gazebosim/gz-sensors#23 as the GPS sensor will need an SDFormat to go with it.
I copied / got inspired by the code in the imu and altimeter sensors, but I only made a single noise component for both position and velocity.
Hope this suits. I couldn't find a way to squash all of my commits into the 1 result. But if this is accepted then it can just be squashed at merge.