Class Mechanism2d

java.lang.Object
edu.wpi.first.wpilibj.smartdashboard.Mechanism2d
All Implemented Interfaces:
NTSendable, Sendable

public final class Mechanism2d
extends Object
implements NTSendable
Visual 2D representation of arms, elevators, and general mechanisms through a node-based API.

A Mechanism2d object is published and contains at least one root node. A root is the anchor point of other nodes (such as ligaments). Other nodes are recursively appended based on other nodes.

See Also:
MechanismObject2d, MechanismLigament2d, MechanismRoot2d
  • Constructor Details

    • Mechanism2d

      public Mechanism2d​(double width, double height)
      Create a new Mechanism2d with the given dimensions and default color (dark blue).

      The dimensions represent the canvas that all the nodes are drawn on.

      Parameters:
      width - the width
      height - the height
    • Mechanism2d

      public Mechanism2d​(double width, double height, Color8Bit backgroundColor)
      Create a new Mechanism2d with the given dimensions.

      The dimensions represent the canvas that all the nodes are drawn on.

      Parameters:
      width - the width
      height - the height
      backgroundColor - the background color. Defaults to dark blue.
  • Method Details