mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-18 03:52:11 +01:00
OP-975 change BoardRotation data type to float so it can be used for level calibration
This commit is contained in:
parent
1f0885dd4f
commit
1fe591d51e
@ -693,8 +693,9 @@ static void settingsUpdatedCb(__attribute__((unused)) UAVObjEvent *objEv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Indicates not to expend cycles on rotation
|
// Indicates not to expend cycles on rotation
|
||||||
if (attitudeSettings.BoardRotation.Pitch == 0 && attitudeSettings.BoardRotation.Roll == 0 &&
|
if (fabsf(attitudeSettings.BoardRotation.Pitch) < 0.00001f &&
|
||||||
attitudeSettings.BoardRotation.Yaw == 0) {
|
fabsf(attitudeSettings.BoardRotation.Roll) < 0.00001f &&
|
||||||
|
fabsf(attitudeSettings.BoardRotation.Yaw) < 0.00001f) {
|
||||||
rotate = 0;
|
rotate = 0;
|
||||||
|
|
||||||
// Shouldn't be used but to be safe
|
// Shouldn't be used but to be safe
|
||||||
|
@ -458,8 +458,9 @@ static void settingsUpdatedCb(__attribute__((unused)) UAVObjEvent *objEv)
|
|||||||
AttitudeSettingsGet(&attitudeSettings);
|
AttitudeSettingsGet(&attitudeSettings);
|
||||||
|
|
||||||
// Indicates not to expend cycles on rotation
|
// Indicates not to expend cycles on rotation
|
||||||
if (attitudeSettings.BoardRotation.Roll == 0 && attitudeSettings.BoardRotation.Pitch == 0 &&
|
if (fabsf(attitudeSettings.BoardRotation.Roll) < 0.00001f
|
||||||
attitudeSettings.BoardRotation.Yaw == 0) {
|
&& fabsf(attitudeSettings.BoardRotation.Pitch) < 0.00001f &&
|
||||||
|
fabsf(attitudeSettings.BoardRotation.Yaw) <0.00001f ) {
|
||||||
rotate = 0;
|
rotate = 0;
|
||||||
} else {
|
} else {
|
||||||
rotate = 1;
|
rotate = 1;
|
||||||
|
@ -393,7 +393,7 @@ p, li { white-space: pre-wrap; }
|
|||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="3">
|
<item row="1" column="3">
|
||||||
<widget class="QSpinBox" name="pitchRotation">
|
<widget class="QDoubleSpinBox" name="pitchRotation">
|
||||||
<property name="minimum">
|
<property name="minimum">
|
||||||
<number>-90</number>
|
<number>-90</number>
|
||||||
</property>
|
</property>
|
||||||
@ -475,7 +475,7 @@ margin:1px;</string>
|
|||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="1">
|
<item row="1" column="1">
|
||||||
<widget class="QSpinBox" name="rollRotation">
|
<widget class="QDoubleSpinBox" name="rollRotation">
|
||||||
<property name="minimum">
|
<property name="minimum">
|
||||||
<number>-180</number>
|
<number>-180</number>
|
||||||
</property>
|
</property>
|
||||||
@ -508,7 +508,7 @@ margin:1px;</string>
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="5">
|
<item row="1" column="5">
|
||||||
<widget class="QSpinBox" name="yawRotation">
|
<widget class="QDoubleSpinBox" name="yawRotation">
|
||||||
<property name="minimum">
|
<property name="minimum">
|
||||||
<number>-180</number>
|
<number>-180</number>
|
||||||
</property>
|
</property>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<xml>
|
<xml>
|
||||||
<object name="AttitudeSettings" singleinstance="true" settings="true" category="State">
|
<object name="AttitudeSettings" singleinstance="true" settings="true" category="State">
|
||||||
<description>Settings for the @ref Attitude module used on CopterControl</description>
|
<description>Settings for the @ref Attitude module used on CopterControl</description>
|
||||||
<field name="BoardRotation" units="deg" type="int16" elementnames="Roll,Pitch,Yaw" defaultvalue="0,0,0"/>
|
<field name="BoardRotation" units="deg" type="float" elementnames="Roll,Pitch,Yaw" defaultvalue="0,0,0"/>
|
||||||
<field name="AccelKp" units="channel" type="float" elements="1" defaultvalue="0.05"/>
|
<field name="AccelKp" units="channel" type="float" elements="1" defaultvalue="0.05"/>
|
||||||
<field name="AccelKi" units="channel" type="float" elements="1" defaultvalue="0.0001"/>
|
<field name="AccelKi" units="channel" type="float" elements="1" defaultvalue="0.0001"/>
|
||||||
<field name="MagKi" units="" type="float" elements="1" defaultvalue="0"/>
|
<field name="MagKi" units="" type="float" elements="1" defaultvalue="0"/>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user