Home Programming

Discussion

Left ArrowBack to discussions page
Erik_CornelsenErik_Cornelsen Posts: 22 Apprentice
Hi, 
Does anyone know why in my example I'm not able to save the actions of the gripper on URSim?
They stay in yellow and I cannot run the program.
Thanks
Erik 
Tagged:

Comments

  • Erik_CornelsenErik_Cornelsen Posts: 22 Apprentice
  • vlastimilvlastimil Posts: 15 Apprentice
    My historical experience, unless something has changed, is that if the Gripper is not physically connected, it is impossible to work with it in the simulator. Therefore, I was forced to create a set of scripting functions, which I bypassed this offline programming, bellow is an example
    If I working in URSim, set:
    isGripperSim = True
    It may not be the best solution, but so far I can do it :-(
      def GripperReset(id="1"):
          if (isGripperSim):
    return True end rq_reset(id) rq_activate_and_wait(id) end def GripperActivate(id="1"): if (isGripperSim):
    return True end rq_activate_and_wait(id) end def GripperKeep(id="1", no=1): if (isGripperSim):
    return no==1 end return rq_is_object_detected(id) end def GripperClose(id="1", pspeed=100, pforce=100): if (isGripperSim):
    return True end rq_set_force_norm(pspeed, id) rq_set_speed_norm(pforce, id) rq_close_and_wait(id) end def GripperOpen(id="1", pspeed=100, pforce=100): if (isGripperSim):
    return True end rq_set_force_norm(pspeed, id) rq_set_speed_norm(pforce, id) rq_open_and_wait(id) end def GripperMove(id="1", pmm=0, pspeed=100, pforce=100): if (isGripperSim):
    return True end rq_set_force_norm(pforce, id) rq_set_speed_norm(pspeed, id) rq_move_and_wait_norm(pmm, id) end

  • Erik_CornelsenErik_Cornelsen Posts: 22 Apprentice
    thanks @vmracko
    could you please share a photo from the screen with a simple program?
  • vlastimilvlastimil Posts: 15 Apprentice
    edited March 2020
    Hi, here is very simple implemenatation:


    It is also possible to add a function for controlled opening in millimeters:

      def GripperMove(id="1", pmm=0, pspeed=100, pforce=100):
          if (isGripperSim):
        	   return True
          end
          rq_set_force_norm(pforce, id)
          rq_set_speed_norm(pspeed, id)
          rq_move_and_wait_norm(pmm, id)
      end

  • Erik_CornelsenErik_Cornelsen Posts: 22 Apprentice
    thanks @vmracko, great job!
    If I understood correctly, in this case you are using an external Script to simulate the functions of the gripper?
    Is not possible to use the built in functions from the URCaps then (even for other products)? 
  • vlastimilvlastimil Posts: 15 Apprentice
    Yes, external script is loaded in BeforStart section a each function, which started with "rq_" are used from URCaps from Robotiq driver installation.
    Similar steps you can use in case of other product supported by URCaps.
  • Erik_CornelsenErik_Cornelsen Posts: 22 Apprentice
    Hi @vmracko,

    I tried to run a simple example but it's giving these errors.
    Also with this can we use the built in functions from the gripper URCap rather than from the script, such as Gripper Move, Gripper Check, etc?

    thanks



  • vlastimilvlastimil Posts: 15 Apprentice
    edited March 2020
    Sorry, in first post function GripperMove is included in external script, check it and remove one declaration: "def GripperMove(..):".
    Functions from the URCaps menu, as shown in the figure, you cannot use, if you want to run the program in URSim, you only have to use the functions from the script.
    Unfortunately, this is a tax for running the program offline :-(.
  • vlastimilvlastimil Posts: 15 Apprentice
    Of course there is a simple way to do it ...

  • Erik_CornelsenErik_Cornelsen Posts: 22 Apprentice
    Thanks @vlastik
    but in this example, are you still able to Run? in other words, does the Gripper Move command becomes white instead of yellow?
  • vlastimilvlastimil Posts: 15 Apprentice
    Yes, in this case you have to make command "Gripper Move" on real robot with connected gripper - not on URSim.
Sign In or Register to comment.
Left ArrowBack to discussions page