-
-
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
Use functions such as run_time, run_angle or run_target for DriveBase #1176
Comments
To find the rated speeds, print We made quite a few additions to the DriveBase recently, but those updates aren't currently planned for EV3 |
Ok, I will try that, thanks alot! Is there a way for the first problem to be solved without the updates? Also, is there any documentation on this module other than this? |
Do you mean angle of the robot, or angle of the wheels? For the former, you could use |
To drive for time, you could |
That was also the solution I came to, but it seemed kinda janky to me.
Ok, going to try that!
I definitely agree, but my son is trying to do the exercises (that often require angle or time specifications) in your book on the EV3 (extremely good and helpful for learning graphical programming!) with Python as he already completed it with the official Lego software years ago and is now trying to expand his Python skills. |
Ha, in that case --- I used wheel degrees in my books because a good drive block with distance units was not available in the LEGO apps. That's essentially what we're trying to fix with Pybricks 😄 (that, and many other things. We're gradually getting there!) |
Oh, ok, makes sense😄! Is there still a chance that the EV3 will be supported with Pybricks 3.3? My son now updated his EV3 to 3.3 manually, lets hope it's stable... #!/usr/bin/env pybricks-micropython
from pybricks.hubs import EV3Brick
from pybricks.ev3devices import Motor
from pybricks.parameters import Port, Stop
from pybricks.robotics import DriveBase
from pybricks.tools import wait
from time import sleep
# Initialize the EV3 Brick.
ev3 = EV3Brick()
# Initialize the motors.
left_motor = Motor(Port.B)
right_motor = Motor(Port.C)
# Initialize the drive base.
robot = DriveBase(left_motor, right_motor, wheel_diameter=43, axle_track=141)
speed = right_motor.control.limits()[0]
acceleration = right_motor.control.limits()[1]
robot.settings(straight_speed=speed, straight_acceleration=acceleration)
robot.straight(distance=1000, wait=False)
# Output:
# File "/home/robot/Book/Test.py", line 20, in <module>
# ValueError: Invalid argument |
I opened #1184 to request a more useful error message. In the meantime, I would suggest printing the default limits/settings to get known valid values and then start tweaking from there. |
We already tried that, but it outputs a speed value of 800 which throws the error. If we lower this value to exactly 750, it doesn't throw the error anymore. But if we now try to start the motors at 10% an increase them by 10% every meter, they seem to reach their maximum speed at a speed value of around 200-300. Is there a way to find out the exact speed value required to let the motors run at e.g. 30%? |
You can look up the (Related: discussion about how to detect motor overload condition: #1069). |
The title may be a bit confusing, but basically I want an ev3 robot with two wheels to drive for a certain amount of time/ for a certain angle. Is there any way to accomplish this behaviour? Also, what is right amount of speed for the large motors to equal 100% in EV3-G? I'm pretty new to pybricks(but not that new to python if that helps) and Github, so please apologize if this question has already been answered or mislabeled.
Thanks in advance
The text was updated successfully, but these errors were encountered: