microsoft / AirSim

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

How to set the route? #3895

Closed h-zhichao-w closed 3 years ago

h-zhichao-w commented 3 years ago

Question

What's your question?

With some existing functions, drones can be ordered to move from one point to another point, or move by a certain velocity for a duration. But how can I make the drones move along the route I set?

Include context on what you are trying to achieve

For example, if I order the drone to move from (0, 0, -5) to (5, 5, -5), it will basically move along the line which connects the two points (regardless of the movement in Z axis). If I want the drone to move along a curve (just imagine the Dubins, for instance), and the formation of the curve is already known, what should I do?

Context details

Windows 10, airsim 1.5.0, Unreal Engine 4.26, Python 3.8

Include details of what you already did to find answers

I tried to write a loop, in which I ordered the drone to move step by step, eventually form the curve I wanted. However, under that circumstance, the movement was no longer continuous, and the state of the drone I got was no longer accurate.

AbdullahK047 commented 3 years ago

You might find the method moveOnPathAsync() helpful. Just pass in the path as a list of Vector3r's and the method will follow them using a carrot-following algorithm.