MagPI Robot with Zeroborg and yetiborg-web control pyhton script

Hi,

I just changed from rock candy control to web control with camera.
In the MagPI magazine one should use diddyborg-webyetiweb.py, after download, this file is not available.
So I tried to use yetiWeb.py .... it works so far, but steer works only if I want to drive forward and backward.
Pushing Turn Right: front wheels are running.
Pushing Turn Left: back wheels are running

What does spin left / right really means?
Pushing Spin left: front wheels are running back / back wheels are running forward
Pushing Spin right: front wheels running forward.

I think, I have to change ports on the board leading to the gear motors.

Do you have an idea which one to which ports or can I change it in the pyhton script?

Many thx in advance ...

kind regards

Peter

piborg's picture

If you pick the robot up and try the buttons you should see the following behaviour:

  • Forward - All motors run forwards
  • Reverse - All motors run backwards
  • Spin left - Right wheels run forward, left wheels run backward
  • Spin right - left wheels run forward, right wheels run backward
  • Turn left - Right wheels run forward, left wheels are stopped
  • Turn right - left wheels run forward, right wheels are stopped

The motor outputs are set by these lines:

            ZB.SetMotor1(-driveRight * maxPower) # Front right
            ZB.SetMotor2(-driveLeft  * maxPower) # Front left
            ZB.SetMotor3(-driveLeft  * maxPower) # Rear left
            ZB.SetMotor4(-driveRight * maxPower) # Rear right

This means the code expects the motors to be wired as:

  • M1 -> Front Right
  • M2 -> Front Left
  • M3 -> Rear Left
  • M4 -> Rear Right

You may also need to swap + and - connections so that all four motors run forwards when Forward is pressed.

Hi works,

many thx whereever you are ...

kind regards

Peter

Subscribe to Comments for "MagPI Robot with Zeroborg and yetiborg-web control pyhton script"