drivebase reset function #1616
Replies: 4 comments 7 replies
-
Which stop mode are you using? You should use Hold for best performance (this is the default). This keeps error accumulation minimal.
Is it random, or is it a constant offset/error? The gyros are not a compass, so they tend to have a slight offset. You can test this with your hub by putting it flat on the table against a wall. Then rotate it. Maybe it will always say 362, for example. Once you know this offset, you can take it into account in your code.
The gyro is pretty good, but it's still recommend to also use other sensors to realign yourself. |
Beta Was this translation helpful? Give feedback.
-
@nothingtodowu Are you aware of https://github.com/orgs/pybricks/discussions/1595#discussioncomment-9103246 ? The issues that you are describing sound similar to ours. They were resulting from us thinking that we could use the options "then hold", "then coast", "then brake" almost interchangeably, but they make a huge difference, especially if you mix them. |
Beta Was this translation helpful? Give feedback.
-
I'm just an end user here, but I would like to see a video of what you are experiencing. We used pybricks on Spike Prime last year, and every time we thought we were having a pybricks problem, it turned out to always be a problem that we had in our code, or a mechanical problem with the robot itself. But we are always on the lookout for the true limitations. So far we felt like we were pushing the envelope with long runs, but the robot has never really let us down. Seeing a video of your robot misbehaving could be really helpful not just to the developers here, but to other end users as well. |
Beta Was this translation helpful? Give feedback.
-
@laurensvalk Happy New Year! I got similar issue as mentioned by users above. I use Spike prime hub and Pybricks block coding. The code after the comment in the below screenshot doesn't work. When I checked the robot, the wheels got stuck and when I lifted the robot from the field they are rotating in the opposite direction. We have to participate in the state level competition soon, so any inputs are greatly appreciated. I used "Continue" "Hold" "Brake" in the command before comment, but no luck.
|
Beta Was this translation helpful? Give feedback.
-
When I write my program at Spike primehub with pybricks, It is amazing that I can go straight 2000 mm and it is no any wrong when I enable use_gyro(True). But I have an issue that when I have more and more operations like robot.straight/robot.turn, then suddenly something went wrong. I turn 90 degree but it turn randomly, maybe 85 degree maybe 95 degree. I try to add robot.reset function to reset all distance and angle, but it still same. After I power off/on my primehub, it works better. But after more operations, it comes again.
Is there any function in Pybricks to reset the drivebase to initial? Thanks a lot.
Beta Was this translation helpful? Give feedback.
All reactions