Beispiel #1
0
def move_calib():
    from share.tools.classes.f21pa10Class import fpa10Class
    from tools.classes.realsenseClass import realsenseClass

    camera = realsenseClass()
    arm = fpa10Class("_l")

    arm.Th2tool = Th2tool_handCamCalib
    arm.otc_setToolOffset(
        [arm.Th2tool.vec[0], arm.Th2tool.vec[1], arm.Th2tool.vec[2]])

    arm.mode_joint()
    arm.move_joint(arm.j_ready)

    arm.mode_rmrc()
    time.sleep(1)

    plistData = []

    for i in range(len(Pos_B)):
        # raw_input("press Enter to move next point >>")
        arm.move_rmrc(Pos_B[i])

        title = TITLE + str(i) + EXTENSION
        # time.sleep(1)
        # camera.update_image(camera.IR)
        time.sleep(3)
        camera.save_irImage(PATH_IMAGE_DATA + title)

        plistData.append(arm.t_xyzabc_now)

    raw_input("finished. press Enter to back to ready position")
    arm.mode_joint()
    arm.move_joint(arm.j_ready)

    data = {"plistData": plistData}

    json_write(data, PATH_IMAGE_DATA + "plistData.json")
from share.data.handCamCalib.Th2c_ir import *
from share.tools.classes.parallelGripperClass import parallelGripperClass

#import local path ===================
sys.path.append(os.path.join(".."))
import set_env
baseDir = shareDir.WorkspaceDir + set_env.MyName
sys.path.append(baseDir)
from tools.classes.realsenseClass import realsenseClass

################initial###########################################
print "initial pa10"
arm = fpa10Class("_l")

print "initial RealSense"
realsense = realsenseClass()
print "initial Over"

base_xyzabc = [0.65, 0, 0.20, 0, 0, 0]
#base_xyzabc =[0.50, 0.0, 0.55, 0, 0, 0]
# change mode joint  and  move ready pose
print "mode joint"
arm.mode_joint()
print "move ready"
arm.move_ready()
# wait 1 sencond
time.sleep(1)
arm.mode_rmrc()

BasePoint = base_xyzabc[:]
arm.move_rmrc(BasePoint)