Finding Lat/Lon/Alt of object, not x,y,z coordinates

I’m working to collect images at different locations along a flying route in Python (in “computer vision” mode, if it matters). I feel like there should be some built in function for finding the latitude, longitude, and altitude of the user object as it moves, not just the x,y,z like I’m able to do. I see how it’s set and changed in the GeoReference panel on the right while editing, but not while actually moving while running.
Thanks in advance for the help!

Hi @Juliette_Spitaels, welcome to the community.

I’m not very familiar with Python, but in Unreal you can access the lat/long/height in C++ or Blueprint during play.

If you’re using Blueprint, here’s an example of how you might access it -

In the Level Blueprint, you’ll need a reference to the CesiumGeoreference and your user object (here I used DynamicPawn). Then, you can use the Inaccurate Transform UE to Longitude Latitude Height node to convert the UE coordinates. From there, you can print the coordinates or do whatever you need with them.

Let me know if this helps.
-Alex

Hi Alex,

This seems like it could be what we need. I’m not familiar with the Blueprint or the DynamicPawn. Could you explain more about what those are and how to use them? And how could we use code to access and print these values.
We’re also doing this with AirSim, which might be the source of our complications.

Thanks so much,
Juliette

Hi again Alex! We worked our way through a Blueprint tutorial and it did exactly what we needed for flight path! So we want to follow up this now with information about if there’s a way to take and save pictures/video from the perspective of the DynamicPawn.
This is why we started with using AirSim, since the video and images is one of it’s main features, but it seems like it wasn’t very compatible with cesium’s Georeferencing. IS there a way to cut out AirSim and do it all with Cesium and Unreal?

Hi Juliette,

Glad to hear that using Blueprint is working for you!

I’ve never used AirSim, so I’m unfortunately not very familiar with it. By default, I believe the only available tool for capturing screenshots in Unreal is the High Resolution Screenshot tool. It seems to be editor-only, though, and not triggerable from code or blueprint, so that may not work for your use case. Another option is following this tutorial. I haven’t followed it myself but it seems like a thorough walkthrough of the process in a C++ project.

I’d like to know a little more about the issues with AirSim and georeferencing, though. Could you describe the problems you’re seeing? We’d like the Cesium for Unreal plugin to be compatible with other plugins, so it would be great to know the scope of the issues so we can try finding a fix.

-Alex

Hi Alex! It seems like an issue where AirSim has a Cartesian coordinate system that seems to auto generate 0,0,0 at the point of spawning, not null island like WGS-84. I’d love to talk to you more about this issue, and get my project group in on the conversation. Is there a way we could set up a time to talk in real time?

Hi Juliette,

I’m not familiar with AirSim at all, but I can try it out a bit next week. If you can provide an overview of your project and a list of questions from your team, I’ll do some research and speak with my coworkers and we can evaluate the need for a call after that. Feel free to DM me if you’d prefer to share details of your project privately.

-Alex