Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SRV_Channel: convert function to AP_Int16 #13177

Merged
merged 6 commits into from
Jan 14, 2020

Conversation

IamPete1
Copy link
Member

@IamPete1 IamPete1 commented Jan 5, 2020

Fixes #12744

This is changes SERVOx_FUNCTION from AP_INT8 to AP_INT16. The param conversion does not work, I need some advice on how to do it properly.

@magicrub
Copy link
Contributor

magicrub commented Jan 6, 2020

@peterbarker might know about the conversion. Otherwise LGTM

@peterbarker
Copy link
Contributor

Actually, @rmackay9 knows how these conversion table thingies work.

The comment in Rover's Parameters.cpp looks helpful.

@IamPete1
Copy link
Member Author

IamPete1 commented Jan 6, 2020

I have got all the keys, now going to try and work out the conversion

Plane:
Key 150: Index 0: GroupElement 20550 : SERVO1_FUNCTION: 77
Key 150: Index 0: GroupElement 20614 : SERVO2_FUNCTION: 78
Key 150: Index 0: GroupElement 20678 : SERVO3_FUNCTION: 6
Key 150: Index 0: GroupElement 20742 : SERVO4_FUNCTION: 7
Key 150: Index 0: GroupElement 20806 : SERVO5_FUNCTION: 34
Key 150: Index 0: GroupElement 20870 : SERVO6_FUNCTION: 33
Key 150: Index 0: GroupElement 20934 : SERVO7_FUNCTION: 35
Key 150: Index 0: GroupElement 20998 : SERVO8_FUNCTION: 36
Key 150: Index 0: GroupElement 21062 : SERVO9_FUNCTION: 0
Key 150: Index 0: GroupElement 21126 : SERVO10_FUNCTION: 0
Key 150: Index 0: GroupElement 21190 : SERVO11_FUNCTION: 0
Key 150: Index 0: GroupElement 21254 : SERVO12_FUNCTION: 0
Key 150: Index 0: GroupElement 21318 : SERVO13_FUNCTION: 0
Key 150: Index 0: GroupElement 21382 : SERVO14_FUNCTION: 0
Key 150: Index 0: GroupElement 21446 : SERVO15_FUNCTION: 0
Key 150: Index 0: GroupElement 21510 : SERVO16_FUNCTION: 0

Copter:
Key 99: Index 0: GroupElement 20560 : SERVO1_FUNCTION: 33
Key 99: Index 0: GroupElement 20624 : SERVO2_FUNCTION: 34
Key 99: Index 0: GroupElement 20688 : SERVO3_FUNCTION: 35
Key 99: Index 0: GroupElement 20752 : SERVO4_FUNCTION: 36
Key 99: Index 0: GroupElement 20816 : SERVO5_FUNCTION: 0
Key 99: Index 0: GroupElement 20880 : SERVO6_FUNCTION: 0
Key 99: Index 0: GroupElement 20944 : SERVO7_FUNCTION: 0
Key 99: Index 0: GroupElement 21008 : SERVO8_FUNCTION: 0
Key 99: Index 0: GroupElement 21072 : SERVO9_FUNCTION: 0
Key 99: Index 0: GroupElement 21136 : SERVO10_FUNCTION: 0
Key 99: Index 0: GroupElement 21200 : SERVO11_FUNCTION: 0
Key 99: Index 0: GroupElement 21264 : SERVO12_FUNCTION: 0
Key 99: Index 0: GroupElement 21328 : SERVO13_FUNCTION: 0
Key 99: Index 0: GroupElement 21392 : SERVO14_FUNCTION: 0
Key 99: Index 0: GroupElement 21456 : SERVO15_FUNCTION: 0
Key 99: Index 0: GroupElement 21520 : SERVO16_FUNCTION: 0

Rover:
Key 58: Index 0: GroupElement 20547 : SERVO1_FUNCTION: 26
Key 58: Index 0: GroupElement 20611 : SERVO2_FUNCTION: 0
Key 58: Index 0: GroupElement 20675 : SERVO3_FUNCTION: 70
Key 58: Index 0: GroupElement 20739 : SERVO4_FUNCTION: 0
Key 58: Index 0: GroupElement 20803 : SERVO5_FUNCTION: 0
Key 58: Index 0: GroupElement 20867 : SERVO6_FUNCTION: 0
Key 58: Index 0: GroupElement 20931 : SERVO7_FUNCTION: 0
Key 58: Index 0: GroupElement 20995 : SERVO8_FUNCTION: 0
Key 58: Index 0: GroupElement 21059 : SERVO9_FUNCTION: 0
Key 58: Index 0: GroupElement 21123 : SERVO10_FUNCTION: 0
Key 58: Index 0: GroupElement 21187 : SERVO11_FUNCTION: 0
Key 58: Index 0: GroupElement 21251 : SERVO12_FUNCTION: 0
Key 58: Index 0: GroupElement 21315 : SERVO13_FUNCTION: 0
Key 58: Index 0: GroupElement 21379 : SERVO14_FUNCTION: 0
Key 58: Index 0: GroupElement 21443 : SERVO15_FUNCTION: 0
Key 58: Index 0: GroupElement 21507 : SERVO16_FUNCTION: 0

