Class MarlinRobotArm
java.lang.Object
com.marginallyclever.ro3.node.Node
com.marginallyclever.ro3.node.nodes.marlinrobot.MarlinRobot
com.marginallyclever.ro3.node.nodes.marlinrobot.marlinrobotarm.MarlinRobotArm
- All Implemented Interfaces:
SessionLayerListener
MarlinRobotArm converts the state of a robot arm into GCode and back.
In order to work it requires references to:
- a
Limbof no more than sixMotors, whose names match those in Marlin; - a
LimbSolverto calculate the inverse kinematics; - an optional
Motorfor the tool on arm.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidfromJSON(org.json.JSONObject from) Deserialize this node and its children from a JSON object and its children.voidgetComponents(List<JPanel> list) Build a Swing Component that represents this Node.voidreset()Equivalent to rebooting a Marlin controller.voidSend a single gcode command to the robot.voidSet the limb to be controlled by this instance.voidsetSolver(LimbSolver solver) Set the solver to be used by this instance.org.json.JSONObjecttoJSON()Serialize this node and its children to a JSON object and its children.voidupdate(double dt) Called every frame.Methods inherited from class com.marginallyclever.ro3.node.nodes.marlinrobot.MarlinRobot
addMarlinListener, getIcon, isConnected, networkSessionEvent, removeMarlinListenerMethods 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, witnessProtection
-
Field Details
-
limb
-
solver
-
-
Constructor Details
-
MarlinRobotArm
public MarlinRobotArm() -
MarlinRobotArm
-
-
Method Details
-
toJSON
public org.json.JSONObject toJSON()Description copied from class:NodeSerialize 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:NodeDeserialize 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:NodeBuild a Swing Component that represents this Node.- Overrides:
getComponentsin classMarlinRobot- Parameters:
list- the list to add components to.
-
sendGCode
Send a single gcode command to the robot. It will reply by firing a
MarlinListener.messageFromMarlin(java.lang.String)event with the String response.- Overrides:
sendGCodein classMarlinRobot- Parameters:
gcode- GCode command
-
update
-
getTarget
- Returns:
- the target pose or null if not set.
-
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
-
getGripperMotor
-
reset
public void reset()Equivalent to rebooting a Marlin controller. Should reset the state of the robot and the simulation.
-