Python demo- not able to run python demo with endeffector


#1

hai,

i am trying to control dobot using python demo.

when i am putting the codes for endeffector control (for both suctioncup and gripper), it will run for first time and wont run for the second time unless pressing reset button.
This is happening only after writing codes for endeffector.

any help is appreciated

advance thanks !!!


#2

Hai Ashik

Can you share your code?


#3

hai… here is the code that i used in dobot demo for python. please can you check this one and let me know the problem in the code.

Thanks !!

    dType.SetPTPCmdEx(api, 2, 215,  200,  47.44, current_pose[3], 1)
    current_pose = dType.GetPose(api)
    dType.SetPTPCmdEx(api, 2, 215,  200,  (-10), current_pose[3], 1)
    dType.SetEndEffectorSuctionCupEx(api, 0, 1)
    dType.SetWAITCmdEx(api, 0.25, 1)
    current_pose = dType.GetPose(api)
    dType.SetPTPCmdEx(api, 2, 215,  200,  47.44, current_pose[3], 1)
    dType.SetEndEffectorGripperEx(api, 1, 0)
    dType.SetWAITCmdEx(api, 0.25, 1)
    dType.SetEndEffectorGripperEx(api, 1, 0)
    dType.SetWAITCmdEx(api, 0.25, 1)

#4

Oh…I was misunderstanding…
So, are there both suctioncup line and gripper line?
Btw, which end effector does dobot install?


#5

oh sorry, i send the code mistakenly on a sudden response, actually that(first end effector code) was a commented one. I am using only a single end effector at a time(either suction/jaw gripper). but in both case, the code is running for a single time, then have to reset it as i mentioned in the Title. please consider the following codes for my query. i am using this codes in python demo

  current_pose = dType.GetPose(api)
  dType.SetPTPCmdEx(api, 0, 200, -100,  50, current_pose[3], 1)
  dType.SetEndEffectorSuctionCupEx(api, 1, 1)
  dType.SetWAITCmdEx(api, 1, 1)
  current_pose = dType.GetPose(api)
  dType.SetPTPCmdEx(api, 0, 200,  50,  50, current_pose[3], 1)
  dType.SetEndEffectorSuctionCupEx(api, 0, 1)
  dType.SetWAITCmdEx(api, 1, 1)

Thanks for your kind reply on the topic, and please let me know how to solve the issue.


#6

I’m sorry if my idea is wrong
It’s about end effector control line, the second argument is about air pump, and third one is to absorb(or to grasp).
So, you should control third one instead of second.

  current_pose = dType.GetPose(api)
  dType.SetPTPCmdEx(api, 0, 200, -100,  50, current_pose[3], 1)
  dType.SetEndEffectorSuctionCupEx(api, 1, 1)
  dType.SetWAITCmdEx(api, 1, 1)
  current_pose = dType.GetPose(api)
  dType.SetPTPCmdEx(api, 0, 200,  50,  50, current_pose[3], 1)
  dType.SetEndEffectorSuctionCupEx(api, 1, 0)
  dType.SetWAITCmdEx(api, 1, 1)
  # when you exit this program you should turn off the air pump
  # dType.SetEndEffectorSuctionCupEx(api, 0, 0)