JanWielgus / STM_FlightController

0 stars 0 forks source link

Rebuild the flight modes #31

Closed JanWielgus closed 4 years ago

JanWielgus commented 4 years ago

Old flight modes system was very inconvenient so I figured out the new way to implement it. This enables code reusability and makes flight modes simple.

Idea is as follows:

Flight modes now could be represented as a tree. Every flight mode should be based on other flight mode and extend its functionality (there are some base flight modes like stabilize that begin the tree). Every flight mode inherits from abstract FlightMode class to enable creating a pointer to the current one. Every flight mode adds its execute() method to the Tasker through the lambda expression (or override the () operator) [this part can change because there are some problems with Arduino and standard library for c++11 which enables std::function feature to store all function objects]

JanWielgus commented 4 years ago

STM_FilghtController_ClassDiagram v0 1

JanWielgus commented 4 years ago

There also will be a separate class called VirtualPilot. This class will manage all used flight modes and steer the whole vehicle.