Modifying speed curve for <DriveBase>.straight() #2083
Answered
by
roykrikke
techcatgato
asked this question in
Q&A
-
Hi all! I was wondering if there's any way to modify the driving speed curve while using straight(). I want to implement something like this: x = (robot.distance() - start_dist) / dist
if x < 0.5:
speed = vmax * (2 * x**2)
else:
speed = vmax * (1 - 2 * (1 - x)**3)
speed += 0.1 |
Beta Was this translation helpful? Give feedback.
Answered by
roykrikke
Feb 22, 2025
Replies: 1 comment 2 replies
-
It looks like you want to control acceleration? You can already do that with https://docs.pybricks.com/en/stable/robotics.html#pybricks.robotics.DriveBase.settings |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can also set turn_rate and turn_acceleration. See the documentation.