File-By-File
TranslationalTrajectory

TranslationalTrajectory

A Trajectory based on a Translation. This class represents a movement trajectory defined directly by a Translation object, which specifies the desired change in position and orientation. It allows for simple, direct control over robot movement.

Fields

translation

The Translation object that defines the movement for this trajectory. Defaults to Translation.ZERO.

isDone

A boolean flag indicating whether the trajectory is considered complete. Defaults to false.

shouldBeDone

A Supplier<Boolean> that provides an external condition for determining if the trajectory should be considered done. Defaults to a supplier that always returns false.

Methods

TranslationalTrajectory()

Constructs a new TranslationalTrajectory with default values (zero translation, not done).

getTranslation()

Returns the Translation object currently defining this trajectory's movement.

setTranslation(Translation translation)

Sets the Translation object that defines this trajectory's movement. Returns this for method chaining.

setIsDone(boolean isDone)

Manually sets the isDone status of the trajectory. Returns this for method chaining.

setShouldBeDone(Supplier<Boolean> shouldBeDone)

Sets the Supplier<Boolean> that will be used to determine if the trajectory should be considered done. Returns this for method chaining.

nextMarker(PointXYZ current)

Returns a PointXYZ representing the current position after applying this trajectory's translation. This effectively means the robot will continuously attempt to move by the specified translation.

speed(PointXYZ current)

Returns the magnitude of the trajectory's translation, which represents the speed at which the robot should move.

isDone(PointXYZ current)

Checks if the trajectory is complete. It evaluates the shouldBeDone supplier; if it returns true, the internal isDone flag is set to true. The method then returns the value of the internal isDone flag.