
setPos ( pos_i ) print ( "Moving to target %i : angle %.1f " % ( i, ang * 180 / pi )) print ( str ( Pose_2_TxyzRxyz ( target_i ))) robot. Pos () pos_i = pos_i + R * cos ( ang ) pos_i = pos_i + R * sin ( ang ) target_i. #- # Movement relative to the reference frame # Create a copy of the target target_i = Mat ( target_ref ) pos_i = target_i. setSpeed ( 200 ) # Set linear speed in mm/s # Set the number of sides of the polygon: n_sides = 6 R = 100 # make a hexagon around reference target: for i in range ( n_sides + 1 ): ang = i * 2 * pi / n_sides #angle: 0, 60, 120. setRounding ( 10 ) # Set the rounding parameter (Also known as: CNT, APO/C_DIS, ZoneData, Blending radius, cornering.
#Cx programmer dock cross reference window Offline#
MoveJ ( target_ref ) # It is important to provide the reference frame and the tool frames when generating programs offline robot.

Pos () print ( "Drawing a polygon around the target: " ) print ( Pose_2_TxyzRxyz ( target_ref )) # move the robot to the first point: robot. Valid (): raise Exception ( 'No robot selected or available' ) # get the current position of the TCP with respect to the reference frame: # (4x4 matrix representing position and orientation) target_ref = robot. ItemUserPick ( 'Select a robot', ITEM_TYPE_ROBOT ) if not robot. # This macro shows an example to draw a polygon of radius R and n_sides vertices using the RoboDK API for Python # More information about the RoboDK API here: # from robodk.robolink import * # API to communicate with RoboDK from robodk.robomath import * # basic matrix operations # Any interaction with RoboDK must be done through RDK: RDK = Robolink () # Select a robot (popup is displayed if more than one robot is available) robot = RDK.
