gergelytakacs / AutomationShield

Arduino library and MATLAB/Simulink API for the AutomationShield Arduino expansion boards for control engineering education.
Other
39 stars 16 forks source link

AeroShield compilation error #357

Closed benodomi closed 1 year ago

benodomi commented 1 year ago

When setting macro #define MANUAL1 in AeroShield_EMPC.ino I've got a compilation error because r has no type.

benodomi commented 1 year ago

After turning with knob reference doesn't change. Adding a line Xr[1] = r; on line 104 fixs this.

gergelytakacs commented 1 year ago

Hello @benodomi and we appreciate the feedback. @erik1392 this is a quick fix - can you please implement it? I don't want to do it without testing.

erik1392 commented 1 year ago

"I'm aware of the bug. There are more like it. The AeroShield_eMPC branch is still under development, hence, it has not yet been merged into the master branch."

gergelytakacs commented 1 year ago

Right on! Close the ticket when its done please:)

On Thu, Sep 14, 2023 at 5:24 PM erik1392 @.***> wrote:

"I'm aware of the bug. There are more like it. The AeroShield_eMPC branch is still under development, hence, it has not yet been merged into the master branch."

— Reply to this email directly, view it on GitHub https://github.com/gergelytakacs/AutomationShield/issues/357#issuecomment-1719668699, or unsubscribe https://github.com/notifications/unsubscribe-auth/AI7K24GT7XXA7FELJKAYJRTX2MORPANCNFSM6AAAAAA4WEIYD4 . You are receiving this because you commented.Message ID: @.***>

benodomi commented 1 year ago

I've already used this code during Workshop and project work. Sorry for this way of sharing code but this piece of code is with all fixes related to this issue :

  #if MANUAL
    float r =  AutomationShield.mapFloat(AeroShield.referenceRead(),0,100,0,M_PI);          //--Sensing Pot reference
    Xr[1] = r;        
  #elif !MANUAL
    if(i >= sizeof(R)/sizeof(float)){ // If trajectory ended
      AeroShield.actuatorWriteVolt(0.0); // Stop the Motor
      while(true); // End of program execution
    }
    if (k % (T*i) == 0){ // Moving through trajectory values    
    //r = R[i];
    Xr[1] = R[i];
      i++;             // Change input value after defined amount of samples
    }
    k++;                              // Increment
  #endif
erik1392 commented 1 year ago

Thank you, I will integrate your code.