Inverse and Forward Kinematics
Perform forward and inverse kinematics calculations for FANUC robots and cobots using the UnderAutomation Fanuc SDK. Calculate end-effector positions from joint angles and vice versa from DH parameters.
Inverse kinematics (IK) and forward kinematics (FK) let you move between joint space and Cartesian space. FK computes the tool p ose from known joint angles, while IK finds joint angles for a desired pose. The kinematics utilities in the Fanuc SDK are off line helpers: you can evaluate poses and joint solutions without connecting to a controller, making them perfect for simulatio n, path validation, and pre-deployment checks.
Why this matters for both industrial arms and cobots
The SDK ships with two analytical solvers and automatically chooses the right one for you:
- OPW industrial arms: Classical 6-axis Fanuc robots with an ortho-parallel base and spherical wrist, based on the paper
An Analytical Solution of the Inverse Kinematics Problem of Industrial Serial Manipulators with an Ortho-parallel Basis and a Spherical Wristby Mathias Brandstötter, Arthur Angerer, and Michael Hofbaur. - CRX collaborative arms: Fanuc CRX cobots that have their own closed-form solver and optional dual solutions, based on paper
Geometric Approach for Inverse Kinematics of the FANUC CRX Collaborative Robotby Manel Abbes and Gérard Poisson.
When you call KinematicsUtils.InverseKinematics(), it inspects DhParameters.KinematicsCategory:
KinematicsCategory.Opw👉 dispatches toOpw.OpwKinematicsUtils.InverseKinematics(industrial robots).KinematicsCategory.Crx👉 dispatches toCrx.CrxKinematicsUtils.InverseKinematics(CRX cobots).
That means you can rely on a single entry point and let the SDK route the request appropriately. 🚦
Typical workflows
Run forward kinematics (FK)
using Common;using Kinematics;// Load robot geometry (pick from the ArmKinematicModels enum or from a .def file)var dh = DhParameters.FromArmKinematicModel(ArmKinematicModels.CRX10iA);// Joint angles in degrees (Fanuc convention)var jointsDeg = new JointsPosition { J1 = 0, J2 = -30, J3 = 45, J4 = 0, J5 = 60, J6 = 90 };// Compute pose: returns XYZ + WPR in controller-friendly formatCartesianPosition pose = KinematicsUtils.ForwardKinematics(jointsDeg, dh);
Solve inverse kinematics (IK) for an OPW robot
using Common;using Kinematics;var dh = DhParameters.FromArmKinematicModel(ArmKinematicModels.ARCMate120iD);// Desired pose in millimeters + WPR degreesvar target = new CartesianPosition { X = 800, Y = 0, Z = 450, W = 180, P = 0, R = 90 };// Automatically routed to Opw.OpwKinematicsUtils.InverseKinematicsJointsPosition[] solutions = KinematicsUtils.InverseKinematics(target, dh);
Solve inverse kinematics (IK) for a CRX cobot with dual solutions
using Common;using Kinematics;var dh = DhParameters.FromArmKinematicModel(ArmKinematicModels.CRX10iAL);var target = new CartesianPosition { X = 400, Y = 250, Z = 650, W = 0, P = 90, R = 0 };// includeDuals=true surfaces the mirrored wrist/elbow posesJointsPosition[] crxSolutions = Crx.CrxKinematicsUtils.InverseKinematics(target,dh,includeDuals: true,seedJoints: new double[] { 0, -20, 40, 0, 60, 0 });
Build DH parameters from multiple sources
- Built-in catalog:
DhParameters.FromArmKinematicModel(ArmKinematicModels model)gives you ready-to-use geometry for many Fanuc arms and cobots. - ROBOGUIDE library:
DhParameters.FromDefFile(path)parses robot definitions inProgramData/FANUC/ROBOGUIDE/Robot Library. - Controller variables:
DhParameters.FromSymotnFileandDhParameters.FromMrrGrpconvert live$MRR_GRPorsymotn.vad ata to reusable DH structures. - OPW data:
DhParameters.FromOpwParametersmaps OPW parameters (meters) to Fanuc-style DH while keeping the kinematics cat egory consistent.
Practical tips ✨
- Offline safety: Because all solvers are offline, you can iterate quickly without touching a robot controller.
- Pose normalization:
OpwKinematicsUtils.InverseKinematicsnormalizes angles to(-180, 180]to match Fanuc expectations. - Seeding CRX searches: Pass
seedJointstoCrxKinematicsUtils.InverseKinematicsto bias solutions near a known posture. - Matrix helpers:
KinematicsUtils.Mulmultiplies 2D matrices if you need to compose transforms manually.
Happy path-planning! 🛠️
Demonstration
You can take a look at the Winforms Desktop project source which implements all these features. I can be downloaded here.

