Skip to content

Commit

Permalink
[docs] Move Orbit Wiki page
Browse files Browse the repository at this point in the history
  • Loading branch information
rajat2004 committed Jun 26, 2020
1 parent 34bb394 commit d9e6e3a
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
Binary file added docs/images/orbit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions docs/orbit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# An Orbit Trajectory

Moved here from https://github.com/microsoft/AirSim/wiki/An-Orbit-Trajectory

Have you ever wanted to fly a nice smooth circular orbit? This can be handy for capturing 3D objects from all sides especially if you get multiple orbits at different altitudes.

So the `PythonClient/multirotor` folder contains a script named [Orbit](https://github.com/microsoft/AirSim/blob/master/PythonClient/multirotor/orbit.py) that will do precisely that.

See [demo video](https://youtu.be/RFG5CTQi3Us)

The demo video was created by running this command line:

```shell
python orbit.py --radius 10 --altitude 5 --speed 1 --center "0,1" --iterations 1
```

This flies a 10 meter radius orbit around the center location at (startpos + radius * [0,1]), in other words, the center is located `radius` meters away in the direction of the provided center vector. It also keeps the front-facing camera on the drone always pointing at the center of the circle. If you watch the flight using LogViewer you will see a nice circular pattern get traced out on the GPS map:

![image](images/orbit.png)

The core of the algorithm is not that complicated. At each point on the circle, we look ahead by a small delta in degrees, called the `lookahead_angle`, where that angle is computed based on our desired velocity. We then find that lookahead point on the circle using sin/cosine and make that our "target point". Calculating the velocity then is easy, just subtract our current position from that point and feed that into the AirSim method `moveByVelocityZ`.
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ nav:
- "Moving on Path Demo": 'https://github.com/Microsoft/AirSim/wiki/moveOnPath-demo'
- "Building Point Clouds": 'https://github.com/Microsoft/AirSim/wiki/Point-Clouds'
- "Surveying Using Drone": 'drone_survey.md'
- "Orbit Trajectory": "orbit.md"
- "Misc":
- "AirSim on Real Drones": 'custom_drone.md'
- "Installing cmake on Linux": 'cmake_linux.md'
Expand Down

0 comments on commit d9e6e3a

Please sign in to comment.