Skip to content

Commit cd24c45

Browse files
committed
Revert "Adding support for the BNO080 - ** work in progress ** (does not .begin reliably)"
This reverts commit cdaf6af.
1 parent cdaf6af commit cd24c45

File tree

8 files changed

+3
-304
lines changed

8 files changed

+3
-304
lines changed

CHANGELOG.md

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,6 @@
11
Change Log
22
======================
33

4-
v1.8
5-
---------
6-
7-
* Added a fix to make sure the MS8607 is detected correctly [54](https://github.com/sparkfun/OpenLog_Artemis/issues/54)
8-
* Added logMicroseconds [49](https://github.com/sparkfun/OpenLog_Artemis/issues/49)
9-
* Added an option to use autoPVT when logging GNSS data [50](https://github.com/sparkfun/OpenLog_Artemis/issues/50)
10-
* Started to add support for the BNO080 so users can have access to Quaternions and Euler angles [47](https://github.com/sparkfun/OpenLog_Artemis/issues/47)
11-
* This is work in progress. The BNO080 does not currently .begin reliably - especially on the second attempt - and I don't understand why...
12-
134
v1.7
145
---------
156

Firmware/OpenLog_Artemis/OpenLog_Artemis.ino

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@
7474
(done) Add a fix to make sure the MS8607 is detected correctly: https://github.com/sparkfun/OpenLog_Artemis/issues/54
7575
(done) Add logMicroseconds: https://github.com/sparkfun/OpenLog_Artemis/issues/49
7676
(done) Add an option to use autoPVT when logging GNSS data: https://github.com/sparkfun/OpenLog_Artemis/issues/50
77-
(work in progress) Add support for the BNO080 so users have access to Quaternions and Euler angles: https://github.com/sparkfun/OpenLog_Artemis/issues/47
7877
*/
7978

8079
const int FIRMWARE_VERSION_MAJOR = 1;
@@ -207,7 +206,6 @@ ICM_20948_SPI myICM;
207206
#include "SparkFun_ADS122C04_ADC_Arduino_Library.h" // Click here to get the library: http://librarymanager/All#SparkFun_ADS122C04
208207
#include "SparkFun_MicroPressure.h" // Click here to get the library: http://librarymanager/All#SparkFun_MicroPressure
209208
#include "SparkFun_Particle_Sensor_SN-GCJA5_Arduino_Library.h" // Click here to get the library: http://librarymanager/All#SparkFun_Particle_Sensor_SN-GCJA5
210-
#include "SparkFun_BNO080_Arduino_Library.h" // Click here to get the library: http://librarymanager/All#SparkFun_BNO080
211209

212210
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
213211

Firmware/OpenLog_Artemis/Sensors.ino

Lines changed: 0 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -803,64 +803,6 @@ void gatherDeviceValues()
803803
}
804804
}
805805
break;
806-
case DEVICE_IMU_BNO080:
807-
{
808-
BNO080 *nodeDevice = (BNO080 *)temp->classPtr;
809-
struct_BNO080 *nodeSetting = (struct_BNO080 *)temp->configPtr;
810-
if (nodeSetting->log == true)
811-
{
812-
// Check that at least one set of readings is being logged
813-
if ((nodeSetting->logQuat) || (nodeSetting->logAccel) || (nodeSetting->logLinAccel) || (nodeSetting->logGyro) || (nodeSetting->logFastGyro) ||
814-
(nodeSetting->logMag) || (nodeSetting->logEuler))
815-
{
816-
if (nodeDevice->dataAvailable()) // Check if new data is available (dangerous? what happens if data is not available?)
817-
{
818-
if (nodeSetting->logQuat)
819-
{
820-
sprintf(tempData, "%.02f,%.02f,%.02f,%.02f,%d,", nodeDevice->getQuatI(), nodeDevice->getQuatJ(), nodeDevice->getQuatK(),
821-
nodeDevice->getQuatReal(), nodeDevice->getQuatRadianAccuracy());
822-
strcat(outputData, tempData);
823-
}
824-
if (nodeSetting->logAccel)
825-
{
826-
sprintf(tempData, "%.02f,%.02f,%.02f,%d,", nodeDevice->getAccelX(), nodeDevice->getAccelY(), nodeDevice->getAccelZ(),
827-
nodeDevice->getAccelAccuracy());
828-
strcat(outputData, tempData);
829-
}
830-
if (nodeSetting->logLinAccel)
831-
{
832-
sprintf(tempData, "%.02f,%.02f,%.02f,%d,", nodeDevice->getLinAccelX(), nodeDevice->getLinAccelY(), nodeDevice->getLinAccelZ(),
833-
nodeDevice->getLinAccelAccuracy());
834-
strcat(outputData, tempData);
835-
}
836-
if (nodeSetting->logGyro)
837-
{
838-
sprintf(tempData, "%.02f,%.02f,%.02f,%d,", nodeDevice->getGyroX(), nodeDevice->getGyroY(), nodeDevice->getGyroZ(),
839-
nodeDevice->getGyroAccuracy());
840-
strcat(outputData, tempData);
841-
}
842-
if (nodeSetting->logFastGyro)
843-
{
844-
sprintf(tempData, "%.02f,%.02f,%.02f,", nodeDevice->getFastGyroX(), nodeDevice->getFastGyroY(), nodeDevice->getFastGyroZ());
845-
strcat(outputData, tempData);
846-
}
847-
if (nodeSetting->logMag)
848-
{
849-
sprintf(tempData, "%.02f,%.02f,%.02f,%d,", nodeDevice->getMagX(), nodeDevice->getMagY(), nodeDevice->getMagZ(),
850-
nodeDevice->getMagAccuracy());
851-
strcat(outputData, tempData);
852-
}
853-
if (nodeSetting->logEuler)
854-
{
855-
sprintf(tempData, "%.01f,%.01f,%.01f,", nodeDevice->getRoll() * 180.0 / PI, nodeDevice->getPitch() * 180.0 / PI,
856-
nodeDevice->getYaw() * 180.0 / PI);
857-
strcat(outputData, tempData);
858-
}
859-
}
860-
}
861-
}
862-
}
863-
break;
864806
default:
865807
Serial.printf("printDeviceValue unknown device type: %s\r\n", getDeviceName(temp->deviceType));
866808
break;
@@ -1230,28 +1172,6 @@ void printHelperText(bool terminalOnly)
12301172
}
12311173
}
12321174
break;
1233-
case DEVICE_IMU_BNO080:
1234-
{
1235-
struct_BNO080 *nodeSetting = (struct_BNO080 *)temp->configPtr;
1236-
if (nodeSetting->log)
1237-
{
1238-
if (nodeSetting->logQuat)
1239-
strcat(helperText, "QuatI,QuatJ,QuatK,QuatR,QuatAcc,");
1240-
if (nodeSetting->logAccel)
1241-
strcat(helperText, "AccelX,AccelY,AccelZ,AccelAcc,");
1242-
if (nodeSetting->logLinAccel)
1243-
strcat(helperText, "LinAccelX,LinAccelY,LinAccelZ,LinAccelAcc,");
1244-
if (nodeSetting->logGyro)
1245-
strcat(helperText, "GyroX,GyroY,GyroZ,GyroAcc,");
1246-
if (nodeSetting->logFastGyro)
1247-
strcat(helperText, "FastGyroX,FastGyroY,FastGyroZ,");
1248-
if (nodeSetting->logMag)
1249-
strcat(helperText, "MagX,MagY,MagZ,MagAcc,");
1250-
if (nodeSetting->logEuler)
1251-
strcat(helperText, "Roll,Pitch,Yaw,");
1252-
}
1253-
}
1254-
break;
12551175
default:
12561176
Serial.printf("\nprinterHelperText device not found: %d\r\n", temp->deviceType);
12571177
break;

