...
I’ve modified the example above to show how this should be done.
Code Block | ||
---|---|---|
| ||
#include "IMU.hpp" #include "gps.hpp" /*********************************************************************************************************************** * Variables **********************************************************************************************************************/ #ifdef TARGET_BUILD static ICM20602 imuObj; static NEOM8 gpsObj; #elif defined(TEST_BUILD) static matlabIMU imuObj; static matlabGps gpsObj; #endif /*********************************************************************************************************************** * Code **********************************************************************************************************************/ void SensorFusion_Execute(SensorResult *sensResult) { IMUData_t imuData = imuObj.getResult(); GpsData_t GpsData = gpsObj.getResult(); sensResult.result = DoCrazyMath(&imuData, &GpsData); } |