swri-robotics / gps_umd

BSD 3-Clause "New" or "Revised" License
88 stars 94 forks source link

Add UTM zone to frame_id; added reverse_utm_odometry_node #6

Closed dheera closed 5 years ago

dheera commented 7 years ago

Adding the UTM zone to the frame_id (e.g. frame_id/utm_10S) ensures that no data is lost (i.e. odometry message is self-contained) when conversion is made from NavSatFix to Odometry. This also helps differentiate Odometry data that can be theoretically specified in two different ways in overlapping UTM zones.

Also added a reverse_utm_odometry_node that reverses the UTM odometry data back into a NavSatFix which is extremely useful for NavSatFix-compatible map visualization tools to be able to directly visualize Odometry data in UTM format.

kriskozak commented 7 years ago

I don't know who all might be using the utm_odometry_node, so I would recommend not changing the default behavior. Adding a parameter, that defaults to false, to append the zone in the frame_id would probably be sufficient.

Also, the purpose of the reverse_utm_odometry_node was not obvious to me from the name. I would recommend a name like utm_odometry_to_navsatfix_node, which is clearer though a little wordy, instead.

dheera commented 7 years ago

@kriskozak Thanks for the feedback! I use utm_odometry_node, and store data in UTM coordinates. But an example of why reversing the UTM back to NavSatFix is useful:

I called it 'reverse_' because it does exactly the opposite of utm_odometry_node. I'm open to calling it utm_odometry_to_navsatfix_node or anything else, but then shouldn't we then call NavSatFix->Odometry utm_navsatfix_to_odometry_node for consistency?

I like the idea of appending the zone as optional parameter to maintain backward compatibility. But in that case we should allow the reverse node to specify a fixed UTM zone as a ROS parameter (in case the user chose not to append it to the frame_id). Let me know your thoughts!

kriskozak commented 7 years ago

@dheera I understand and agree with the usefulness of the node, I just object to the name. I agree with your comment about the symmetry of the naming, but at this point utm_odometry_node has existed with that name for 7 years, so it doesn't make sense to change it now.

The reason that I object to the name is that reverse made me think of reversing direction rather than reversing a process (so the purpose wasn't clear until I read your explanation). If I understand it correctly, the node's function is to convert Odometry messages in a UTM frame to NavSatFix messages, so calling it utm_odometry_to_navsatfix_node (or utm_odometry_to_navsatfix the _node suffix is not really necessary except that it parallels the suffix for utm_odometry_node) is clearer as to its purpose.

Finally, it occurs to me that you may should probably also consider two other issues:

  1. Appending only zone leaves an ambiguity about whether the coordinate is northern or southern hemisphere (perhaps also appending N/S or appending Band letter would be appropriate).
  2. You may want to add a "zone" (and N/S or band) parameter to the reverse_utm_odometry_node to make it possible to determine latitude in the event that that info is not in the field of the utm_odom message.
dheera commented 7 years ago

@kriskozak Good points! I'll fix these over the weekend.

dheera commented 7 years ago

@kriskozak @pjreed I have made the following requested changes:

Please review. Thanks!

pjreed commented 7 years ago

Pinging @kriskozak , did you ever have a chance to look at this?

kriskozak commented 7 years ago

Thanks for the reminder. I have not had a chance to test it, but the changes to utm_odometry_node.cpp appear to give the desired behavior without changing the default behavior. Even though it's a simple and straightforward change, I would prefer to see it tested before merging, but @pjreed, if you want to make a call, feel free. I will give it a go later, if I get the chance, but you may be pinging me again in a month ;-).

The utm_odometry_to_navsatfix_node.cpp looks fine, but also not tested -- I'm fine with merging this one without testing, though.

dheera commented 6 years ago

Any update on this? Thanks!

kriskozak commented 6 years ago

Sorry about the massive delay on this. See the one comment about the default value of the append_zone parameter.