New top story on Hacker News: Flying planes with a JavaScript autopilot (2023)

Flying planes with a JavaScript autopilot (2023)
10 by TheRealPomax | 0 comments on Hacker News.
A (lengthy!) tutorial on how to write your own JS-based autopilot code to fly planes in Microsoft Flight Simulator with a web page to both visualize the flight and control the AP. Note that this is a complete do-over of a previous page that used a combination of Python and JavaScript, and only covered basic autopilot functionality. This rewrite threw all of that out, and goes much, much further: you just want to have the plane take off without having to do anything? Check, this tutorial covers auto-takeoff. Flying with waypoint-based navigation, not by "programming airports and radio beacons one letter at a time with a jog-dial" but by just placing markers on a map and dragging those around as you please, mid-flight, Google Maps style? Check. After all, why would we not, putting a map on a webpage is super easy (barely an inconvenience). In fact, let's throw in flight plan saving and loading, so others can fly the same route! And maybe you want the plane to fly a fixed distance above the ground, instead of at a fixed altitude... well: check. You'll learn about terrain-follow using free Digital Elevation Model datasets for planet Earth. And of course the big one, for the ultimate "click button, JS flies the plane start to finish" experience: ever wished the in-game autopilot could just land the plane for you? Well, it's a video game, and we know programming, so: why not? We're also implementing auto-landing and it's going to be amazing. If you play MSFS, and you're a developer/programmer, and you've always thought how cool it would be if you could just do some scripting for it... you can, there's a lot of cool stuff you can do! And of course if you don't want to follow along and just want to have everything set up and ready to fly your plane, just clone https://ift.tt/pWo0nvF and have fun.

Comments

Popular posts from this blog

Northeastern US braces for foot of snow during first days of December

North Korea test fires two missiles month before deadline for US to respond on talks

Democratic debate winners and losers: Elizabeth Warren triumphs while Beto O'Rourke flounders