Class DHParameter
java.lang.Object
com.marginallyclever.ro3.node.Node
com.marginallyclever.ro3.node.nodes.DHParameter
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.
- 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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
fromJSON
(org.json.JSONObject from) Deserialize this node and its children from a JSON object and its children.void
fromPose()
double
getAlpha()
void
getComponents
(List<JPanel> list) Build a Swing Component that represents this Node.double
getD()
double
getR()
double
getTheta()
void
setAlpha
(double alpha) void
setD
(double d) void
setR
(double r) void
setTheta
(double theta) org.json.JSONObject
toJSON()
Serialize this node and its children to a JSON object and its children.void
Adjust the local transformations of allMeshInstance
siblings.Methods inherited from class com.marginallyclever.ro3.node.Node
addAttachListener, addChild, addChild, addDetachListener, addReadyListener, addRenameListener, findByPath, findChild, findChild, findFirstChild, findFirstSibling, findNodeByID, findParent, findParent, getAbsolutePath, getChildren, getName, getParent, getRootNode, getUniqueID, hasParent, isNameUsedBySibling, removeAttachListener, removeChild, removeDetachListener, removeReadyListener, removeRenameListener, setName, update, witnessProtection
-
Constructor Details
-
DHParameter
public DHParameter()
-
-
Method Details
-
fromPose
public void fromPose() -
toPoseAndAdjustMeshes
public void toPoseAndAdjustMeshes()Adjust the local transformations of allMeshInstance
siblings. -
getComponents
Description copied from class:Node
Build a Swing Component that represents this Node.- Overrides:
getComponents
in classNode
- 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. -
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. -
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()
-