java.lang.Object
com.marginallyclever.ro3.node.Node
com.marginallyclever.ro3.node.nodes.DHParameter

public class DHParameter extends Node

DHParameter is a node that translates a sibling Pose to and from Denavit-Hartenberg parameters for a joint. It describes the relative pose of the next joint.

The DH parameters can be derived by finding the common normals between two consecutive Z axes. The new X axis points along the common normal. The intersection point of the two normals may be outside the physical structure being described.

This class provides several functionalities:

  • It can convert a Pose to Denavit-Hartenberg parameters.
  • It can convert Denavit-Hartenberg parameters to a Pose.
  • It can adjust the local transformations of all MeshInstance siblings.
  • It can serialize and deserialize itself to and from JSON format.
This class also provides several properties:
  • d: the distance along the previous z to the common normal.
  • r: the length of the common normal. Assuming a revolute joint, this is the radius about the previous z.
  • alpha: the angle about the common normal to align the previous z to the new z.
  • theta: the angle about the previous z for the common normal.
  • Constructor Details

    • DHParameter

      public DHParameter()
  • Method Details

    • fromPose

      public void fromPose()
    • toPoseAndAdjustMeshes

      public void toPoseAndAdjustMeshes()
      Adjust the local transformations of all MeshInstance siblings.
    • getComponents

      public void getComponents(List<JPanel> list)
      Description copied from class: Node
      Build a Swing Component that represents this Node.
      Overrides:
      getComponents in class Node
      Parameters:
      list - the list to add components to.
    • toJSON

      public org.json.JSONObject toJSON()
      Description copied from class: Node
      Serialize this node and its children to a JSON object and its children. Classes that override this method should call super.toJSON() first, then add to the object returned.
      Overrides:
      toJSON in class Node
      Returns:
      the JSON object.
    • fromJSON

      public void fromJSON(org.json.JSONObject from)
      Description copied from class: Node
      Deserialize this node and its children from a JSON object and its children. Classes that override this method should call super.fromJSON(). When they do it will trigger the creation of child nodes. The child nodes will then call their own fromJSON() methods.
      Overrides:
      fromJSON in class Node
      Parameters:
      from - the JSON object to read from.
    • setD

      public void setD(double d)
    • getD

      public double getD()
    • setR

      public void setR(double r)
    • getR

      public double getR()
    • setAlpha

      public void setAlpha(double alpha)
    • getAlpha

      public double getAlpha()
    • setTheta

      public void setTheta(double theta)
    • getTheta

      public double getTheta()