本文整理汇总了C++中Mixer::get_trim方法的典型用法代码示例。如果您正苦于以下问题:C++ Mixer::get_trim方法的具体用法?C++ Mixer::get_trim怎么用?C++ Mixer::get_trim使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mixer
的用法示例。
在下文中一共展示了Mixer::get_trim方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
/*
* get_trims() has no effect except for the SimpleMixer implementation for which get_trim()
* always returns the value one and sets the trim value.
* The only other existing implementation is MultirotorMixer, which ignores the trim value
* and returns _rotor_count.
*/
unsigned
MixerGroup::get_trims(int16_t *values)
{
Mixer *mixer = _first;
unsigned index_mixer = 0;
unsigned index = 0;
float trim;
while (mixer != nullptr) {
trim = 0;
index_mixer += mixer->get_trim(&trim);
// MultirotorMixer returns the number of motors so we
// loop through index_mixer and set the same trim value for all motors
while (index < index_mixer) {
values[index] = trim * 10000;
index++;
}
mixer = mixer->_next;
}
return index;
}