Firmware/OpenLog_Artemis/autoDetect.ino

Lines changed: 1 addition & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -237,12 +237,6 @@ bool addDevice(deviceType_e deviceType, uint8_t address, uint8_t muxAddress, uin
237237
temp->configPtr = new struct_SNGCJA5;
238238
}
239239
break;
240-
case DEVICE_IMU_BNO080:
241-
{
242-
temp->classPtr = new BNO080;
243-
temp->configPtr = new struct_BNO080;
244-
}
245-
break;
246240
default:
247241
Serial.printf("addDevice Device type not found: %d\r\n", deviceType);
248242
break;
@@ -465,18 +459,6 @@ bool beginQwiicDevices()
465459
temp->online = true;
466460
}
467461
break;
468-
case DEVICE_IMU_BNO080:
469-
{
470-
BNO080 *tempDevice = (BNO080 *)temp->classPtr;
471-
struct_BNO080 *nodeSetting = (struct_BNO080 *)temp->configPtr; //Create a local pointer that points to same spot as node does
472-
if (nodeSetting->powerOnDelayMillis > qwiicPowerOnDelayMillis) qwiicPowerOnDelayMillis = nodeSetting->powerOnDelayMillis; // Increase qwiicPowerOnDelayMillis if required
473-
//if(settings.printDebugMessages == true) tempDevice->enableDebugging();
474-
if (tempDevice->begin(temp->address, qwiic) == true) //Address, Wire port. Returns true on success.
475-
temp->online = true;
476-
else
477-
printDebug(F("beginQwiicDevices: BNO080.begin failed.\r\n"));
478-
}
479-
break;
480462
default:
481463
Serial.printf("beginQwiicDevices: device type not found: %d\r\n", temp->deviceType);
482464
break;
@@ -701,7 +683,7 @@ void configureDevice(node * temp)
701683
SFE_ADS122C04 *sensor = (SFE_ADS122C04 *)temp->classPtr;
702684
struct_ADS122C04 *sensorSetting = (struct_ADS122C04 *)temp->configPtr;
703685

