Class MechanismRoot2d

java.lang.Object
edu.wpi.first.wpilibj.smartdashboard.MechanismRoot2d

public final class MechanismRoot2d
extends Object
Root Mechanism2d node.

A root is the anchor point of other nodes (such as ligaments).

Do not create objects of this class directly! Obtain instances from the Mechanism2d.getRoot(String, double, double) factory method.

Append other nodes by using append(MechanismObject2d).

  • Method Details

    • append

      public <T extends MechanismObject2d> T append​(T object)
      Append a Mechanism object that is based on this one.
      Type Parameters:
      T - The object type.
      Parameters:
      object - the object to add.
      Returns:
      the object given as a parameter, useful for variable assignments and call chaining.
      Throws:
      UnsupportedOperationException - if the object's name is already used - object names must be unique.
    • setPosition

      public void setPosition​(double x, double y)
      Set the root's position.
      Parameters:
      x - new x coordinate
      y - new y coordinate
    • getName

      public String getName()