Links are defined by 3 parameters from the DH-parameter convention (d,a,alpha). To create a link:
Link1 = RobotModels.Link(d,a,alpha)
To create a serial link manipulator, simply add Link objects to a list and pass to SerialLink class:
Link1 = RobotModels.Link(0,0,np.pi/2)
Link2 = RobotModels.Link(0,0.2,0)
Link3 = RobotModels.Link(0,0.2,0)
bot = RobotModels.SerialLink([Link1, Link2, Link3], origin = [1,0,0])
- origin: set origin of robot base link (defaults to [0,0,0])
- initY: initialize joints (defaults to 0 degrees for each joint)
- name: name of robot (default is "robot")
At this time, this class only supports forward kinematics of the end effector and all joint locations of the robot. If no angle is provided, it will use the current angle set internally after initialization or setting joints via bot.setY(Q)
.
To get the end effector position and orientation:
Q = np.column_stack(np.deg2rad([45,30,50]))
Position, Orientation = bot.fkin(Q)
To get array of all joint positions (and optionally orientations):
Positions = bot.fkin_all(Q) # does not return orientations by default
The class supports basic plotting of the serial link manipulator:
ax = bot.plot3D(Q, elev = 45, azim = 240)