1 year ago

#370140

test-img

bennis

Webots Pick and Place while loop

I'm very new to coding with python and was looking for any help explaining how to convert a time-based motion into a motion dependent on position with a while loop. In the tutorial this while loop is given as an example:

# Monitor the arm joint position to detect when the motion is completed.
while robot.step(timestep) != -1:
    if abs(armPositionSensors[3].getValue() - (-1.2)) < 0.01:
        # Motion completed.
        break

The part I'm most confused about is the meaning of the -1.2 and 0.01 values, any explanation would be greatly appreciated.

python

position

sensors

0 Answers

Your Answer

Accepted video resources