Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

Attach an object in python

#2
I understand you want to add an instruction to your program to attach an object to the gripper, correct?

The line you highlighted will attach the object to the gripper right the same moment you call that instruction (it does not add it to the program).

The following example will help you add the attach event instruction to your program:
Code:
RDK = Robolink()

箴g = RDK.AddProgram("test1")
target = RDK.Item("Target")
tool = RDK.Item("Gripper")
framepallet = RDK.Item("Pallet")

箴g.MoveL(target)

INS_TYPE_EVENT = 7
EVENT_ATTACH = 0
EVENT_DETACH = 1

ins_event_attach = {'Type': INS_TYPE_EVENT, 'Behavior': EVENT_ATTACH, 'ToolPtr': str(tool.item)}
ins_event_detach = {'Type': INS_TYPE_EVENT, 'Behavior': EVENT_DETACH, 'ToolPtr': str(tool.item), 'FramePtr': str(framepallet.item)}
箴g.setParam("Add",ins_event_attach)
箴g.setParam("Add",ins_event_detach)

You can find a similar example here:
//www.sinclairbody.com/doc/en/PythonAPI/exam...structions


Messages In This Thread
Attach an object in python - byartik00- 03-08-2022, 11:10 PM
RE: Attach an object in python - byAlbert- 03-09-2022, 07:50 AM
RE: Attach an object in python - byAlbert- 02-01-2023, 09:03 PM



Users browsing this thread:
1 Guest(s)