Tracker:
Key 39: Index 0: GroupElement 321 : SERVO1_FUNCTION: 71
Key 39: Index 0: GroupElement 322 : SERVO2_FUNCTION: 72
Key 39: Index 0: GroupElement 323 : SERVO3_FUNCTION: 0
Key 39: Index 0: GroupElement 324 : SERVO4_FUNCTION: 0
Key 39: Index 0: GroupElement 325 : SERVO5_FUNCTION: 0
Key 39: Index 0: GroupElement 326 : SERVO6_FUNCTION: 0
Key 39: Index 0: GroupElement 327 : SERVO7_FUNCTION: 0
Key 39: Index 0: GroupElement 328 : SERVO8_FUNCTION: 0
Key 39: Index 0: GroupElement 329 : SERVO9_FUNCTION: 0
Key 39: Index 0: GroupElement 330 : SERVO10_FUNCTION: 0
Key 39: Index 0: GroupElement 331 : SERVO11_FUNCTION: 0
Key 39: Index 0: GroupElement 332 : SERVO12_FUNCTION: 0
Key 39: Index 0: GroupElement 333 : SERVO13_FUNCTION: 0
Key 39: Index 0: GroupElement 334 : SERVO14_FUNCTION: 0
Key 39: Index 0: GroupElement 335 : SERVO15_FUNCTION: 0
Key 39: Index 0: GroupElement 336 : SERVO16_FUNCTION: 0

Sub:
Key 88: Index 0: GroupElement 20560 : SERVO1_FUNCTION: 33
Key 88: Index 0: GroupElement 20624 : SERVO2_FUNCTION: 34
Key 88: Index 0: GroupElement 20688 : SERVO3_FUNCTION: 35
Key 88: Index 0: GroupElement 20752 : SERVO4_FUNCTION: 36
Key 88: Index 0: GroupElement 20816 : SERVO5_FUNCTION: 37
Key 88: Index 0: GroupElement 20880 : SERVO6_FUNCTION: 38
Key 88: Index 0: GroupElement 20944 : SERVO7_FUNCTION: 0
Key 88: Index 0: GroupElement 21008 : SERVO8_FUNCTION: 0
Key 88: Index 0: GroupElement 21072 : SERVO9_FUNCTION: 0
Key 88: Index 0: GroupElement 21136 : SERVO10_FUNCTION: 0
Key 88: Index 0: GroupElement 21200 : SERVO11_FUNCTION: 0
Key 88: Index 0: GroupElement 21264 : SERVO12_FUNCTION: 0
Key 88: Index 0: GroupElement 21328 : SERVO13_FUNCTION: 0
Key 88: Index 0: GroupElement 21392 : SERVO14_FUNCTION: 0
Key 88: Index 0: GroupElement 21456 : SERVO15_FUNCTION: 0
Key 88: Index 0: GroupElement 21520 : SERVO16_FUNCTION: 0

@IamPete1
Copy link
Member Author

IamPete1 commented Jan 6, 2020

I have added a attempt at a param conversion table based on the above keys, its does not seem to work, so I must have missed something somewhere

@tridge tridge self-assigned this Jan 6, 2020
@rmackay9
Copy link
Contributor

rmackay9 commented Jan 9, 2020

The decision from the dev call was that @tridge would look into whether we need to change the parameter index or not. If we don't need to then we can avoid the need for parameter conversion code.

@tridge
Copy link
Contributor

tridge commented Jan 13, 2020

I have converted this PR to new a new AP_Param::convert_parameter_width() function that simplifies things a lot, and will allow us to easily widen parameters in future without using a new parameter key.
Note! This removes the old parameter conversion for RC* to SERVO*, which was used to convert from Copter 3.4

this allows for easy conversion of the width of a parameter without
changing indexes
this also removes the old parameter conversion code used for when we
first added the SERVO parameters. This was needed for conversion from
Copter 3.4 and Plane 3.7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SERVOx_FUNCTION: run out of options using AP_Int8
7 participants