Module com.marginallyclever.ro3
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,PropertyChangeListener,EventListener
MarlinRobotArm converts the state of a robot arm into GCode and back.
To work it requires:
- a
Limbof no more than sixMotors for solving kinematics - an optional
Motorfor the tool on the End Effector.
The gcode generated uses the Motor names. To make it work for your robot make sure
the names match Marlin's expectations.
-
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.voidvoidreset()Equivalent to rebooting a Marlin controller.voidSend a single gcode command to the robot.voidSet the limb to be controlled 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, hasChild, hasParent, isNameUsedBySibling, removeAttachListener, removeChild, removeDetachListener, removeReadyListener, removeRenameListener, setName, witnessProtection
-
Field Details
-
limb
-
-
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.
-
getMotorsAndFeedrateAsString
- Overrides:
getMotorsAndFeedrateAsStringin classMarlinRobot
-
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
-
getGripperMotor
-
reset
public void reset()Equivalent to rebooting a Marlin controller. Should reset the state of the robot and the simulation. -
propertyChange
- Specified by:
propertyChangein interfacePropertyChangeListener
-