Class MarlinRobotArm
java.lang.Object
com.marginallyclever.ro3.node.Node
com.marginallyclever.ro3.node.nodes.marlinrobotarm.MarlinRobotArm
MarlinRobotArm
converts the state of a robot arm into GCode and back.
In order to work it requires references to:
- a
Limb
of no more than sixMotor
s, whose names match those in Marlin; - a
LimbSolver
to calculate the inverse kinematics; - an optional
Motor
for the tool on arm.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addMarlinListener
(MarlinListener editorPanel) void
fromJSON
(org.json.JSONObject from) Deserialize this node and its children from a JSON object and its children.void
getComponents
(List<JPanel> list) Build a Swing Component that represents this Node.getLimb()
double
void
removeMarlinListener
(MarlinListener editorPanel) void
Send a single gcode command to the robot arm.void
Set the limb to be controlled by this instance.void
setReportInterval
(double seconds) void
setSolver
(LimbSolver solver) Set the solver to be used by this instance.org.json.JSONObject
toJSON()
Serialize this node and its children to a JSON object and its children.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
-
Field Details
-
limb
-
solver
-
-
Constructor Details
-
MarlinRobotArm
public MarlinRobotArm() -
MarlinRobotArm
-
-
Method Details
-
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. -
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.
-
getLimb
-
getSolver
-
sendGCode
Send a single gcode command to the robot arm. It will reply by firing a
MarlinListener.messageFromMarlin(java.lang.String)
event with the String response.- Parameters:
gcode
- GCode command
-
getTarget
- Returns:
- the target pose or null if not set.
-
addMarlinListener
-
removeMarlinListener
-
setLimb
Set the limb to be controlled by this instance. limb must be in the same node tree as this instance.- Parameters:
limb
- the limb to control
-
setSolver
Set the solver to be used by this instance. solver must be in the same node tree as this instance.- Parameters:
solver
- the solver to use
-
getReportInterval
public double getReportInterval()- Returns:
- the time between reports in seconds
-
setReportInterval
public void setReportInterval(double seconds) - Parameters:
seconds
- the time between reports in seconds. Must be >= 0.
-
getGripperMotor
-