704-
//Configure the wire mode for readPT100Centigrade and readPT100Fahrenheit
686+
//Configure the wite mode for readPT100Centigrade and readPT100Fahrenheit
705687
//(readInternalTemperature and readRawVoltage change and restore the mode automatically)
706688
if (sensorSetting->useFourWireMode)
707689
sensor->configureADCmode(ADS122C04_4WIRE_MODE);
@@ -723,23 +705,6 @@ void configureDevice(node * temp)
723705
case DEVICE_PARTICLE_SNGCJA5:
724706
//Nothing to configure
725707
break;
726-
case DEVICE_IMU_BNO080:
727-
{
728-
BNO080 *sensor = (BNO080 *)temp->classPtr;
729-
struct_BNO080 *sensorSetting = (struct_BNO080 *)temp->configPtr;
730-
731-
if ((sensorSetting->logQuat) || (sensorSetting->logEuler))
732-
sensor->enableRotationVector((uint16_t)(settings.usBetweenReadings / 1000));
733-
if (sensorSetting->logAccel)
734-
sensor->enableAccelerometer((uint16_t)(settings.usBetweenReadings / 1000));
735-
if (sensorSetting->logLinAccel)
736-
sensor->enableLinearAccelerometer((uint16_t)(settings.usBetweenReadings / 1000));
737-
if ((sensorSetting->logGyro) || (sensorSetting->logFastGyro))
738-
sensor->enableGyro((uint16_t)(settings.usBetweenReadings / 1000));
739-
if (sensorSetting->logMag)
740-
sensor->enableMagnetometer((uint16_t)(settings.usBetweenReadings / 1000));
741-
}
742-
break;
743708
default:
744709
Serial.printf("configureDevice: Unknown device type %d: %s\r\n", deviceType, getDeviceName((deviceType_e)deviceType));
745710
break;
@@ -830,9 +795,6 @@ FunctionPointer getConfigFunctionPtr(uint8_t nodeNumber)
830795
case DEVICE_PARTICLE_SNGCJA5:
831796
ptr = (FunctionPointer)menuConfigure_SNGCJA5;
832797
break;
833-
case DEVICE_IMU_BNO080:
834-
ptr = (FunctionPointer)menuConfigure_BNO080;
835-
break;
836798
default:
837799
Serial.println(F("getConfigFunctionPtr: Unknown device type"));
838800
Serial.flush();
@@ -970,7 +932,6 @@ void swap(struct node * a, struct node * b)
970932
#define ADR_UBLOX 0x42 //But can be set to any address
971933
#define ADR_ADS122C04 0x45 //Alternates: 0x44, 0x41 and 0x40
972934
#define ADR_TMP117 0x48 //Alternates: 0x49, 0x4A, and 0x4B
973-
#define ADR_BNO080 0x4B //Alternate: 0x4A
974935
#define ADR_SGP30 0x58
975936
#define ADR_CCS811 0x5B //Alternates: 0x5A
976937
#define ADR_LPS25HB 0x5D //Alternates: 0x5C
@@ -1102,14 +1063,6 @@ deviceType_e testDevice(uint8_t i2cAddress, uint8_t muxAddress, uint8_t portNumb
11021063
break;
11031064
case 0x4A:
11041065
{
1105-
//Confidence: High - Checks product ID report
1106-
BNO080 sensor1;
1107-
if(settings.printDebugMessages == true) sensor1.enableDebugging();
1108-
if (sensor1.begin(i2cAddress, qwiic) == true) //Address, Wire port
1109-
return (DEVICE_IMU_BNO080);
1110-
else
1111-
printDebug(F("testDevice: BNO080.begin failed.\r\n"));
1112-
11131066
//Confidence: High - Checks 16 bit ID
11141067
TMP117 sensor;
11151068
if (sensor.begin(i2cAddress, qwiic) == true) //Address, Wire port
@@ -1118,14 +1071,6 @@ deviceType_e testDevice(uint8_t i2cAddress, uint8_t muxAddress, uint8_t portNumb
11181071
break;
11191072
case 0x4B:
11201073
{
1121-
//Confidence: High - Checks product ID report
1122-
BNO080 sensor1;
1123-
if(settings.printDebugMessages == true) sensor1.enableDebugging();
1124-
if (sensor1.begin(i2cAddress, qwiic) == true) //Address, Wire port
1125-
return (DEVICE_IMU_BNO080);
1126-
else
1127-
printDebug(F("testDevice: BNO080.begin failed.\r\n"));
1128-
11291074
//Confidence: High - Checks 16 bit ID
11301075
TMP117 sensor;
11311076
if (sensor.begin(i2cAddress, qwiic) == true) //Address, Wire port
@@ -1525,9 +1470,6 @@ const char* getDeviceName(deviceType_e deviceNumber)
15251470
case DEVICE_PARTICLE_SNGCJA5:
15261471
return "Particle-SNGCJA5";
15271472
break;
1528-
case DEVICE_IMU_BNO080:
1529-
return "IMU-BNO080";
1530-
break;
15311473

15321474
case DEVICE_UNKNOWN_DEVICE:
15331475
return "Unknown device";

Firmware/OpenLog_Artemis/menuAttachedDevices.ino

Lines changed: 0 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -315,9 +315,6 @@ void menuAttachedDevices()
315315
case DEVICE_PARTICLE_SNGCJA5:
316316
Serial.printf("%s SN-GCJA5 Particle Sensor %s\r\n", strDeviceMenu, strAddress);
317317
break;
318-
case DEVICE_IMU_BNO080:
319-
Serial.printf("%s BNO080 IMU %s\r\n", strDeviceMenu, strAddress);
320-
break;
321318
default:
322319
Serial.printf("Unknown device type %d in menuAttachedDevices\r\n", temp->deviceType);
323320
break;
@@ -2154,83 +2151,3 @@ void menuConfigure_SNGCJA5(void *configPtr)
21542151
printUnknown(incoming);
21552152
}
21562153
}
2157-
2158-
void menuConfigure_BNO080(void *configPtr)
2159-
{
2160-
struct_BNO080 *sensorSetting = (struct_BNO080*)configPtr;
2161-
while (1)
2162-
{
2163-
Serial.println();
2164-
Serial.println(F("Menu: Configure BNO080 IMU"));
2165-
2166-
Serial.print(F("1) Sensor Logging: "));
2167-
if (sensorSetting->log == true) Serial.println(F("Enabled"));
2168-
else Serial.println(F("Disabled"));
2169-
2170-
if (sensorSetting->log == true)
2171-
{
2172-
Serial.print(F("2) Log Rotation Vector (Quaternions): "));
2173-
if (sensorSetting->logQuat == true) Serial.println(F("Enabled"));
2174-
else Serial.println(F("Disabled"));
2175-
2176-
Serial.print(F("3) Log Accelerometer: "));
2177-
if (sensorSetting->logAccel == true) Serial.println(F("Enabled"));
2178-
else Serial.println(F("Disabled"));
2179-
2180-
Serial.print(F("4) Log Linear Acceleration (Minus Gravity): "));
2181-
if (sensorSetting->logLinAccel == true) Serial.println(F("Enabled"));
2182-
else Serial.println(F("Disabled"));
2183-
2184-
Serial.print(F("5) Log Gyro: "));
2185-
if (sensorSetting->logGyro == true) Serial.println(F("Enabled"));
2186-
else Serial.println(F("Disabled"));
2187-
2188-
Serial.print(F("6) Log FastGyro: "));
2189-
if (sensorSetting->logFastGyro == true) Serial.println(F("Enabled"));
2190-
else Serial.println(F("Disabled"));
2191-
2192-
Serial.print(F("7) Log Magnetometer: "));
2193-
if (sensorSetting->logMag == true) Serial.println(F("Enabled"));
2194-
else Serial.println(F("Disabled"));
2195-
2196-
Serial.print(F("8) Log Euler Angles (Roll/Pitch/Yaw): "));
2197-
if (sensorSetting->logEuler == true) Serial.println(F("Enabled"));
2198-
else Serial.println(F("Disabled"));
2199-
}
2200-
Serial.println(F("x) Exit"));
2201-
2202-
byte incoming = getByteChoice(menuTimeout); //Timeout after x seconds
2203-
2204-
if (incoming == '1')
2205-
sensorSetting->log ^= 1;
2206-
else if (sensorSetting->log == true)
2207-
{
2208-
if (incoming == '2')
2209-
sensorSetting->logQuat ^= 1;
2210-
else if (incoming == '3')
2211-
sensorSetting->logAccel ^= 1;
2212-
else if (incoming == '4')
2213-
sensorSetting->logLinAccel ^= 1;
2214-
else if (incoming == '5')
2215-
sensorSetting->logGyro ^= 1;
2216-
else if (incoming == '6')
2217-
sensorSetting->logFastGyro ^= 1;
2218-
else if (incoming == '7')
2219-
sensorSetting->logMag ^= 1;
2220-
else if (incoming == '8')
2221-
sensorSetting->logEuler ^= 1;
2222-
else if (incoming == 'x')
2223-
break;
2224-
else if (incoming == STATUS_GETBYTE_TIMEOUT)
2225-
break;
2226-
else
2227-
printUnknown(incoming);
2228-
}
2229-
else if (incoming == 'x')
2230-
break;
2231-
else if (incoming == STATUS_GETBYTE_TIMEOUT)
2232-
break;
2233-
else
2234-
printUnknown(incoming);
2235-
}
2236-
}

Firmware/OpenLog_Artemis/nvm.ino

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -649,19 +649,6 @@ void recordDeviceSettingsToFile()
649649
settingsFile.println((String)base + "logFanStatus=" + nodeSetting->logFanStatus);
650650
}
651651
break;
652-
case DEVICE_IMU_BNO080:
653-
{
654-
struct_BNO080 *nodeSetting = (struct_BNO080 *)temp->configPtr;
655-
settingsFile.println((String)base + "log=" + nodeSetting->log);
656-
settingsFile.println((String)base + "logQuat=" + nodeSetting->logQuat);
657-
settingsFile.println((String)base + "logAccel=" + nodeSetting->logAccel);
658-
settingsFile.println((String)base + "logLinAccel=" + nodeSetting->logLinAccel);
659-
settingsFile.println((String)base + "logGyro=" + nodeSetting->logGyro);
660-
settingsFile.println((String)base + "logFastGyro=" + nodeSetting->logFastGyro);
661-
settingsFile.println((String)base + "logMag=" + nodeSetting->logMag);
662-
settingsFile.println((String)base + "logEuler=" + nodeSetting->logEuler);
663-
}
664-
break;
665652
default:
666653
Serial.printf("recordSettingsToFile Unknown device: %s\r\n", base);
667654
//settingsFile.println((String)base + "=UnknownDeviceSettings");
@@ -1185,29 +1172,6 @@ bool parseDeviceLine(char* str) {
11851172
Serial.printf("Unknown device setting: %s\r\n", deviceSettingName);
11861173
}
11871174
break;
1188-
case DEVICE_IMU_BNO080:
1189-
{
1190-
struct_BNO080 *nodeSetting = (struct_BNO080 *)deviceConfigPtr; //Create a local pointer that points to same spot as node does
1191-
if (strcmp(deviceSettingName, "log") == 0)
1192-
nodeSetting->log = d;
1193-
else if (strcmp(deviceSettingName, "logQuat") == 0)
1194-
nodeSetting->logQuat = d;
1195-
else if (strcmp(deviceSettingName, "logAccel") == 0)
1196-
nodeSetting->logAccel = d;
1197-
else if (strcmp(deviceSettingName, "logLinAccel") == 0)
1198-
nodeSetting->logLinAccel = d;
1199-
else if (strcmp(deviceSettingName, "logGyro") == 0)
1200-
nodeSetting->logGyro = d;
1201-
else if (strcmp(deviceSettingName, "logFastGyro") == 0)
1202-
nodeSetting->logFastGyro = d;
1203-
else if (strcmp(deviceSettingName, "logMag") == 0)
1204-
nodeSetting->logMag = d;
1205-
else if (strcmp(deviceSettingName, "logEuler") == 0)
1206-
nodeSetting->logEuler = d;
1207-
else
1208-
Serial.printf("Unknown device setting: %s\r\n", deviceSettingName);
1209-
}
1210-
break;
12111175
default:
12121176
Serial.printf("Unknown device type: %d\r\n", deviceType);
12131177
Serial.flush();

0 commit comments

Comments
 (0)