Replies: 14 comments
-
The plan is that several more generic classes will be added to the I can't see from the picture, but does the mechanism work by just running the motors constantly? If so, since your creation uses two motors, you might be able to just use the These two methods will keep the motors in sync as well. Does this mechanism provide a way of detecting the right initial configuration? If so, you can make your robot attain that pose before you initialize the |
Beta Was this translation helpful? Give feedback.
-
@laurensvalk: I've added a few deco elements to take away from the bare skeleton look, and have solved quite a few problems interfacing Lego Technic and the traditional stuff. But the Boost set contains quite a few useful in-between pieces. I will definitely look into using the I have to say that the joy in pushing the start/load button and having one's own creation almost instantly moving and reacting to the software coding is quite something. Thanks again for Pybricks! |
Beta Was this translation helpful? Give feedback.
-
@laurensvalk: Using Here's my code:
Have I done something wrong? The turning movement (coded with straight) is just what I wanted, and the robot turned nicely around its centre. It was enjoyable to watch. Francis Sim |
Beta Was this translation helpful? Give feedback.
-
I think you’ll want to set the positive direction of one of the motors as counterclockwise (using the Direction.COUNTERCLOCKWISE when you initialize motor A or B, whichever fits your application best.) |
Beta Was this translation helpful? Give feedback.
-
@laurensvalk: I added The Now I can start to fine tune-my code. I'm new to multi-legged things, so this is both exploration and fun. Thanks again for Pybricks! |
Beta Was this translation helpful? Give feedback.
-
In that case, try doing it for B, not A.
If So if |
Beta Was this translation helpful? Give feedback.
-
Thanks for the information - I'll check this out. Is it the case with the MoveHub that when I am running DriveBase the third (interactive) motor will not run at the same time? It seems I have an either/or situation with my robot - it's not a problem, just good to know for coding. |
Beta Was this translation helpful? Give feedback.
-
They can be used at the same time. Depending on what you’d like to achieve, perhaps the ‘wait’ argument in some of the motor commands might help. |
Beta Was this translation helpful? Give feedback.
-
I still cannot get my MoveHub to recognise or do anything with Using a bare minimum build, running in front wheel drive mode: and the following code:
The console printout reads For Is it my coding that's preventing |
Beta Was this translation helpful? Give feedback.
-
This is what I described above. Your program ends almost instantly after you give the drive command, so there is no time to see any movement 😄 Try adding a few seconds waiting using: wait(2000) |
Beta Was this translation helpful? Give feedback.
-
I've added the |
Beta Was this translation helpful? Give feedback.
-
As in, move forever? Here is one way to wait until the end of times, or until the batteries run out, whichever comes first: while True:
wait(1000)
# You can do other things in the loop too, like occasionally printing the distance value |
Beta Was this translation helpful? Give feedback.
-
You can use the same technique to drive until the sensor detects something: myDriveBase.drive(150, 5)
while my_sensor.distance() <= 50:
wait(10)
myDriveBase.stop()
print("I drove for", myDriveBase.distance(), "mm") This is essentially what |
Beta Was this translation helpful? Give feedback.
-
Thanks - I'd just worked it out myself, and then your reply came in . Sorry, I should have seen that. Thanks again for your fantastic help! |
Beta Was this translation helpful? Give feedback.
-
Does Pybricks have a Robotics Class for walking robots?
I am prototyping a 6-leg simple walker built on the Movehub, using the two built-in motors to drive right and left leg systems independently. I can only find robotics information for wheeled robots in the Pybricks docs. Can this be adapted for walking Robots, with some way of synchronizing the initial motor setup?
Pybricks works great, and my prototype clambers around when I press run/send. I'd love to have a bit more variety than just going in a staight(ish) line though, but could use some help.
All hints would be very much appreciated.
Beta Was this translation helpful? Give feedback.
All reactions