Skip to content

Returning correct units gyro #30

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 2 commits into from
May 9, 2021
Merged

Returning correct units gyro #30

merged 2 commits into from
May 9, 2021

Conversation

jposada202020
Copy link
Contributor

Correcting Gyro returning Units from DPS to rad/s

@jposada202020 jposada202020 requested a review from a team May 9, 2021 01:36
@ladyada
Copy link
Member

ladyada commented May 9, 2021

kk did you try this on hardware?

@jposada202020
Copy link
Contributor Author

Not this one, I test the L3GD20 and the MPU6050. I verify that the lambda function was working with this :)

def gyro():
    """The gyroscope X, Y, Z axis values as a 3-tuple of
    degrees/second values.
    """
    raw = (1, 2, 3)
    return map(lambda x: math.radians(x * gyro_dps_digit), raw)

 # * 0.01745277777777778
a, b, c = gyro()
print(a,b,c)

# print(5*3.1415/180)
# print(10*3.1415/180)
# print(15*3.1415/180)
#
# print(math.radians(5))
# print(math.radians(10))
# print(math.radians(15))

# 0.08726646259971647
# 0.17453292519943295
# 0.2617993877991494

@ladyada
Copy link
Member

ladyada commented May 9, 2021

kk - what was the circuitpy board?

@jposada202020
Copy link
Contributor Author

tested in

Adafruit CircuitPython 6.2.0 on 2021-04-05; Adafruit Feather RP2040 with rp2040

@ladyada
Copy link
Member

ladyada commented May 9, 2021

oki just makin sure its not just CPython :)

@ladyada ladyada merged commit 72de328 into adafruit:master May 9, 2021
@jposada202020 jposada202020 deleted the returning_correct_units_gyro branch May 9, 2021 02:11
@jposada202020
Copy link
Contributor Author

:), no I was not sure that radians existed in CP so that I did all the granular tests... but one of the good gyro library uses radians, so it was not my idea I just copy from there.

adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request May 11, 2021
Updating https://github.com/adafruit/Adafruit_CircuitPython_AS7341 to 1.1.2 from 1.1.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_AS7341#17 from jposada202020/replacing_named_tuple

Updating https://github.com/adafruit/Adafruit_CircuitPython_BMP3XX to 1.3.6 from 1.3.5:
  > Merge pull request adafruit/Adafruit_CircuitPython_BMP3XX#17 from jposada202020/adding_waitingtime_as_option

Updating https://github.com/adafruit/Adafruit_CircuitPython_DPS310 to 1.2.5 from 1.2.4:
  > Merge pull request adafruit/Adafruit_CircuitPython_DPS310#13 from jposada202020/adding_readme_note

Updating https://github.com/adafruit/Adafruit_CircuitPython_LSM9DS1 to 2.1.9 from 2.1.8:
  > Merge pull request adafruit/Adafruit_CircuitPython_LSM9DS1#30 from jposada202020/returning_correct_units_gyro

Updating https://github.com/adafruit/Adafruit_CircuitPython_MPU6050 to 1.1.8 from 1.1.7:
  > Merge pull request adafruit/Adafruit_CircuitPython_MPU6050#17 from jposada202020/correcting_returning_units_gyro

Updating https://github.com/adafruit/Adafruit_CircuitPython_Wiznet5k to 1.10.0 from 1.9.3:
  > Merge pull request adafruit/Adafruit_CircuitPython_Wiznet5k#36 from xorbit/master

Updating https://github.com/adafruit/Adafruit_CircuitPython_AdafruitIO to 5.3.0 from 5.2.5:
  > Merge pull request adafruit/Adafruit_CircuitPython_AdafruitIO#70 from rodrigoargumedo/create-multiple-records

Updating https://github.com/adafruit/Adafruit_CircuitPython_MatrixPortal to 3.0.1 from 3.0.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_MatrixPortal#78 from flavio-fernandes/fix.issue.77
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.

2 participants