You can create a Dynamic Link Library (DLL) that defines your own routine for inverse kinematics.
An example kinematic routine for user-defined inverse kinematics is provided in the following location of your V6 installation:
<V6_install_dir>\startup\DNBUserKinematics\kin_exmpl.c
- Copy the example file (kin_exmpl.c).
Note:
It is recommended that you work on a copy of the example file to preserve the original.
- Edit the copy of the example file according to your needs.
The kinematic routine provided for creating a user-defined DLL has the following signature:
DllExport int
kin_user( link_lengths, link_offsets, T6, solutions, warnings, pData )
The parameters accepted by the function are defined as follows:
Parameter | Type | Input/Output | Description |
---|
link_lengths[] | double | input | Distance between joint axis along link length, as per D-H (Denevitt-Hartenburg) representation. |
link_offsets[] | double | input | Offset between joint axis along joint axis, as per D-H representation. |
T6[4][4] | double | input | 4x4 position matrix of center of wrist. This is
the goal point MINUS the tool frame and mounting
plate offsets. |
solutions[][] | double | output | A two dimensional array contains all possible
solutions for robot arm. You define how many solutions are possible, and provide all solutions when routine is called:
elbow up, elbow down, etc. |
warnings[] | int | output | Array providing warning states for each solution
Possible warning states are:
- WARN_GOOD_SOLUTION
- WARN_JOINT_LIMIT_EXCEEDED
- WARN_UNREACHABLE
- WARN_SINGULAR_SOLUTION
|
pData | void* | input | Pointer to data structure containing important kinematic parameters
of the robot. |
- Replace the original routine name in the makefile to reflect the name of the copy that you have edited.
Note:
The example makefile is provided in the same location as kin_exmpl.c.
- Run the following command to compile the routine into a DLL
nmake all
- Copy the resulting DLL to the proper location.
To use the new DLL, it must be present in either the CAT_STARTUP_PATH or the location defined by the DLM_USR_KIN_LIB_PATH environment variable.