from delta_manager.delta_manager import DeltaManager
Delta = DeltaManager()
Note
Connect to the Gripper using its USB cable and turn its power on
Caution
DO NOT REMOVE THE USB CABLE WHILE THE POWER IS ON
Delta.connect_gripper()
Delta.delta_open_gripper()
Delta.delta_close_gripper()
Delta.delta_rotate_gripper(angle)
Note
Angle in degree -90:90 (it is relative to the current angle)
Delta.open_gripper()
Delta.open_gripper_aBit()
Delta.close_gripper()
Delta.close_gripper_with_feedback()
Note
Returns the result of Grasping: "DoneGrasp" or "failed"
Delta.rotate_gripper(angle):
Note
Angle in degree -90:90 (it is relative to the current angle)
Delta.force_gripper(force):
Note
int from 1 to 5000 uncomment it from delta_manager.py and ask Navid Asadi if you want to use it.
Delta.wait_till_done()
Note
Connect to Taarlabs WIFI/ Use Delta robot's GUI/ Enable it/ REMOVE BARS and put it in server mode.
Caution
BY ENABLING THE ROBOT EACH ARM MUST GO UP TO HIT FRAME AND THEN THEY'LL GO BACK TO REACH ITS HOMING POSITION. DON'T FORGET TO REMOVE BARS AFTER HOMING PROCEDURE!!!!!!!!!!!
Delta.go_home()
Note
Preset position of x:0, y:0, z:-37
Delta.move(x, y, z)
Note
Moves in 5 seconds
Delta.move_with_time(x, y, z, t)
Warning
Don't use times less than 2 seconds ask Navid Pasiar or Arvin Mohammadi if you want.
Delta.wait_till_done_robot()
x,y,z = Delta.read_forward()
Delta.delta_stop_server()
Note
Move the robot to (0,0,-37) (you can capture images and get coordinates wherever you want.)
import cv2
import numpy as np
import delta_manager.camera as Camera
from delta_manager.delta_manager import DeltaManager
cap = cv2.VideoCapture(2, cv2.CAP_DSHOW)
WIDTH = 4000
HEIGHT = 4000
fourcc = cv2.VideoWriter_fourcc(*'XVID')
cap.set(cv2.CAP_PROP_FRAME_WIDTH, WIDTH)
cap.set(cv2.CAP_PROP_FRAME_HEIGHT, HEIGHT)
while True:
_, frame = cap.read()
# Undistort the frame
# DON'T miss this part!!!!!!!!
frame = Camera.undistort(frame)
using_fom_flag = input("Are you using fom?(Y/N)")
if using_fom_flag.upper() == "Y":
z_fom = 2
else:
z_fom = 0
z_obj = 1.9 # Put your objects height here
[x, y, z] = Camera.pixel_to_robot_coordinates(
(u, v),
z_obj = z_fom + z_obj,
gripper='2f85',
robot_capturing_coord=np.array(Delta.read_forward())
)
z -= (z_obj/2) # if the height of your objects is short
# else z -= 2 or 3 cm