swri-robotics / marti_common

Common utility functions for MARTI
BSD 3-Clause "New" or "Revised" License
54 stars 63 forks source link

[Foxy] swri_transform_util: UTMTransformer and Wgs84Transformer do not initialize correctly in transform_manager #620

Closed jonselling closed 2 years ago

jonselling commented 3 years ago

When initializing the transform manager, the Wgs84Transformer and UTMTransformer seem to fail when initializing:

[ERROR] [1621902479.930763076] [swri_transform_util::Transformer]: UtmTransformer::Initialize: No LocalXyWgs84Util has been set!
[ERROR] [1621902479.930777221] [swri_transform_util::Transformer]: Wgs84Transformer::Initialize: local_yx_util was unset!

I believe it is because each of them check that the local_xy_util_ pointer is not null and that check fails. Here is the UTM transformer check.

The Initialize() function is called from the Transformer parent class's Initialize function here.

The local_xy_util_ pointer isn't set until after that function is called.

As a side note, those transformers do accept a local_xy_util pointer in their constructor, but they are set to null

danthony06 commented 3 years ago

It kind of looks like the same issue that was raised here:

https://github.com/swri-robotics/marti_common/issues/619

jonselling commented 3 years ago

You are correct from looking at the issue, but I feel like the resolution could easily be to change the order of the code in the Transformer's Initialize() function. There is really no reason to print an error for something that could be / is initialized shortly afterward.

danthony06 commented 2 years ago

@agyoungs have you ran into this?

jonselling commented 2 years ago

I believe this will get fixed once #666 gets merged (due to re-ordering of the Transformer::Initialize() function)

danthony06 commented 2 years ago

Resolved via: https://github.com/swri-robotics/marti_common/pull/666