I hope somebody can help me out with my issue.
I generated a 6x5 Array with the Boolean Values and another 6x5 Array with the Real Values.
Now I know if a spot is empty or not. Also, I know the height of the component.
So I created a while-for-if-else function for sorting the objects by height. After sorting it should look like this: First floor cylinder, second cone, third cube and fourth the weird pyramid.
On the picture I highlighted the spot 23 with the gray cylinder and the gripper moved it to spot 14. Everything ok.
Now look at the output panel: First it said spot 14 is empty, but after moving it is still empty
The while loop checks every time at the beginning the new status of the sensors, but it only updates the sensor values, when clearing out the world and loading the project again.
I cannot find a python programming mistake in this, also I had a friend checked my python script.
That is my sorting function:
Question.txt (1.7 KB)
Am I missing something in my python programming?
That would be awesome if someone has a tip for that.