DoF - a Robotiq Community
Warning sign
The Dof Community was shut down in June 2023. This is a read-only archive.
If you have questions about Robotiq products please reach our support team.
Etienne_Samson

Awesome job guys!

Etienne_Samson

Here is how we did it at Robotiq. Note that we decided to put a wait of 5 seconds after picking the pucks to let the robot measure accurately in a stable position the moment caused by the weight of the puck.

https://www.youtube.com/watch?v=OZ64Lrfv8sg&list=PLsu4qiywzR493i4hHR4YIBaZtpAy5Fzko&index=1

Here is the code:

Program
   Init Variables
   BeforeStart
     Script: accessor_capt.script
     socket_close("stream")
     socket_open("127.0.0.1",63351,"stream")
   Robot Program
     MoveJ
       Waypoint_1
       Gripper Open
       var_1≔0
       var_2≔0
       var_3≔0
     Loop
       If var_1≟0
         Camera Locate
           MoveL
             Waypoint_2
             Waypoint_3
             Gripper Close
             Waypoint_4
             If rq_is_object_detected()== True 
               MoveJ
                 Waypoint_5
                 Waypoint_6
                 Gripper Open
                 Waypoint_7
                 var_1≔1
             MoveJ
               Waypoint_1
               Gripper Open
       If var_2≟0
         Camera Locate
           MoveL
             Waypoint_8
             Waypoint_9
             Gripper Close
             Waypoint_10
             If rq_is_object_detected()== True 
               MoveJ
                 Waypoint_12
                 Waypoint_11
                 Gripper Open
                 Waypoint_13
                 var_2≔1
         MoveJ
           Waypoint_1
           Gripper Open
       If var_3<2
         Camera Locate
           MoveL
             Waypoint_16
             Waypoint_14
             Gripper Close
             Waypoint_15
             If rq_is_object_detected()== True 
               MoveJ
                 Waypoint_20
                 Wait: 5.0
               If Mx≤-0.25
                 MoveJ
                   Waypoint_18
                   Waypoint_17
                   Gripper Open
                   Waypoint_19
                   var_3≔var_3+1
               Else
                 MoveJ
                   Waypoint_22
                   Waypoint_21
                   Gripper Open
                   Waypoint_23
                   var_3≔var_3+1
             MoveJ
               Waypoint_1
               Gripper Open
       If var_1≟1 and var_2≟1 and var_3≟2
         Halt
       Wait: 0.01
   Thread_1
     sensor_data≔socket_read_ascii_float(6,"stream")
     If sensor_data[0] ≥6
       Fx≔sensor_data[1]
       Fy≔sensor_data[2]
       Fz≔sensor_data[3]
       Mx≔sensor_data[4]
       My≔sensor_data[5]
       Mz≔sensor_data[6]
     Else
       Fx≔0.0
       Fy≔0.0
       Fz≔0.0
       Mx≔0.0
       My≔0.0
       Mz≔0.0
   SubP_rq_set_zero
     rq_set_zero()
   SubP_rq_print_firmware_version
     rq_print_firmware_version()
   SubP_rq_print_prod_year
     rq_print_prod_year()
   SubP_rq_print_serial_number
     rq_print_serial_number()
   SubP_rq_print_version
     rq_get_version()