Skip to content
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

[Bug] Document imu settings #1905

Closed
BertLindeman opened this issue Oct 28, 2024 · 2 comments
Closed

[Bug] Document imu settings #1905

BertLindeman opened this issue Oct 28, 2024 · 2 comments
Labels
documentation Improvements or additions to documentation

Comments

@BertLindeman
Copy link

Describe the bug
related to #1887
What is the problem?
The documented default value for imu.acceleration_threshold is 250 mm/s2

acceleration_threshold (Number, mm/s²)
The threshold for angular velocity.
The default value is 250 mm/s².

The installed default is 2500.
There might already be an issue or discussion where this it documented, I did not find it.

Seen on
. 3.5.0 at github hash 6c633a8dd
. 3.6.0b1 at github hash 6e56bde4
. 3.6.0b2 at github hash beaaf231

To reproduce
Steps to reproduce the behavior:

  1. run a similar program like the example below
  2. see 2500 being reported as imu.acceleration_threshold

Expected behavior
What did you expect to happen instead?
250 as default imu.acceleration_threshold

Screenshots
none now

example program

from pybricks.hubs import ThisHub
from pybricks.parameters import Button, Color, Direction, Port, Side, Stop, Axis
from pybricks.tools import wait
from pybricks import version
print(version)

hub = ThisHub()

imu_setting = []
all_imu_settings = hub.imu.settings()
imu_settings_len = len(all_imu_settings)

for i in range(imu_settings_len):
    imu_setting.append(all_imu_settings[i])

imu_angular_velocity_threshold = all_imu_settings[0]
imu_angular_accel_threshold = all_imu_settings[1]
# imu_angle_correction = all_imu_settings[2] if imu_settings_len >2 else 0

print(f'imu thresholds velocity: {imu_angular_velocity_threshold:>8.2f} deg/s', end="")
print(f' accel: {imu_angular_accel_threshold:>8.2f} mm/s2')
# print(f' angle_correction {imu_angle_correction:8.2f} deg')
@BertLindeman BertLindeman added the triage Issues that have not been triaged yet label Oct 28, 2024
@laurensvalk laurensvalk changed the title [Bug] [Bug] Document imu settings Oct 29, 2024
@laurensvalk laurensvalk added documentation Improvements or additions to documentation and removed triage Issues that have not been triaged yet labels Oct 29, 2024
@laurensvalk
Copy link
Member

Please see #1105. Thanks!

Suggestions for improved values are welcome. I'd like to change the averaging algorithm slightly so we can use lower defaults without causing problems in noisy environments.

@BertLindeman
Copy link
Author

Sorry I made the change the wrong way.
Was fun trying to make the PR though.
Thank you, Laurens

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants