i have build a pick & place robot arm with 4 servos and a suction cup. The heart is a arduino board.
The automatic pick and place work good if the picking things are every time on the same place.
Now i want that the robot pick the things if he identify it with the camera.
I connect the arduino and the MV M7 with the uart port and it works good.
As main code to identify the things i use the “rectangle” code and thats perfect for me.
import sensor, image, time sensor.reset() sensor.set_pixformat(sensor.RGB565) sensor.set_framesize(sensor.QQVGA) sensor.skip_frames(time = 2000) clock = time.clock() while(True): clock.tick() img = sensor.snapshot() for r in img.find_rects(threshold = 10000): img.draw_rectangle(r.rect(), color = (255, 0, 0)) for p in r.corners(): img.draw_circle(p, p, 5, color = (0, 255, 0)) print(r) print("FPS %f" % clock.fps())
My question is:
Who can help me to expand the “rectangle” code that the robot pick the first detected “rectangle” which was detected by the cam ?