multiwii/baseflight — pull request #205 by schugabe (2014-11-20 17:15:53+00:00)
Title: New Servomixer

This PR replaces the old servo mixing with a new mixer. It unifies the servo mixing to a general rule based servo mixing. For the default mixers the rules are preset - for the new custom plane mixer the user can change the rules via cli (command csmix).

Each rule adds a certain input (with a rate/speed/min/max/direction setting) to a servo. A simple example would be a aileron with flaperon support: two rules are needed. One for mixing in the roll input and one for mixing in a AUX channel. Examples can be seen in mixer.c

The servo direction for pitch/roll/yaw was encoded in the rate field. This has been replaced by a direction field that defines how a servo reacts to a input (can be modified with the servo_direction command).
To be compatible with the current configurator I implemented a function that translates the old rate encoded direction setting to the new storage.

Each rule has a min/max limit, can be speed limited and has a rate so the influence of the input can be configured. Additionally the rules can be activated/deactivated with boxes e.g. during RTH no flaps should be used => the flaps rules can be deactivated via the boxes.