Core types at a glance
Members of Kinematics.KinematicsUtils :public static class KinematicsUtils {// Compute FK for given joint angles (rad) and DH parameterspublic static CartesianPosition ForwardKinematics(double[] jointAnglesRad, DhParameters dhParameters)// Compute FK for given joint angles (deg) and DH parameterspublic static CartesianPosition ForwardKinematics(JointsPosition jointAnglesDeg, DhParameters parameters)public static JointsPosition[] InverseKinematics(CartesianPosition position, DhParameters parameters)public static double[,] Mul(double[,] A, double[,] B)}
public class DhParameters : IDhParameters {public DhParameters()public DhParameters(double d4, double d5, double d6, double a1, double a2, double a3)public DhParameters(IDhParameters parameters)public double A1 { get; set; }public double A2 { get; set; }public double A3 { get; set; }public double D4 { get; set; }public double D5 { get; set; }public double D6 { get; set; }// Returns DH parameters from a known Arm Kinematic Model name. Returns null if not found in enum ArmKinematicModels.public static DhParameters FromArmKinematicModel(string modelName)// Returns DH parameters from a known Arm Kinematic Model.public static DhParameters FromArmKinematicModel(ArmKinematicModels model)// Loads DH parameters of each robots described in a ROBOGUIDE definition file (*.def). By default, this file is located in "C:\ProgramData\FANUC\ROBOGUIDE\Robot Library".public static DhParameters[] FromDefFile(string path)// Loads DH parameters of each robots described in a ROBOGUIDE definition file (*.def). By default, this file is located in "C:\ProgramData\FANUC\ROBOGUIDE\Robot Library".public static DhParameters[] FromDefFile(XDocument doc)// Loads DH parameters from parsed variable $MRR_GRP located in symotn.va.public static DhParameters FromMrrGrp(MrrGrpVariableType mrrGrp)// Creates DH parameters from OPW parameters (in meters)// C1 and B are ignored because B is always 0 and C1 is not used in the DH representation.public static DhParameters FromOpwParameters(double a1, double a2, double c2, double c3, double c4)// Loads DH parameters of each group from a parsed symotn.va file.public static DhParameters[] FromSymotnFile(SymotnFile file)public KinematicsCategory KinematicsCategory { get; }public object Tag}
public enum KinematicsCategory {Crx = 1Invalid = 0Opw = 2}
public interface IDhParameters {double A1 { get; }double A2 { get; }double A3 { get; }double D4 { get; }double D5 { get; }double D6 { get; }}
public class JointsPosition {public JointsPosition()public JointsPosition(double j1Deg, double j2Deg, double j3Deg, double j4Deg, double j5Deg, double j6Deg)public JointsPosition(double j1Deg, double j2Deg, double j3Deg, double j4Deg, double j5Deg, double j6Deg, double j7Deg, double j8Deg, double j9Deg)public JointsPosition(double[] values)// Check if joints position is near to expected joints position with a tolerance valuepublic static bool IsNear(JointsPosition j1, JointsPosition j2, double degreesTolerance)public double this[int i] { get; set; }// Joint 1 in degreespublic double J1 { get; set; }// Joint 2 in degreespublic double J2 { get; set; }// Joint 3 in degreespublic double J3 { get; set; }// Joint 4 in degreespublic double J4 { get; set; }// Joint 5 in degreespublic double J5 { get; set; }// Joint 6 in degreespublic double J6 { get; set; }// Joint 7 in degreespublic double J7 { get; set; }// Joint 8 in degreespublic double J8 { get; set; }// Joint 9 in degreespublic double J9 { get; set; }public override string ToString()// Numeric values for each jointspublic double[] Values { get; }}
public class CartesianPosition : XYZPosition {// Default constructorpublic CartesianPosition()// Constructor with position and rotationspublic CartesianPosition(double x, double y, double z, double w, double p, double r)public CartesianPosition(double x, double y, double z, double w, double p, double r, Configuration configuration)public CartesianPosition(CartesianPosition position)public CartesianPosition(XYZPosition position, double w, double p, double r)// Position configurationpublic Configuration Configuration { get; }// Create a CartesianPosition with unknow configuration from a homogeneous rotation and translation 4x4 matrixpublic static CartesianPosition FromHomogeneousMatrix(double[,] R)// Check if two Cartesian positions are near each other within specified tolerancespublic static bool IsNear(CartesianPosition a, CartesianPosition b, double mmTolerance, double degreesTolerance)// Normalize an angle to the range ]-180, 180]public static double NormalizeAngle(double angle)// Normalize the W, P, R angles to the range ]-180, 180]public static void NormalizeAngles(CartesianPosition pose)// P rotation in degrees (Ry)public double P { get; set; }// R rotation in degrees (Rz)public double R { get; set; }// Convert position to a homogeneous rotation and translation 4x4 matrixpublic double[,] ToHomogeneousMatrix()public override string ToString()// W rotation in degrees (Rx)public double W { get; set; }}