microsoft / AirSim

Open source simulator for autonomous vehicles built on Unreal Engine / Unity, from Microsoft AI & Research
https://microsoft.github.io/AirSim/
Other
16.39k stars 4.57k forks source link

😀how to use the API of AirSim to get the distance from other vehicles added in Unreal 4, road boundaries, and lane center lines to the vehicle? #3835

Closed Liuzy0908 closed 3 years ago

Liuzy0908 commented 3 years ago

Question

What's your question?

In UE4, how to use the API of AirSim to get the distance from other cars added in Unreal 4, road boundaries, and lane center lines to the car? anybody could do that to help me?😀

Include context on what you are trying to achieve

As far as I know, the API of AirSim provided by Microsoft is limited, and I cannot simply implement the functions mentioned above with python. Now I am using Unreal 4 engine for scene development to make it easy to obtain the data needed in reinforcement learning, but the method of obtaining the above data is urgently needed. The idea that I can think of is to use the blueprint function in Unreal 4, but it is too complicated and cumbersome.

Context details

Include details of what you already did to find answers

jonyMarino commented 3 years ago

Hi and welcome @Liuzy0908! You can get the object position with simGetObjectPose() and then get the car position with getVehiclePose() and calculate the absolute distance between the two of them.