lebarsfa / razor-9dof-ahrs

AHRS Firmware for the SparkFun 9DOF Razor IMU and SparkFun 9DOF Sensor Stick
Other
21 stars 4 forks source link

compiler errors #4

Open tdoggo opened 5 years ago

tdoggo commented 5 years ago

trying to get it compiling on a new machine and hitting issues similar to the other guy "failed to compile", but that thread seems to have been derailed into a ROS troubleshooting.

installed latest arduino IDE 1.8.8, board defs, libraries and everything as per hookup guide. Compile is throwing two things, one that it doesn't like runtime writeback to #define vals and other vcars, and the other that things aren't defined.

Razor_AHRS:534:12: error: 'loop_imu' was not declared in this scope
   read_sensors();
            ^

Razor_AHRS:882:42: error: lvalue required as left operand of assignment
               magn_ellipsoid_transform[1][2] = value_param;

Razor_AHRS:1021:23: error: 'Compass_Heading' was not declared in this scope
Razor_AHRS:1022:21: error: 'Matrix_update' was not declared in this scope
Razor_AHRS:1023:17: error: 'Normalize' was not declared in this scope
Razor_AHRS:1024:24: error: 'Drift_correction' was not declared in this scope

Google says that sometime in 1.6.x they broke the compiler auto-creation of method prototypes which would explain the "not declared", but have to have at least 1.6.5 to get board manager and i tried some other versions in between and got similar results.

can someone help with a working version # etc (possibly the board def version needs to be older?)

lebarsfa commented 5 years ago

Hello,

I did not check deeply but it seems I use Arduino IDE 1.8.5 (on Windows 10 64 bit) without problems.

The "not declared" errors are related to functions that are not in Razor_AHRS.ino but in the files normally in the same folder (Sensors.ino, DCM.ino, etc.) so it could be that theses files might be not found, in wrong versions, places, or duplicated, etc. Also, maybe you are opening the Arduino project in an unusual way : don't forget to unzip downloaded files, keep default names for everything, avoid spaces and special characters in the folders, etc.

I would suggest to try to delete/uninstall all the files you already downloaded/installed and retry from a clean state, maybe on another computer. Double-check that you did not miss (or duplicated) any step in the different guides (see e.g. https://github.com/lebarsfa/razor-9dof-ahrs#tutorial), check the important comments in the code, especially ensure that you activated the "#define HW__VERSION_CODE 14001" if you are using the Razor M0.

tdoggo commented 5 years ago

a solution in 2 parts...

1 - I am retard. used old calibration sketch which spits out the calibration in the wrong syntax so thats an easy fix (explains the lvalue error trying to write to a #define var)

2 - still will not compile on 1.8.8 because it cannot find the methods defined in other files (the prototype creation problem) but it does work in v1.8.4. shrug

lebarsfa commented 5 years ago

OK, I just tried quickly to build the code with Arduino IDE 1.8.8 on Windows 10 64 bit and it seems to work for me...