pololu / minimu-9-ahrs-arduino

Arduino program for building an AHRS with a Pololu MinIMU-9
http://www.pololu.com/catalog/product/2738
GNU Lesser General Public License v3.0
140 stars 73 forks source link

Arduino IMU Error #23

Closed hiteshv7479 closed 4 years ago

hiteshv7479 commented 6 years ago

While Uploading my Arduino code I have these following Errors

Arduino: 1.8.7 (Linux), Board: "Arduino Nano, ATmega328P"

/home/hitesh/cart_ws/src/acs/razor_imu_9dof/src/Razor_AHRS/Razor_AHRS.ino: In function 'void read_sensors()':
Razor_AHRS:584:13: error: 'Read_Gyro' was not declared in this scope
   // Normally using x-z-plane-component/y-component of compensated gravity vector
             ^
Razor_AHRS:585:14: error: 'Read_Accel' was not declared in this scope
   // roll = atan2(temp2[1], sqrt(temp2[0] * temp2[0] + temp2[2] * temp2[2]));
              ^
Razor_AHRS:586:13: error: 'Read_Magn' was not declared in this scope
   // Since we compensated for pitch, x-z-plane-component equals z-component:
             ^
/home/hitesh/cart_ws/src/acs/razor_imu_9dof/src/Razor_AHRS/Razor_AHRS.ino: In function 'void compensate_sensor_errors()':
Razor_AHRS:622:78: error: 'Matrix_Vector_Multiply' was not declared in this scope
/home/hitesh/cart_ws/src/acs/razor_imu_9dof/src/Razor_AHRS/Razor_AHRS.ino: In function 'void reset_sensor_fusion()':
Razor_AHRS:655:43: error: 'Vector_Cross_Product' was not declared in this scope
Razor_AHRS:663:19: error: 'Compass_Heading' was not declared in this scope
   delay(400);  // Give sensors enough time to collect data
                   ^
Razor_AHRS:667:52: error: 'init_rotation_matrix' was not declared in this scope
/home/hitesh/cart_ws/src/acs/razor_imu_9dof/src/Razor_AHRS/Razor_AHRS.ino: In function 'void setup()':
Razor_AHRS:728:12: error: 'I2C_Init' was not declared in this scope
         else if (output_param == 'c') // Go to _c_alibration mode
            ^
Razor_AHRS:729:14: error: 'Accel_Init' was not declared in this scope
Razor_AHRS:730:13: error: 'Magn_Init' was not declared in this scope
           output_mode = OUTPUT__MODE_CALIBRATE_SENSORS;
             ^
Razor_AHRS:731:13: error: 'Gyro_Init' was not declared in this scope
           reset_calibration_session_flag = true;
             ^
/home/hitesh/cart_ws/src/acs/razor_imu_9dof/src/Razor_AHRS/Razor_AHRS.ino: In function 'void loop()':
Razor_AHRS:1058:91: error: 'output_calibration' was not declared in this scope
Razor_AHRS:1069:23: error: 'Compass_Heading' was not declared in this scope
Razor_AHRS:1070:21: error: 'Matrix_update' was not declared in this scope
Razor_AHRS:1071:17: error: 'Normalize' was not declared in this scope
Razor_AHRS:1072:24: error: 'Drift_correction' was not declared in this scope
Razor_AHRS:1073:20: error: 'Euler_angles' was not declared in this scope
Razor_AHRS:1076:63: error: 'output_angles' was not declared in this scope
Razor_AHRS:1087:23: error: 'Compass_Heading' was not declared in this scope
Razor_AHRS:1088:21: error: 'Matrix_update' was not declared in this scope
Razor_AHRS:1089:17: error: 'Normalize' was not declared in this scope
Razor_AHRS:1090:24: error: 'Drift_correction' was not declared in this scope
Razor_AHRS:1091:20: error: 'Euler_angles' was not declared in this scope
Razor_AHRS:1094:85: error: 'output_both_angles_and_sensors_text' was not declared in this scope
Razor_AHRS:1098:64: error: 'output_sensors' was not declared in this scope
/home/hitesh/cart_ws/src/acs/razor_imu_9dof/src/Razor_AHRS/DCM.ino: In function 'void Normalize()':
DCM:12:65: error: 'Vector_Dot_Product' was not declared in this scope
   error= -Vector_Dot_Product(&DCM_Matrix[0][0],&DCM_Matrix[1][0])*.5; //eq.19
                                                                 ^
DCM:14:58: error: 'Vector_Scale' was not declared in this scope
   Vector_Scale(&temporary[0][0], &DCM_Matrix[1][0], error); //eq.19
                                                          ^
DCM:17:67: error: 'Vector_Add' was not declared in this scope
   Vector_Add(&temporary[0][0], &temporary[0][0], &DCM_Matrix[0][0]);//eq.19
                                                                   ^
DCM:20:74: error: 'Vector_Cross_Product' was not declared in this scope
   Vector_Cross_Product(&temporary[2][0],&temporary[0][0],&temporary[1][0]); // c= a x b //eq.20
                                                                          ^
/home/hitesh/cart_ws/src/acs/razor_imu_9dof/src/Razor_AHRS/DCM.ino: In function 'void Drift_correction()':
DCM:54:77: error: 'Vector_Cross_Product' was not declared in this scope
   Vector_Cross_Product(&errorRollPitch[0],&Accel_Vector[0],&DCM_Matrix[2][0]); //adjust the ground of reference
                                                                             ^
DCM:55:72: error: 'Vector_Scale' was not declared in this scope
   Vector_Scale(&Omega_P[0],&errorRollPitch[0],Kp_ROLLPITCH*Accel_weight);
                                                                        ^
DCM:58:44: error: 'Vector_Add' was not declared in this scope
   Vector_Add(Omega_I,Omega_I,Scaled_Omega_I);     
                                            ^
/home/hitesh/cart_ws/src/acs/razor_imu_9dof/src/Razor_AHRS/DCM.ino: In function 'void Matrix_update()':
DCM:85:53: error: 'Vector_Add' was not declared in this scope
   Vector_Add(&Omega[0], &Gyro_Vector[0], &Omega_I[0]);  //adding proportional term
                                                     ^
DCM:113:60: error: 'Matrix_Multiply' was not declared in this scope
   Matrix_Multiply(DCM_Matrix,Update_Matrix,Temporary_Matrix); //a*b=c
                                                            ^
exit status 1
'Read_Gyro' was not declared in this scope

What are the Arduino libraries required for these?

kevin-pololu commented 5 years ago

The Arduino library prerequisites for our MinIMU AHRS sketch are explained in the README on the main page of the repository. However, it seems like you are having compilation issues different than what I would expect for missing libraries, and from your filenames, it looks like you might not be using our AHRS software. What IMU board are you using and how/where did you obtain the AHRS program?