Skip to content

Please support calibrated accel & gyro in CurieIMU's API #149

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
PaulStoffregen opened this issue Mar 15, 2016 · 1 comment
Closed

Please support calibrated accel & gyro in CurieIMU's API #149

PaulStoffregen opened this issue Mar 15, 2016 · 1 comment
Milestone

Comments

@PaulStoffregen
Copy link

Please consider adding APIs for Arduino users to get properly scaled data, with the conversion factor done inside the CurieIMU library. There are at least two reasons why I hope you'll do this:

  1. The library can "know" which range is in use, to automatically perform the scaling correctly. In the examples, like File > Examples > CurieIMU > Accelerometer, if a novice Arduino user edits line 36 to configure a wider range, they must also know/remember to edit line 69 to agree with their range setting. While this isn't very difficult for experienced programmers, reducing the possibility for things to go wrong, to make everything "just work" as simply as possible is the design style that makes Arduino so successful.

  2. Over the long-term, this API is likely to be used with other sensors which are likely to have different scaling. By abstracting these hardware specific details and avoiding them within the user's code, the API can be much more useful over the very long term.

Probably the simplest approach would be functions with the same names which take references to float, and populate the floats with data properly scaled.

@kitsunami kitsunami added this to the Bellatrix milestone Mar 15, 2016
@kitsunami kitsunami modified the milestones: Castor, Bellatrix Jun 10, 2016
@kitsunami kitsunami assigned SidLeung and unassigned bigdinotech Jun 13, 2016
@eriknyquist eriknyquist assigned eriknyquist and unassigned SidLeung Jun 30, 2016
@eriknyquist
Copy link
Contributor

eriknyquist commented Jun 30, 2016

Hi @PaulStoffregen, so currently raw accelerometer data (for example) is grabbed with
void CurieIMUClass::readAccelerometer(int& x, int& y, int& z). If we added another function like this
void CurieIMUClass::readAccelerometer(int& x, int& y, int& z, int range), where 'range' is the same value passed to setAccelerometerRange and the resulting values are scaled accordingly,
is this what you mean?

eriknyquist added a commit to eriknyquist/corelibs-arduino101 that referenced this issue Jul 17, 2016
Add implementations of readAccelerometer and readGyro which
return values that are scaled according to the range set with
setAccelerometerRange and setGyroRange
eriknyquist added a commit to eriknyquist/corelibs-arduino101 that referenced this issue Jul 18, 2016
Add implementations of readAccelerometer and readGyro which
return values that are scaled according to the range set with
setAccelerometerRange and setGyroRange
eriknyquist added a commit to eriknyquist/corelibs-arduino101 that referenced this issue Jul 21, 2016
Add implementations of readAccelerometer and readGyro which
return values that are scaled according to the range set with
setAccelerometerRange and setGyroRange
eriknyquist added a commit to eriknyquist/corelibs-arduino101 that referenced this issue Jul 21, 2016
Add implementations of readAccelerometer and readGyro which
return values that are scaled according to the range set with
setAccelerometerRange and setGyroRange
ndgbuilder pushed a commit that referenced this issue Jul 22, 2016
Add implementations of readAccelerometer and readGyro which
return values that are scaled according to the range set with
setAccelerometerRange and setGyroRange
sgbihu pushed a commit to sgbihu/corelibs-arduino101 that referenced this issue Jul 29, 2016
Add implementations of readAccelerometer and readGyro which
return values that are scaled according to the range set with
setAccelerometerRange and setGyroRange
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants