Revision 8cee904f
Adafruit_BNO055.cpp | ||
---|---|---|
62 | 62 |
if(id != BNO055_ID) |
63 | 63 |
{ |
64 | 64 |
delay(1000); // hold on for boot |
65 |
id = read8(BNO055_CHIP_ID_ADDR); |
|
65 | 66 |
if(id != BNO055_ID) { |
66 | 67 |
return false; // still not? ok bail |
67 | 68 |
} |
... | ... | |
320 | 321 |
z = (((uint16_t)buffer[7]) << 8) | ((uint16_t)buffer[6]); |
321 | 322 |
|
322 | 323 |
/* Assign to Quaternion */ |
323 |
imu::Quaternion quat((double)w, (double)x, (double)y, (double)z); |
|
324 |
/* See http://ae-bst.resource.bosch.com/media/products/dokumente/bno055/BST_BNO055_DS000_12~1.pdf |
|
325 |
3.6.5.5 Orientation (Quaternion) */ |
|
326 |
const double scale = (1.0 / (1<<14)); |
|
327 |
imu::Quaternion quat(scale * w, scale * x, scale * y, scale * z); |
|
324 | 328 |
return quat; |
325 | 329 |
} |
326 | 330 |
|
Also available in: Unified diff