-
-
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] Toggle gyro use in GyroDriveBase #1054
Comments
I think that will work for me. |
Added support for this to the # Don't use the gyro!
drive_base.use_gyro(False)
# Drive forward (so without gyro)
drive_base.straight(500)
# Use the gyro again
drive_base.use_gyro(True)
# Turn around counterclockwise (with gyro)
drive_base.turn(-180) Still needs documentation, so keeping this issue open. |
First of all, it's absolutely great how the robots act with the I also looked for something like this to have the option to disable the Gyro. So I saw this here and does it makes senses having two DriveBases classes if one has the ability to disable the Gyro and act like the normal one. Does it not makes sense to have just the normal Or is this just for know and will be later merged into one? |
You've read my mind - I've been wondering about this when I added the use_gyro method this week 😄. One reason for doing it this way is because the gyro is not available on all platforms, so the GyroDriveBase is not enabled everywhere. That said, we could of course disable this one method on those hubs. |
I was 50/50 about it, but @Vinz1911 broke the tie. Keeping this open until we update the documentation to match. |
Thats a Good decision 👍🏻 Thanks @laurensvalk |
Hi, just discovered GyroDriveBase in the beta version. The drive_base.straight() works wonders! I can push the robot when it is running, and it will self-correct to the original heading!
Let me know. thanks |
Hi @dctian,
Glad to hear it!
I think the
Since it is not a compass, it doesn't know what a degree is precisely, but it should at least be consistent. So by scaling you could adjust for it. To find the scale, put your hub flat on the table measure/print the What we could perhaps do is add a built-in routine and store the scale adjustment on the hub. For now you can do it yourself. |
+1 for the scaling factor of the gyro - this would simplify the life of the users and add a one-time calibration routine/factor to the top. classDriveBase(left_motor, right_motor, wheel_diameter, axle_track, use_gyro) |
It would seem nice to have this as a separate calibration routine you’d do once, with the result saved in storage on the hub. It would be nice to avoid such values in user programs because they’d be tied to one specific hub and you couldn’t share them with your team or online. The main thing holding this back is how to do it properly in 3D, but maybe we can start off with a single constant for 1D as we have everywhere else. |
+1 to have a calibration function that we run on each robot and save the calibration value on the hub.
+1 to do this for 1D (yaw) for now.
Thank you for such a wonderful upgrade to spike prime’s python module!
On Sep 13, 2023, at 1:38 PM, laurensvalk ***@***.***> wrote:
It would seem nice to have this as a separate calibration routine you’d do once, with the result saved in storage on the hub.
It would be nice to avoid such values in user programs because they’d be tied to one specific hub and you couldn’t share them with your team or online.
The main thing holding this back is how to do it properly in 3D, but maybe we can start off with a single constant for 1D as we have everywhere else.
—
Reply to this email directly, view it on GitHub<#1054 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ALM4V3WJJQ2AKU45IZSVKMDX2IKSJANCNFSM6AAAAAAXPJOUUI>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
At the moment, the |
This is done. A separate issue is open for calibration in #943 |
Is your feature request related to a problem? Please describe.
See https://fosstodon.org/@laurensvalk/110276807095122260
Describe the solution you'd like
I think it makes sense to add a method like
.enable_gyro(False)
to theGyroDriveBase
class to toggle gyro use.This will essentially just change the
use_gyro
setting insidepbio
, but crucially also reset the relevant offsets for gyro and motor angles.The text was updated successfully, but these errors were encountered: