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

Change Rotwing Airframes to COMMANDS #3376

Open
dewagter opened this issue Oct 1, 2024 · 1 comment
Open

Change Rotwing Airframes to COMMANDS #3376

dewagter opened this issue Oct 1, 2024 · 1 comment

Comments

@dewagter
Copy link
Member

dewagter commented Oct 1, 2024

No description provided.

@dewagter
Copy link
Member Author

dewagter commented Oct 2, 2024

If in the airframe you use the commands instead of actuator pprz, then here you can make
a nice switch using the command name directly instead of hardcoded numbers which can
lead to confusion. Something like:

for (i = 0; i < EFF_MAT_COLS_NB; i++) {
    switch (i) {
    case (COMMAND_MOTOR_FRONT):
    case (COMMAND_MOTOR_BACK):
    case (COMMAND_MOTOR_RIGHT):     
    case (COMMAND_MOTOR_LEFT):
      EFF_MAT_RW[RW_aN][i] = ... ;
      break;
    case (COMMAND_MOTOR_PUSHER): 
      EFF_MAT_RW[RW_aN][i] = ... ; 
      break;
    case (COMMAND_ELEVATOR):
    case (COMMAND_RUDDER): 
    case (COMMAND_AILERONS):
    case (COMMAND_FLAPS):  
      EFF_MAT_RW[RW_aN][i] = 0.0;
      break;     
    case (COMMAND_ROLL):
      EFF_MAT_RW[RW_ar][i] = 0.0;  
      break;
    case (COMMAND_PITCH):
      EFF_MAT_RW[RW_ar][i] = 0.0;
      break;
    default:
      break;
    }

Originally posted by @tmldeponti in #3374 (comment)

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

No branches or pull requests

1 participant