Closed eringerli closed 2 years ago
Should this maybe go the other way? Make rawAcc{X,Y,Z}
and rawGyro{X,Y,Z}
protected? I think the intent is to access the sensor values using getEvent()
, and not directly via these data members.
It depends: I read the sensor with 1.66kHz, so less overhead is better. I'd like to call _read()
and get the data out of the class via protected access. PR #34 adds a method to read out the gyro and magnetometer directly via references, which helps a lot. Now I have to create a small class which inherits from ISM330 so I can get access to the floats.
Ah, OK - it helps with reading fast. There's not a lot else extra going on with with getEvent()
, but the minor amount there sounds like it's enough to slow things down.
This seems benign. And can easily change back if this expose some odd regression.
When
rawAcc{X,Y,Z}
andrawGyro{X,Y,Z}
are public, the converted valuesacc{X,Y,Z}
andgyro{X,Y,Z}
should be too.