Fireline-Science / tello_sim

This is the repo for the DJI Tello simulator. The sim is targeted at students or classes who want to add simulation to a Tello project. Specifically, we are using it to have students program a path through an in-class obstacle course.
MIT License
36 stars 16 forks source link

CLI / TUI Interface #3

Open sean-schaefer opened 4 years ago

sean-schaefer commented 4 years ago

It would be cool to have a CLI interface for the simulator that can drive a more prescriptive, and richer, experience. One possible implementation could be using Click.

I'm envisioning a very thin wrapper around the existing commands. For example, you could execute the entrypoint into the "interactive" CLI mode, which would print out an introduction and provide some options. Like:

Hello, I'm your Tello simulator blah blah introduction...

Please select from an option below:
1. Takeoff
1. Load in map data (future feature)
... maybe other choices to setup the environment

Once you takeoff, the CLI (maybe it's a TUI at this point) moves into a loop with movement options, and termination options. E.g.:

Please select an from an option below:
1. Up
1. Down
1. ...More movement commands
1. Land
1. Reset
1. Deploy
1. Save Flight Plan

Once a user selects an option, it will ask for more data if necessary (how far do you want to move / turn) and then show a graph of the results if relevant to the command.

Click makes it nice to create submenus too, so if it becomes a lot of options maybe we could group things. Click also makes it fairly easy to support taking user input from command line flag as well as interactive user input, so we could potentially support a non-interactive, flag based experience.

I think the non-interactive option becomes more useful once you can ingest obstacle course data, because you can do things like pass in a series of commands to the CLI as well as the map data and have it simulate the entire experience, spit out graphs / stats and let you know if successful, i.e. the end position on the map was reached without running into an obstacle.

@azbones Thoughts?