Skip to content

change from dps->rads for gyro to fix #9 #14

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

Merged
merged 3 commits into from
Apr 20, 2020
Merged

change from dps->rads for gyro to fix #9 #14

merged 3 commits into from
Apr 20, 2020

Conversation

siddacious
Copy link
Contributor

I neglected to convert to radians/sec when I first wrote the lib, so here's a fix!

Thanks to @kevinjwalters for reporting the issue

@siddacious siddacious requested a review from a team April 16, 2020 22:23
x = self._scale_gyro_data(raw_gyro_data[0])
y = self._scale_gyro_data(raw_gyro_data[1])
z = self._scale_gyro_data(raw_gyro_data[2])
x = self._scale_gyro_data(raw_gyro_data[0]) * _DPS_TO_RADS
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could use math.radians(self._scale_gyro_data....) instead, and lose the _DPS_TO_RADS constant. math.radians() is standard in Python and I checked for its presence in CircuitPython.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@siddacious try a x, y, z = [math.radians(self._scale_gyro_data(i)) for in raw_gyro_data]

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@siddacious siddacious requested a review from jepler April 20, 2020 20:36
Copy link
Contributor

@jepler jepler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for making the requested change.

@jepler jepler merged commit 24224cc into master Apr 20, 2020
@siddacious siddacious deleted the rads_fix branch April 20, 2020 20:40
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Apr 24, 2020
Updating https://github.com/adafruit/Adafruit_CircuitPython_AM2320 to 1.2.2 from 1.2.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_AM2320#16 from jerryneedell/jerryn_revert_pr_9

Updating https://github.com/adafruit/Adafruit_CircuitPython_LIS2MDL to 2.1.3 from 2.1.2:
  > Merge pull request adafruit/Adafruit_CircuitPython_LIS2MDL#5 from FoamyGuy/master

Updating https://github.com/adafruit/Adafruit_CircuitPython_LSM6DS to 2.1.3 from 2.1.2:
  > Merge pull request adafruit/Adafruit_CircuitPython_LSM6DS#14 from adafruit/rads_fix
  > Merge pull request adafruit/Adafruit_CircuitPython_LSM6DS#13 from adafruit/pylint-update

Updating https://github.com/adafruit/Adafruit_CircuitPython_BLE to 6.1.3 from 6.1.2:
  > Merge pull request adafruit/Adafruit_CircuitPython_BLE#80 from dhalbert/initial-value-none
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants