I’m encountering an issue while integrating AirSim with Cesium in Unreal Engine 5. It seems that the AirSim and Cesium Georeference instance are misaligned by 90 degrees. To clarify, in order for the drone to fly at the correct location on the Cesium map based on GPS coordinates, I need to manually rotate the Cesium Georeference instance by 90 degrees in the Unreal Engine Editor. However, rotating the Georeference causes all objects using the Cesium Globe Anchor to be displaced.
Here’s a specific example with a no-fly zone I created (see attached image). In the image, the Cesium Georeference object is not rotated, and the no-fly zone is placed correctly based on the GPS coordinates specified for the Cesium Globe Anchor. However, when I command the drone to fly North using AirSim, it ends up flying East (or West) instead of North.
My current workaround is rotating the Cesium Georeference to align Cesium’s and AirSim’s coordinates systems, but this causes issues with all other objects placed with a Cesium Globe Anchor on the map. You can see in the following screenshot that the non-fly zone moves when the Cesium Georeference object is rotated.
Has anyone encountered a similar problem or know of a way to fix this misalignment without affecting other objects? I would expect the Cesium Globe Anchor to automatically adapt when Cesium Georeference is rotated, but it doesn’t seem to do so.
Hello, I just want to confirm that CesiumGlobeAnchor doesn’t work as expected.
When I have CesiumGlobeAnchor attached to the actor, I expect that the CesiumGlobeAnchor will do all the work for me in case Georeference is rotated. But it just don’t. I have a video attached showcasing the problem.
Is it a bug or an expected behaviour? How to get around it?
@Leane_Donze@nikkitta Thank you both for helping to identify this problem! I believe this comes down to a parenting issue. You see, when you rotate the CesiumGeoreference, you’re not actually rotating the georeference itself - you’re rotating its children. In @nikkitta’s example, the CesiumWorldTerrain tileset is parented to the CesiumGeoreference, while the Cylinder example object is not. So first the CesiumGlobeAnchor on CesiumWorldTerrain applies its transform, and then Unreal applies its transform, which is the 90 degree rotation. The Cylinder, not parented to the georeference, only receives the transform from the CesiumGlobeAnchor and not that 90 degree rotation.
I believe you can fix this using one of two options:
Parent the CesiumGlobeAnchor you want rotated to the CesiumGeoreference. This will mean the 90 degree rotation is also applied to it.
Create a new parent actor, without a CesiumGlobeAnchor attached, and give it the same 90 degree rotation. Then, parent the object with the CesiumGlobeAnchor to this new actor. This will result in the same outcome: first the CesiumGlobeAnchor transform is applied, then the rotation.