Class MechanismObject2d
java.lang.Object
org.wpilib.smartdashboard.MechanismObject2d
- All Implemented Interfaces:
TelemetryLoggable
- Direct Known Subclasses:
MechanismLigament2d, MechanismRoot2d
Common base class for all Mechanism2d node types.
To append another node, call append(MechanismObject2d). Objects that aren't appended
to a published Mechanism2d container are nonfunctional.
- See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedMechanismObject2d(String name) Create a new Mechanism node object. -
Method Summary
Modifier and TypeMethodDescriptionfinal <T extends MechanismObject2d>
Tappend(T object) Append a Mechanism object that is based on this one.final StringgetName()Retrieve the object's name.voidlogTo(TelemetryTable table) Logs the object to aTelemetryTable.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface TelemetryLoggable
getTelemetryType
-
Constructor Details
-
MechanismObject2d
Create a new Mechanism node object.- Parameters:
name- the node's name, must be unique.
-
-
Method Details
-
append
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.
-
getName
Retrieve the object's name.- Returns:
- the object's name relative to its parent.
-
logTo
Description copied from interface:TelemetryLoggableLogs the object to aTelemetryTable.- Specified by:
logToin interfaceTelemetryLoggable- Parameters:
table- telemetry table
-