java.lang.Object
com.marginallyclever.ro3.node.Node
com.marginallyclever.ro3.node.nodes.limbplanner.LimbPlanner
All Implemented Interfaces:
ActionListener, EventListener

public class LimbPlanner extends Node implements ActionListener
LimbPlanner knows about a LimbSolver. It moves the LimbSolver.setTarget(Pose) to a destination. It then waits for the ActionEvent "arrivedAtGoal" before moving on to the next destination.
  • Constructor Details

    • LimbPlanner

      public LimbPlanner()
    • LimbPlanner

      public LimbPlanner(String name)
  • Method Details

    • 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.
    • startRun

      public void startRun()
    • stopRun

      public void stopRun()
    • 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.
    • addActionListener

      public void addActionListener(ActionListener l)
    • removeActionListener

      public void removeActionListener(ActionListener l)
    • actionPerformed

      public void actionPerformed(ActionEvent e)
      Specified by:
      actionPerformed in interface ActionListener
    • isRunning

      public boolean isRunning()
    • getExecutionTime

      public double getExecutionTime()
    • getPreviousExecutionTime

      public double getPreviousExecutionTime()
    • update

      public void update(double dt)
      Description copied from class: Node
      Called every frame.
      Overrides:
      update in class Node
      Parameters:
      dt - the time since the last frame.
    • getPathStart

      public NodePath<Pose> getPathStart()
    • getSolver

      public NodePath<LimbSolver> getSolver()
    • getNextGoal

      public NodePath<Pose> getNextGoal()
    • setSolver

      public void setSolver(LimbSolver limbSolver)
      Set the solver to use. solver must be in the same node tree as this instance.
      Parameters:
      limbSolver - the solver to use.
    • setPathStart

      public void setPathStart(Pose pose)
      Set the start of the path. pose must be in the same node tree as this instance.
      Parameters:
      pose - the pose to use.
    • setLinearVelocity

      public void setLinearVelocity(double v)