mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
fix(rc_update): change RC*_REV params from float to int32
RC*_REV parameters are binary toggles (-1 or 1) immediately converted to bool. Using int32 allows reverting the module schema enum key type from number back to integer, keeping validation strict.
This commit is contained in:
parent
75bc9f2f97
commit
9a0241ac44
@ -33,13 +33,13 @@ parameters:
|
|||||||
description:
|
description:
|
||||||
short: RC channel 1 reverse
|
short: RC channel 1 reverse
|
||||||
long: Set to -1 to reverse channel.
|
long: Set to -1 to reverse channel.
|
||||||
type: float
|
type: int32
|
||||||
values:
|
values:
|
||||||
-1.0: Reverse
|
-1: Reverse
|
||||||
1.0: Normal
|
1: Normal
|
||||||
default: 1.0
|
default: 1
|
||||||
min: -1.0
|
min: -1
|
||||||
max: 1.0
|
max: 1
|
||||||
RC2_MIN:
|
RC2_MIN:
|
||||||
description:
|
description:
|
||||||
short: RC channel 2 minimum
|
short: RC channel 2 minimum
|
||||||
@ -71,13 +71,13 @@ parameters:
|
|||||||
description:
|
description:
|
||||||
short: RC channel 2 reverse
|
short: RC channel 2 reverse
|
||||||
long: Set to -1 to reverse channel.
|
long: Set to -1 to reverse channel.
|
||||||
type: float
|
type: int32
|
||||||
values:
|
values:
|
||||||
-1.0: Reverse
|
-1: Reverse
|
||||||
1.0: Normal
|
1: Normal
|
||||||
default: 1.0
|
default: 1
|
||||||
min: -1.0
|
min: -1
|
||||||
max: 1.0
|
max: 1
|
||||||
RC3_MIN:
|
RC3_MIN:
|
||||||
description:
|
description:
|
||||||
short: RC channel 3 minimum
|
short: RC channel 3 minimum
|
||||||
@ -109,13 +109,13 @@ parameters:
|
|||||||
description:
|
description:
|
||||||
short: RC channel 3 reverse
|
short: RC channel 3 reverse
|
||||||
long: Set to -1 to reverse channel.
|
long: Set to -1 to reverse channel.
|
||||||
type: float
|
type: int32
|
||||||
values:
|
values:
|
||||||
-1.0: Reverse
|
-1: Reverse
|
||||||
1.0: Normal
|
1: Normal
|
||||||
default: 1.0
|
default: 1
|
||||||
min: -1.0
|
min: -1
|
||||||
max: 1.0
|
max: 1
|
||||||
RC4_MIN:
|
RC4_MIN:
|
||||||
description:
|
description:
|
||||||
short: RC channel 4 minimum
|
short: RC channel 4 minimum
|
||||||
@ -147,13 +147,13 @@ parameters:
|
|||||||
description:
|
description:
|
||||||
short: RC channel 4 reverse
|
short: RC channel 4 reverse
|
||||||
long: Set to -1 to reverse channel.
|
long: Set to -1 to reverse channel.
|
||||||
type: float
|
type: int32
|
||||||
values:
|
values:
|
||||||
-1.0: Reverse
|
-1: Reverse
|
||||||
1.0: Normal
|
1: Normal
|
||||||
default: 1.0
|
default: 1
|
||||||
min: -1.0
|
min: -1
|
||||||
max: 1.0
|
max: 1
|
||||||
RC5_MIN:
|
RC5_MIN:
|
||||||
description:
|
description:
|
||||||
short: RC channel 5 minimum
|
short: RC channel 5 minimum
|
||||||
@ -185,13 +185,13 @@ parameters:
|
|||||||
description:
|
description:
|
||||||
short: RC channel 5 reverse
|
short: RC channel 5 reverse
|
||||||
long: Set to -1 to reverse channel.
|
long: Set to -1 to reverse channel.
|
||||||
type: float
|
type: int32
|
||||||
values:
|
values:
|
||||||
-1.0: Reverse
|
-1: Reverse
|
||||||
1.0: Normal
|
1: Normal
|
||||||
default: 1.0
|
default: 1
|
||||||
min: -1.0
|
min: -1
|
||||||
max: 1.0
|
max: 1
|
||||||
RC6_MIN:
|
RC6_MIN:
|
||||||
description:
|
description:
|
||||||
short: RC channel 6 minimum
|
short: RC channel 6 minimum
|
||||||
@ -223,13 +223,13 @@ parameters:
|
|||||||
description:
|
description:
|
||||||
short: RC channel 6 reverse
|
short: RC channel 6 reverse
|
||||||
long: Set to -1 to reverse channel.
|
long: Set to -1 to reverse channel.
|
||||||
type: float
|
type: int32
|
||||||
values:
|
values:
|
||||||
-1.0: Reverse
|
-1: Reverse
|
||||||
1.0: Normal
|
1: Normal
|
||||||
default: 1.0
|
default: 1
|
||||||
min: -1.0
|
min: -1
|
||||||
max: 1.0
|
max: 1
|
||||||
RC7_MIN:
|
RC7_MIN:
|
||||||
description:
|
description:
|
||||||
short: RC channel 7 minimum
|
short: RC channel 7 minimum
|
||||||
@ -261,13 +261,13 @@ parameters:
|
|||||||
description:
|
description:
|
||||||
short: RC channel 7 reverse
|
short: RC channel 7 reverse
|
||||||
long: Set to -1 to reverse channel.
|
long: Set to -1 to reverse channel.
|
||||||
type: float
|
type: int32
|
||||||
values:
|
values:
|
||||||
-1.0: Reverse
|
-1: Reverse
|
||||||
1.0: Normal
|
1: Normal
|
||||||
default: 1.0
|
default: 1
|
||||||
min: -1.0
|
min: -1
|
||||||
max: 1.0
|
max: 1
|
||||||
RC8_MIN:
|
RC8_MIN:
|
||||||
description:
|
description:
|
||||||
short: RC channel 8 minimum
|
short: RC channel 8 minimum
|
||||||
@ -299,13 +299,13 @@ parameters:
|
|||||||
description:
|
description:
|
||||||
short: RC channel 8 reverse
|
short: RC channel 8 reverse
|
||||||
long: Set to -1 to reverse channel.
|
long: Set to -1 to reverse channel.
|
||||||
type: float
|
type: int32
|
||||||
values:
|
values:
|
||||||
-1.0: Reverse
|
-1: Reverse
|
||||||
1.0: Normal
|
1: Normal
|
||||||
default: 1.0
|
default: 1
|
||||||
min: -1.0
|
min: -1
|
||||||
max: 1.0
|
max: 1
|
||||||
RC9_MIN:
|
RC9_MIN:
|
||||||
description:
|
description:
|
||||||
short: RC channel 9 minimum
|
short: RC channel 9 minimum
|
||||||
@ -337,13 +337,13 @@ parameters:
|
|||||||
description:
|
description:
|
||||||
short: RC channel 9 reverse
|
short: RC channel 9 reverse
|
||||||
long: Set to -1 to reverse channel.
|
long: Set to -1 to reverse channel.
|
||||||
type: float
|
type: int32
|
||||||
values:
|
values:
|
||||||
-1.0: Reverse
|
-1: Reverse
|
||||||
1.0: Normal
|
1: Normal
|
||||||
default: 1.0
|
default: 1
|
||||||
min: -1.0
|
min: -1
|
||||||
max: 1.0
|
max: 1
|
||||||
RC10_MIN:
|
RC10_MIN:
|
||||||
description:
|
description:
|
||||||
short: RC channel 10 minimum
|
short: RC channel 10 minimum
|
||||||
@ -375,13 +375,13 @@ parameters:
|
|||||||
description:
|
description:
|
||||||
short: RC channel 10 reverse
|
short: RC channel 10 reverse
|
||||||
long: Set to -1 to reverse channel.
|
long: Set to -1 to reverse channel.
|
||||||
type: float
|
type: int32
|
||||||
values:
|
values:
|
||||||
-1.0: Reverse
|
-1: Reverse
|
||||||
1.0: Normal
|
1: Normal
|
||||||
default: 1.0
|
default: 1
|
||||||
min: -1.0
|
min: -1
|
||||||
max: 1.0
|
max: 1
|
||||||
RC11_MIN:
|
RC11_MIN:
|
||||||
description:
|
description:
|
||||||
short: RC channel 11 minimum
|
short: RC channel 11 minimum
|
||||||
@ -413,13 +413,13 @@ parameters:
|
|||||||
description:
|
description:
|
||||||
short: RC channel 11 reverse
|
short: RC channel 11 reverse
|
||||||
long: Set to -1 to reverse channel.
|
long: Set to -1 to reverse channel.
|
||||||
type: float
|
type: int32
|
||||||
values:
|
values:
|
||||||
-1.0: Reverse
|
-1: Reverse
|
||||||
1.0: Normal
|
1: Normal
|
||||||
default: 1.0
|
default: 1
|
||||||
min: -1.0
|
min: -1
|
||||||
max: 1.0
|
max: 1
|
||||||
RC12_MIN:
|
RC12_MIN:
|
||||||
description:
|
description:
|
||||||
short: RC channel 12 minimum
|
short: RC channel 12 minimum
|
||||||
@ -451,13 +451,13 @@ parameters:
|
|||||||
description:
|
description:
|
||||||
short: RC channel 12 reverse
|
short: RC channel 12 reverse
|
||||||
long: Set to -1 to reverse channel.
|
long: Set to -1 to reverse channel.
|
||||||
type: float
|
type: int32
|
||||||
values:
|
values:
|
||||||
-1.0: Reverse
|
-1: Reverse
|
||||||
1.0: Normal
|
1: Normal
|
||||||
default: 1.0
|
default: 1
|
||||||
min: -1.0
|
min: -1
|
||||||
max: 1.0
|
max: 1
|
||||||
RC13_MIN:
|
RC13_MIN:
|
||||||
description:
|
description:
|
||||||
short: RC channel 13 minimum
|
short: RC channel 13 minimum
|
||||||
@ -489,13 +489,13 @@ parameters:
|
|||||||
description:
|
description:
|
||||||
short: RC channel 13 reverse
|
short: RC channel 13 reverse
|
||||||
long: Set to -1 to reverse channel.
|
long: Set to -1 to reverse channel.
|
||||||
type: float
|
type: int32
|
||||||
values:
|
values:
|
||||||
-1.0: Reverse
|
-1: Reverse
|
||||||
1.0: Normal
|
1: Normal
|
||||||
default: 1.0
|
default: 1
|
||||||
min: -1.0
|
min: -1
|
||||||
max: 1.0
|
max: 1
|
||||||
RC14_MIN:
|
RC14_MIN:
|
||||||
description:
|
description:
|
||||||
short: RC channel 14 minimum
|
short: RC channel 14 minimum
|
||||||
@ -527,13 +527,13 @@ parameters:
|
|||||||
description:
|
description:
|
||||||
short: RC channel 14 reverse
|
short: RC channel 14 reverse
|
||||||
long: Set to -1 to reverse channel.
|
long: Set to -1 to reverse channel.
|
||||||
type: float
|
type: int32
|
||||||
values:
|
values:
|
||||||
-1.0: Reverse
|
-1: Reverse
|
||||||
1.0: Normal
|
1: Normal
|
||||||
default: 1.0
|
default: 1
|
||||||
min: -1.0
|
min: -1
|
||||||
max: 1.0
|
max: 1
|
||||||
RC15_MIN:
|
RC15_MIN:
|
||||||
description:
|
description:
|
||||||
short: RC channel 15 minimum
|
short: RC channel 15 minimum
|
||||||
@ -565,13 +565,13 @@ parameters:
|
|||||||
description:
|
description:
|
||||||
short: RC channel 15 reverse
|
short: RC channel 15 reverse
|
||||||
long: Set to -1 to reverse channel.
|
long: Set to -1 to reverse channel.
|
||||||
type: float
|
type: int32
|
||||||
values:
|
values:
|
||||||
-1.0: Reverse
|
-1: Reverse
|
||||||
1.0: Normal
|
1: Normal
|
||||||
default: 1.0
|
default: 1
|
||||||
min: -1.0
|
min: -1
|
||||||
max: 1.0
|
max: 1
|
||||||
RC16_MIN:
|
RC16_MIN:
|
||||||
description:
|
description:
|
||||||
short: RC channel 16 minimum
|
short: RC channel 16 minimum
|
||||||
@ -603,13 +603,13 @@ parameters:
|
|||||||
description:
|
description:
|
||||||
short: RC channel 16 reverse
|
short: RC channel 16 reverse
|
||||||
long: Set to -1 to reverse channel.
|
long: Set to -1 to reverse channel.
|
||||||
type: float
|
type: int32
|
||||||
values:
|
values:
|
||||||
-1.0: Reverse
|
-1: Reverse
|
||||||
1.0: Normal
|
1: Normal
|
||||||
default: 1.0
|
default: 1
|
||||||
min: -1.0
|
min: -1
|
||||||
max: 1.0
|
max: 1
|
||||||
RC17_MIN:
|
RC17_MIN:
|
||||||
description:
|
description:
|
||||||
short: RC channel 17 minimum
|
short: RC channel 17 minimum
|
||||||
@ -641,13 +641,13 @@ parameters:
|
|||||||
description:
|
description:
|
||||||
short: RC channel 17 reverse
|
short: RC channel 17 reverse
|
||||||
long: Set to -1 to reverse channel.
|
long: Set to -1 to reverse channel.
|
||||||
type: float
|
type: int32
|
||||||
values:
|
values:
|
||||||
-1.0: Reverse
|
-1: Reverse
|
||||||
1.0: Normal
|
1: Normal
|
||||||
default: 1.0
|
default: 1
|
||||||
min: -1.0
|
min: -1
|
||||||
max: 1.0
|
max: 1
|
||||||
RC18_MIN:
|
RC18_MIN:
|
||||||
description:
|
description:
|
||||||
short: RC channel 18 minimum
|
short: RC channel 18 minimum
|
||||||
@ -679,13 +679,13 @@ parameters:
|
|||||||
description:
|
description:
|
||||||
short: RC channel 18 reverse
|
short: RC channel 18 reverse
|
||||||
long: Set to -1 to reverse channel.
|
long: Set to -1 to reverse channel.
|
||||||
type: float
|
type: int32
|
||||||
values:
|
values:
|
||||||
-1.0: Reverse
|
-1: Reverse
|
||||||
1.0: Normal
|
1: Normal
|
||||||
default: 1.0
|
default: 1
|
||||||
min: -1.0
|
min: -1
|
||||||
max: 1.0
|
max: 1
|
||||||
RC_CHAN_CNT:
|
RC_CHAN_CNT:
|
||||||
description:
|
description:
|
||||||
short: RC channel count
|
short: RC channel count
|
||||||
|
|||||||
@ -140,9 +140,9 @@ void RCUpdate::updateParams()
|
|||||||
param_get(_parameter_handles.max[i], &max);
|
param_get(_parameter_handles.max[i], &max);
|
||||||
_parameters.max[i] = max;
|
_parameters.max[i] = max;
|
||||||
|
|
||||||
float rev = 0.f;
|
int32_t rev = 0;
|
||||||
param_get(_parameter_handles.rev[i], &rev);
|
param_get(_parameter_handles.rev[i], &rev);
|
||||||
_parameters.rev[i] = (rev < 0.f);
|
_parameters.rev[i] = (rev < 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < rc_parameter_map_s::RC_PARAM_MAP_NCHAN; i++) {
|
for (int i = 0; i < rc_parameter_map_s::RC_PARAM_MAP_NCHAN; i++) {
|
||||||
|
|||||||
@ -170,7 +170,7 @@ parameters:
|
|||||||
# enumeration of possible values for type enum
|
# enumeration of possible values for type enum
|
||||||
type: dict
|
type: dict
|
||||||
keyschema:
|
keyschema:
|
||||||
type: number
|
type: integer
|
||||||
valueschema:
|
valueschema:
|
||||||
type: string
|
type: string
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user