Navigation

This section is the reference of the robodk module. This module includes the Mat class to represent transformations in 3D. The robodk module is a robotics toolbox for Python, based on Peter Corke’s Robotics Toolbox (regarding pose transformations): http://petercorke.com/Robotics_Toolbox.html.

The following example uses the robodk and robolink libraries to move a robot.

fromrobolinkimport*# import the robolink library (bridge with RoboDK)fromrobodkimport*# import the robodk library (robotics toolbox)RDK=Robolink()# establish a link with the simulatorrobot=RDK.Item('KUKA KR210')# retrieve the robot by namerobot.setJoints([0,90,-90,0,0,0])# set the robot to the home positiontarget=robot.Pose()# retrieve the current target as a pose (position of the active tool with respect to the active reference frame)xyzabc=Pose_2_KUKA(target)# Convert the 4x4 pose matrix to XYZABC position and orientation angles (mm and deg)x,y,z,a,b,c=xyzabc# Calculate a new pose based on the previous posexyzabc2=[x,y,z+50,a,b,c+45]target2=KUKA_2_Pose(xyzabc2)# Convert the XYZABC array to a pose (4x4 matrix)robot.MoveJ(target2)# Make a linear move to the calculated position

fromrobolinkimport*# import the robolink libraryfromrobodkimport*# import the robodk libraryRDK=Robolink()# connect to the RoboDK APIrobot=RDK.Item('',ITEM_TYPE_ROBOT)# Retrieve a robot available in RoboDK#target = RDK.Item('Target 1') # Retrieve a target (example)pose=robot.Pose()# retrieve the current robot position as a pose (position of the active tool with respect to the active reference frame)# target = target.Pose() # the same can be applied to targets (taught position)# Read the 4x4 pose matrix as [X,Y,Z , A,B,C] Euler representation (mm and deg): same representation as KUKA robotsXYZABC=Pose_2_KUKA(target)print(XYZABC)# Read the 4x4 pose matrix as [X,Y,Z, q1,q2,q3,q4] quaternion representation (position in mm and orientation in quaternion): same representation as ABB robots (RAPID programming)xyzq1234=Pose_2_ABB(target)print(xyzq1234)# Read the 4x4 pose matrix as [X,Y,Z, u,v,w] representation (position in mm and orientation vector in radians): same representation as Universal Robotsxyzuvw=Pose_2_UR(target)print(xyzuvw)x,y,z,a,b,c=XYZABC# Use the KUKA representation (for example) and calculate a new pose based on the previous poseXYZABC2=[x,y,z+50,a,b,c+45]pose2=KUKA_2_Pose(XYZABC2)# Convert the XYZABC array to a pose (4x4 matrix)robot.MoveJ(pose2)# Make a joint move to the new position# target.setPose(pose2) # We can also update the pose to targets, tools, reference frames, objects, ...

Returns the Denavit-Hartenberg 4x4 matrix for a robot link.
calling dh(rz,tx,tz,rx) is the same as using rotz(rz)*transl(tx,0,tx)*rotx(rx)
calling dh(rz,tx,tz,rx) is the same as calling dh([rz,tx,tz,rx])