-
-
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
[Feature] Also reset heading target when resetting odometry. #1617
Comments
See also #1449 |
Tagging for feedback: @ggramlich, @afarago. |
Sounds good and awesome.
This allows an FLL team to use reset between two missions still keeping the orientation global (N-W-S-E) no matter how they position the robot. FLL and WRO mats have the orientation N facing top and S on the bottom and so forth... This if the team starts the bot facing leftwards it would call |
For Python, the method call as described by @afarago sounds good to me. This would also mean that there is no way to only reset the distance. As my teams are using Block Coding, the name of the block "reset distance and angle" and the example given in https://www.patreon.com/posts/pybricks-3-5-is-102449785 is a bit misleading when you enable useGyro, if you don't know, that the actual reset of the heading is done by the "drive base stop coast" block. https://photos.app.goo.gl/jdEdbWDaD6GCa9B99 So yes, my expectation is also that "reset distance and angle" would reset the heading-angle. |
Agree 100% - elementary age group will not handle global heading. For block coding it would be so nice to have "expandable" blocks - gradually adding more (and more) params to set. |
I think the course of action here is: Change Decide what to do about maintaining hold mode Both should avoid the sitation in @ggramlich's video. Calling Augment and document the block Decide relation with EDIT: We should probably make them always the same. This is the easiest to explain. Even if it isn't the "right" approach from how how the firmware is structured, we can still do it. |
For these to be proper replacements for |
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! |
Is your feature request related to a problem? Please describe.
At the moment, calling
drivebase.reset()
resets the odometry offsets, but doesn't do anything to the controls. So if you are holding, you will keep holding.Based on various discussions like https://github.com/orgs/pybricks/discussions/1616#discussioncomment-9251463, I think the user assumption is that this will also reset any internal controller states.
Describe the solution you'd like
I think it is reasonable to reset the states equivalent to calling
stop()
, so the user does not have to do this themselves, and so they don't forget about it.drivebase.reset()
is usually used when re-aligning the robot with the wall, so having a clean slate here makes sense, so it won't keep trying to maintain any previous targets in case it was holding.I think it may also be reasonable to assume that the user will want to stop when calling
drivebase.reset()
, so maybe physically coasting isn't a bad idea. You could always immediately hold again if you wanted to.When we do that,
reset
really does mean: reset back to the start, as if starting a new mission/program, which is probably what this function is going to be used for anyway.This is a slightly breaking change though, so we'll want to clarify that in the documentation.
The text was updated successfully, but these errors were encountered: