Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upClarification on the OriginGeopoint #2588
Comments
|
This looks like it's related to: PX4 HIL OriginGeopoint Issue (Airsim 1.2.2) #2575 I can see that it would be useful to be able to specify the GPS coordinates of either the origin of the Unreal level at (0,0,0) and/or of the PlayerStart Actor. Or maybe it would be even more useful to be able to place a special actor called something like OriginGeopoint in the level which would then use the |
|
I really like the actor idea! Something that you can place and then specify the lat/lon/alt in the editor? Otherwise if the actor is not present we can default to the current behavior. Could search the world actor list for our OriginGeopoint actor and if present would call origin_geopoint.initilize() again on the actor's location. But then would have to offset based on the player-start location. hmm... Plus I'm not sure what other code has run by the time it gets to the PawnSimApi::setStartPosition method that would rely on the origin_geopoint. |
|
@courageon Thanks! I was thinking you place the OriginGeopint Actor where you want it (either by hand or using the Transform widget to specify location in ue units). If the OriginGeopoint Actor exists in the level, use the GPS coordinates specified in the We're both thinking of it the same way. I don't know Unreal Editor APIs; can you add a widget or a section to the exiting Transfer widget only for the OriginGeopoint Actor to be able to specify lat/lon/alt, perhaps as a drop down in the Location section which currently has Relative and Absolute so add GPS?
So this would un-do the offset to the GPS coordinates that the PlayerStart offset code created? |
|
I used to do a fair amount of work in UE3, so I'm hoping at least the same things that were available in UE3 are available in UE4 as well (and from what I've read so far that's most definitely the case). Adding an editor actor is pretty straight forward, it'll come with all the transform widgets and basic attributes. You can then add on the extra attributes that you need. And IIRC I think you can tag those attributes with which category they belong under (like "Transform")
It won't undo the offset, the offset will just now be based from the OriginGeopoint actor instead of 0,0,0. Which should mean everything should just line up correctly. should But I'm not sure if we'll have to do an extra call to calculate the offset from the OriginGeopoint, since it's an assumed 0,0,0 right now, or if we can just set it and it magically line everything up. Either way, the goal would be to have the player start automatically geo-locate without any additional steps. |
|
Hello, If I have a point in unreal engine whose coordinates are (1000,2000,3000) Thank you for your help. |
|
@MiraYaziji,it not reach this point.you should read pawnsimapi.cpp,it will convert ue4 coordinate to airsim coordinate.or you can compulate offset related to self. |
|
Hello, |
|
Please note that I am using python APIs |
|
@MiraYaziji , |
|
@courageon want to work together on the |
|
Hi MiraYaziji,
This has been confusing to me as well until I read the following post that describes the relationship between Unreal Units and real-world measurements: This helped me to understand how to use the Your question is what should the value of the coordinates in the AirSim API be to move your drone to a specific location. The APIs use NED SI units (so meters). You need to convert between meters to UE units, and that conversion depends on what value is in your World to Meters setting (by default in Unreal 4.22 and later it's 100 I think). |
|
@MSBGit I've got a solution working for the origin geopoint actor. I may toss this over to you if you'd like to look into adding a flag to the settings file to allow switching between setting the geopoint at origin, or setting the geopoint at player-start. Right now I'm going on the premise of "if the OriginGeopoint actor exists in the level, then this level has been pre-designed for a specific location, use that location for geo-positioning in the level". In other words, it's hard-coded at that point and cannot be changed via settings file. But I could see the need to change it via settings file if you just wanted a geo marker pointed at a different location. Maybe add something in the settings file like "IgnoreOriginGeopointActor" or something? I had a heck of a time trying to track down where in the code to add an offset for the OriginGeopoint actor's location. What I wound up doing is re-basing the geo-location of the origin (0,0,0) based on the location of the OriginGeopoint actor. The same technique should work for re-basing based on the player-start location as well. Another thing that completely threw me off for a bit was the NED directions. In the UE's Level Composition this puts North facing left, and East facing up! But you can't tell once you start playing :) Oh, and how do you do collaboration on a branch in github? I've never done it before. Should I fork and push what I have then you fork that? Merge, then PR for master? |
|
@courageon wow, that's great! I'd love to test. Here's the page that describes how to contribute to AirSim: The project wants us to follow the C++ coding guidelines (style guide) and to file an issue first, which you did here. It looks like the workflow is to fork AirSim into your own github account rather than just creating your own branch in the AirSim repo, so I would follow those instructions: The beginner's guide to contributing to a GitHub project (note that this isn't the only way to contribute to a github project, it's the way that AirSim and other open source projects do their development workflow). Then I think I can clone your forked repo and create my own branch locally so I can build and test your changes myself.
I won't realistically be able to work on the source code for at least a week (but I can build and test immediately). I'm working on some pre-release MAVSDK issues that need to be resolved soon. I think your premise of "if the OriginGeopoint actor exists int he environment, then use that location for the initial GPS coordinates that are used". That way, existing users don't need to modify their settings file, they just have to place the OriginGeopoint actor where they want the GPS origin to be.
Could you handle that case by placing OriginGeopoint where you want it, and that wouldn't affect PlayerStart or the drone stating location? Or am I missing what you're trying to do here?
Does you mean you moved the origin of the map to OriginGeopoint, so that if I didn't have OriginGeopoint in my environment, the map would be based at some non-zero values, but if OriginGeopoint exists, the map would be based at 0,0,0?
Interesting. I am setting and getting NED position of my virtual drone using MAVSDK (the getting NED API is what's I'm working on testing since it's not available in MAVSDK master). I'll verify what NED in MAVSDK/PX4 space means compared to what it means in Unreal. |
|
Hi MiraYaziji,
Try this, this assumes World to Meters is 100:
|
|
Okay, Thank you @MSBGit @obitodaitu. |
|
To add the object in unreal engine, I just adjust its coordinates? And then what should I do, I click on build or build lighting or what else? |
This kind of question would be better asked in the Unreal forums since it's not really an AirSim issue. |
|
@courageon how's things going with the Origin Geopoint changes? |



There seems to be conflicting data on what the "OriginGeopoint" is. In the documentation it's referenced as the location of the PlayerStart while in code it's commented as the coordinates of Unreal level at the coordinates 0,0,0.
Code:
AirSim/AirLib/include/common/AirSimSettings.hpp
Line 350 in e24a11d
Documentation:
https://microsoft.github.io/AirSim/settings/#origingeopoint
Which leads into my larger question of what would need to be modified in-code, or otherwise to correspond an arbitrary point in Unreal to a specified lat-lon-alt?
Thanks!
Edit:
From what I've tested it seems to be the lat/lon/alt of the Unreal level at 0,0,0, but would still like some confirmation on this, in which case we should update the documentation for now :)