-
-
Notifications
You must be signed in to change notification settings - Fork 7
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] drivebase.turn with Stop.HOLD forgets that headling angle has been reset to zero #1818
Comments
I don't see where you are calling |
You got me. (and as always as quick as a scalded dog) I did hub.imu.reset_heading(0) And I thought (did I?) the drive base would know about it. [EDIT]
|
Thanks! Related, while we are looking at this: #1449 |
Also related #1617 |
As for As for this issue:
Calling To reset anything to the drivebase, it is probably better to call |
This was also asked in https://github.com/orgs/pybricks/discussions/1767. I'm not decided what's best here. It seems odd that interacting with the OK - here's a way that could make sense. If we think of the |
Put simply, I think we'll just have to make a drive base stop if you reset the gyro angle while the drivebase is using it. Does that make sense? Any objections? ( If you deliberately throw off your instruments mid flight by 90 degrees, you better be prepared to restart your engines 😄 ) |
This is implemented in pybricks/pybricks-micropython@fee5925 |
Would it be better to raise an exception to not allow calling the function rather than just stopping the drivebase? |
I don't really know what's best. See e.g. https://github.com/orgs/pybricks/discussions/1767 Stopping kind of makes sense when resetting the heading with |
This partially reverts commit fee5925, then implements the alternate behavior. See pybricks/support#1818
The fix is available for testing using these instructions to try the latest version Please re-open if you experience any further issues or inconsistencies. Thank you! |
Describe the bug
Reset the drivebase heading angle to zero and do a turn with Stop.HOLD.
First time goes OK, each next time (despite a heading reset each time) the robot turns n times the angle.
To reproduce
Steps to reproduce the behavior:
Expected behavior
Except for some precision the stop mode should not have very much influence.
The angle turned should be in the same order.
Screenshots
None now.
test program
issue_1767_report.py
It gets really funny if Stop.NONE is used.
The robot goes berserk.
Probably related to #1767 and maybe #1811 although I see no heading reset or stop mode set there.
TL;DR
A larger program that prints markdown text from the results
issue_1767_multitest.py
Result of a testrun:
Bert
The text was updated successfully, but these errors were encountered: