mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-19 01:03:33 +08:00
Major formatting/whitespace cleanup
This commit is contained in:
@@ -63,7 +63,7 @@ float
|
||||
Mixer::get_control(uint8_t group, uint8_t index)
|
||||
{
|
||||
float value;
|
||||
|
||||
|
||||
_control_cb(_cb_handle, group, index, value);
|
||||
|
||||
return value;
|
||||
|
||||
@@ -224,29 +224,35 @@ mixer_load_multirotor(Mixer::ControlCallback control_cb, uintptr_t cb_handle, co
|
||||
|
||||
if (!strcmp(geomname, "4+")) {
|
||||
geometry = MultirotorMixer::QUAD_PLUS;
|
||||
|
||||
} else if (!strcmp(geomname, "4x")) {
|
||||
geometry = MultirotorMixer::QUAD_X;
|
||||
|
||||
} else if (!strcmp(geomname, "6+")) {
|
||||
geometry = MultirotorMixer::HEX_PLUS;
|
||||
|
||||
} else if (!strcmp(geomname, "6x")) {
|
||||
geometry = MultirotorMixer::HEX_X;
|
||||
|
||||
} else if (!strcmp(geomname, "8+")) {
|
||||
geometry = MultirotorMixer::OCTA_PLUS;
|
||||
|
||||
} else if (!strcmp(geomname, "8x")) {
|
||||
geometry = MultirotorMixer::OCTA_X;
|
||||
|
||||
} else {
|
||||
debug("unrecognised geometry '%s'", geomname);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return new MultirotorMixer(
|
||||
control_cb,
|
||||
cb_handle,
|
||||
geometry,
|
||||
s[0] / 10000.0f,
|
||||
s[1] / 10000.0f,
|
||||
s[2] / 10000.0f,
|
||||
s[3] / 10000.0f);
|
||||
control_cb,
|
||||
cb_handle,
|
||||
geometry,
|
||||
s[0] / 10000.0f,
|
||||
s[1] / 10000.0f,
|
||||
s[2] / 10000.0f,
|
||||
s[3] / 10000.0f);
|
||||
}
|
||||
|
||||
int
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
#define CW (-1.0f)
|
||||
#define CCW (1.0f)
|
||||
|
||||
namespace
|
||||
namespace
|
||||
{
|
||||
|
||||
/*
|
||||
@@ -167,17 +167,21 @@ MultirotorMixer::mix(float *outputs, unsigned space)
|
||||
pitch * _rotors[i].pitch_scale +
|
||||
yaw * _rotors[i].yaw_scale +
|
||||
thrust;
|
||||
|
||||
if (tmp > max)
|
||||
max = tmp;
|
||||
|
||||
outputs[i] = tmp;
|
||||
}
|
||||
|
||||
/* scale values into the -1.0 - 1.0 range */
|
||||
if (max > 1.0f) {
|
||||
fixup_scale = 2.0f / max;
|
||||
|
||||
} else {
|
||||
fixup_scale = 2.0f;
|
||||
}
|
||||
|
||||
for (unsigned i = 0; i < _rotor_count; i++)
|
||||
outputs[i] = -1.0f + (outputs[i] * fixup_scale);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user