Class TankDriveData
- java.lang.Object
-
- org.team1540.rooster.drive.pipeline.TankDriveData
-
public class TankDriveData extends Object
Encapsulates drive commands for a tank drive.TankDriveDatainstances are usually passed around in drive pipelines. EachTankDriveDatainstance containsDriveDatainstances for the left and right side, as well as commands for heading and turning rate.- See Also:
DriveData
-
-
Field Summary
Fields Modifier and Type Field Description @NotNull OptionalDoubleheadingThe desired heading in radians from 0 (straight forward) to 2π, increasing clockwise, or an empty optional if heading should not be controlled.@NotNull DriveDataleftThe drive data for the left side.@NotNull DriveDatarightThe drive data for the right side.@NotNull OptionalDoubleturningRateThe desired turning rate in radians/sec, or an empty optional if turning rate should not be controlled.
-
Constructor Summary
Constructors Constructor Description TankDriveData()Creates a newTankDriveDatawith all fields empty.TankDriveData(@NotNull DriveData left, @NotNull DriveData right, @NotNull OptionalDouble heading, @NotNull OptionalDouble turningRate)Creates a newTankDriveDatawith the supplied values.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)inthashCode()@NotNull TankDriveDatamodifyAcceleration(@NotNull Function<OptionalDouble,OptionalDouble> lfunc, @NotNull Function<OptionalDouble,OptionalDouble> rfunc)Creates a copy of thisTankDriveDatawith modified left and right accelerations.@NotNull TankDriveDatamodifyAdditionalFeedForward(@NotNull Function<OptionalDouble,OptionalDouble> lfunc, @NotNull Function<OptionalDouble,OptionalDouble> rfunc)Creates a copy of thisTankDriveDatawith modified left and right feed-forwards.@NotNull TankDriveDatamodifyHeading(@NotNull Function<OptionalDouble,OptionalDouble> function)Creates a copy of thisTankDriveDatawith a modifiedheading.@NotNull TankDriveDatamodifyLeftAcceleration(@NotNull Function<OptionalDouble,OptionalDouble> function)Creates a copy of thisTankDriveDatawith a modified leftacceleration.@NotNull TankDriveDatamodifyLeftAdditionalFeedForward(@NotNull Function<OptionalDouble,OptionalDouble> function)Creates a copy of thisTankDriveDatawith a modified leftadditionalFeedForward.@NotNull TankDriveDatamodifyLeftPosition(@NotNull Function<OptionalDouble,OptionalDouble> function)Creates a copy of thisTankDriveDatawith a modified leftposition.@NotNull TankDriveDatamodifyLeftVelocity(@NotNull Function<OptionalDouble,OptionalDouble> function)Creates a copy of thisTankDriveDatawith a modified leftvelocity.@NotNull TankDriveDatamodifyPosition(@NotNull Function<OptionalDouble,OptionalDouble> lfunc, @NotNull Function<OptionalDouble,OptionalDouble> rfunc)Creates a copy of thisTankDriveDatawith modified left and right positions.@NotNull TankDriveDatamodifyRightAcceleration(@NotNull Function<OptionalDouble,OptionalDouble> function)Creates a copy of thisTankDriveDatawith a modified rightacceleration.@NotNull TankDriveDatamodifyRightAdditionalFeedForward(@NotNull Function<OptionalDouble,OptionalDouble> function)Creates a copy of thisTankDriveDatawith a modified rightadditionalFeedForward.@NotNull TankDriveDatamodifyRightPosition(@NotNull Function<OptionalDouble,OptionalDouble> function)Creates a copy of thisTankDriveDatawith a modified rightposition.@NotNull TankDriveDatamodifyRightVelocity(@NotNull Function<OptionalDouble,OptionalDouble> function)Creates a copy of thisTankDriveDatawith a modified rightvelocity.@NotNull TankDriveDatamodifyTurningRate(@NotNull Function<OptionalDouble,OptionalDouble> function)Creates a copy of thisTankDriveDatawith a modifiedturningRate.@NotNull TankDriveDatamodifyVelocity(@NotNull Function<OptionalDouble,OptionalDouble> lfunc, @NotNull Function<OptionalDouble,OptionalDouble> rfunc)Creates a copy of thisTankDriveDatawith modified left and right velocitys.@NotNull TankDriveDataplusAccelerations(double leftAcceleration, double rightAcceleration)Adds the provided values to thisTankDriveData's left and rightacceleration.@NotNull TankDriveDataplusAdditionalFeedForwards(double leftAdditionalFeedForward, double rightAdditionalFeedForward)Adds the provided values to thisTankDriveData's left and rightadditionalFeedForward.@NotNull TankDriveDataplusHeading(double heading)Adds the provided value to thisTankDriveData'sheading.@NotNull TankDriveDataplusLeftAcceleration(double acceleration)Adds the provided value to thisTankDriveData's leftacceleration.@NotNull TankDriveDataplusLeftAdditionalFeedForward(double additionalFeedForward)Adds the provided value to thisTankDriveData's leftadditionalFeedForward.@NotNull TankDriveDataplusLeftPosition(double position)Adds the provided value to thisTankDriveData's leftposition.@NotNull TankDriveDataplusLeftVelocity(double velocity)Adds the provided value to thisTankDriveData's leftvelocity.@NotNull TankDriveDataplusPositions(double leftPosition, double rightPosition)Adds the provided values to thisTankDriveData's left and rightposition.@NotNull TankDriveDataplusRightAcceleration(double acceleration)Adds the provided value to thisTankDriveData's rightacceleration.@NotNull TankDriveDataplusRightAdditionalFeedForward(double additionalFeedForward)Adds the provided value to thisTankDriveData's rightadditionalFeedForward.@NotNull TankDriveDataplusRightPosition(double position)Adds the provided value to thisTankDriveData's rightposition.@NotNull TankDriveDataplusRightVelocity(double velocity)Adds the provided value to thisTankDriveData's rightvelocity.@NotNull TankDriveDataplusTurningRate(double turningRate)Adds the provided value to thisTankDriveData'sturningRate.@NotNull TankDriveDataplusVelocities(double leftVelocity, double rightVelocity)Adds the provided values to thisTankDriveData's left and rightvelocity.StringtoString()@NotNull TankDriveDatawithAccelerations(double leftAcceleration, double rightAcceleration)Creates a copy of thisTankDriveDataand sets its left and rightaccelerations.@NotNull TankDriveDatawithAdditionalFeedForwards(double leftAdditionalFeedForward, double rightAdditionalFeedForward)Creates a copy of thisTankDriveDataand sets its left and rightadditionalFeedForwards.@NotNull TankDriveDatawithHeading(double heading)Creates a copy of thisTankDriveDataand sets itsheading.@NotNull TankDriveDatawithPositions(double leftPosition, double rightPosition)Creates a copy of thisTankDriveDataand sets its left and rightpositions.@NotNull TankDriveDatawithTurningRate(double turningRate)Creates a copy of thisTankDriveDataand sets itsturningRate.@NotNull TankDriveDatawithVelocities(double leftVelocity, double rightVelocity)Creates a copy of thisTankDriveDataand sets its left and rightvelocities.
-
-
-
Field Detail
-
left
@NotNull public final @NotNull DriveData left
The drive data for the left side.
-
right
@NotNull public final @NotNull DriveData right
The drive data for the right side.
-
heading
@NotNull public final @NotNull OptionalDouble heading
The desired heading in radians from 0 (straight forward) to 2π, increasing clockwise, or an empty optional if heading should not be controlled.
-
turningRate
@NotNull public final @NotNull OptionalDouble turningRate
The desired turning rate in radians/sec, or an empty optional if turning rate should not be controlled.
-
-
Constructor Detail
-
TankDriveData
public TankDriveData()
Creates a newTankDriveDatawith all fields empty.
-
TankDriveData
public TankDriveData(@NotNull @NotNull DriveData left, @NotNull @NotNull DriveData right, @NotNull @NotNull OptionalDouble heading, @NotNull @NotNull OptionalDouble turningRate)Creates a newTankDriveDatawith the supplied values.- Parameters:
left- TheDriveDatafor the left side.right- TheDriveDatafor the right side.heading- The desired heading in radians from 0 (straight forward) to 2π, increasing clockwise, or an empty optional if heading should not be controlled.turningRate- The desired turning rate in radians/sec, or an empty optional if turning rate should not be controlled.
-
-
Method Detail
-
modifyHeading
@NotNull @Contract(value="_ -> new", pure=true) public @NotNull TankDriveData modifyHeading(@NotNull @NotNull Function<OptionalDouble,OptionalDouble> function)Creates a copy of thisTankDriveDatawith a modifiedheading.
-
modifyTurningRate
@NotNull @Contract(value="_ -> new", pure=true) public @NotNull TankDriveData modifyTurningRate(@NotNull @NotNull Function<OptionalDouble,OptionalDouble> function)Creates a copy of thisTankDriveDatawith a modifiedturningRate.- Parameters:
function- AFunctionthat takes thisDriveData's currentturningRateand returns a newturningRate.- Returns:
- A copy of this
TankDriveDatawith all fields identical except for theturningRatefield.
-
modifyLeftPosition
@NotNull @Contract(value="_ -> new", pure=true) public @NotNull TankDriveData modifyLeftPosition(@NotNull @NotNull Function<OptionalDouble,OptionalDouble> function)Creates a copy of thisTankDriveDatawith a modified leftposition.
-
modifyLeftVelocity
@NotNull @Contract(value="_ -> new", pure=true) public @NotNull TankDriveData modifyLeftVelocity(@NotNull @NotNull Function<OptionalDouble,OptionalDouble> function)Creates a copy of thisTankDriveDatawith a modified leftvelocity.
-
modifyLeftAcceleration
@NotNull @Contract(value="_ -> new", pure=true) public @NotNull TankDriveData modifyLeftAcceleration(@NotNull @NotNull Function<OptionalDouble,OptionalDouble> function)Creates a copy of thisTankDriveDatawith a modified leftacceleration.- Parameters:
function- AFunctionthat takes thisDriveData's current leftaccelerationand returns a newacceleration.- Returns:
- A copy of this
TankDriveDatawith all fields identical except for the leftaccelerationfield.
-
modifyLeftAdditionalFeedForward
@NotNull @Contract(value="_ -> new", pure=true) public @NotNull TankDriveData modifyLeftAdditionalFeedForward(@NotNull @NotNull Function<OptionalDouble,OptionalDouble> function)Creates a copy of thisTankDriveDatawith a modified leftadditionalFeedForward.- Parameters:
function- AFunctionthat takes thisDriveData's current leftadditionalFeedForwardand returns a newadditionalFeedForward.- Returns:
- A copy of this
TankDriveDatawith all fields identical except for the leftadditionalFeedForwardfield.
-
modifyRightPosition
@NotNull @Contract(value="_ -> new", pure=true) public @NotNull TankDriveData modifyRightPosition(@NotNull @NotNull Function<OptionalDouble,OptionalDouble> function)Creates a copy of thisTankDriveDatawith a modified rightposition.
-
modifyRightVelocity
@NotNull @Contract(value="_ -> new", pure=true) public @NotNull TankDriveData modifyRightVelocity(@NotNull @NotNull Function<OptionalDouble,OptionalDouble> function)Creates a copy of thisTankDriveDatawith a modified rightvelocity.
-
modifyRightAcceleration
@NotNull @Contract(value="_ -> new", pure=true) public @NotNull TankDriveData modifyRightAcceleration(@NotNull @NotNull Function<OptionalDouble,OptionalDouble> function)Creates a copy of thisTankDriveDatawith a modified rightacceleration.- Parameters:
function- AFunctionthat takes thisDriveData's current rightaccelerationand returns a newacceleration.- Returns:
- A copy of this
TankDriveDatawith all fields identical except for the rightaccelerationfield.
-
modifyRightAdditionalFeedForward
@NotNull @Contract(value="_ -> new", pure=true) public @NotNull TankDriveData modifyRightAdditionalFeedForward(@NotNull @NotNull Function<OptionalDouble,OptionalDouble> function)Creates a copy of thisTankDriveDatawith a modified rightadditionalFeedForward.- Parameters:
function- AFunctionthat takes thisDriveData's current rightadditionalFeedForwardand returns a newadditionalFeedForward.- Returns:
- A copy of this
TankDriveDatawith all fields identical except for the rightadditionalFeedForwardfield.
-
modifyPosition
@NotNull @Contract(value="_, _ -> new", pure=true) public @NotNull TankDriveData modifyPosition(@NotNull @NotNull Function<OptionalDouble,OptionalDouble> lfunc, @NotNull @NotNull Function<OptionalDouble,OptionalDouble> rfunc)Creates a copy of thisTankDriveDatawith modified left and right positions.- Parameters:
lfunc- AFunctionthat takes thisDriveData's current leftpositionand returns a newposition.rfunc- AFunctionthat takes thisDriveData's current rightpositionand returns a newposition.- Returns:
- A copy of this
TankDriveDatawith all fields identical except for the left and rightadditionalFeedForwardfields.
-
modifyVelocity
@NotNull @Contract(value="_, _ -> new", pure=true) public @NotNull TankDriveData modifyVelocity(@NotNull @NotNull Function<OptionalDouble,OptionalDouble> lfunc, @NotNull @NotNull Function<OptionalDouble,OptionalDouble> rfunc)Creates a copy of thisTankDriveDatawith modified left and right velocitys.- Parameters:
lfunc- AFunctionthat takes thisDriveData's current leftvelocityand returns a newvelocity.rfunc- AFunctionthat takes thisDriveData's current rightvelocityand returns a newvelocity.- Returns:
- A copy of this
TankDriveDatawith all fields identical except for the left and rightadditionalFeedForwardfields.
-
modifyAcceleration
@NotNull @Contract(value="_, _ -> new", pure=true) public @NotNull TankDriveData modifyAcceleration(@NotNull @NotNull Function<OptionalDouble,OptionalDouble> lfunc, @NotNull @NotNull Function<OptionalDouble,OptionalDouble> rfunc)Creates a copy of thisTankDriveDatawith modified left and right accelerations.- Parameters:
lfunc- AFunctionthat takes thisDriveData's current leftaccelerationand returns a newacceleration.rfunc- AFunctionthat takes thisDriveData's current rightaccelerationand returns a newacceleration.- Returns:
- A copy of this
TankDriveDatawith all fields identical except for the left and rightadditionalFeedForwardfields.
-
modifyAdditionalFeedForward
@NotNull @Contract(value="_, _ -> new", pure=true) public @NotNull TankDriveData modifyAdditionalFeedForward(@NotNull @NotNull Function<OptionalDouble,OptionalDouble> lfunc, @NotNull @NotNull Function<OptionalDouble,OptionalDouble> rfunc)Creates a copy of thisTankDriveDatawith modified left and right feed-forwards.- Parameters:
lfunc- AFunctionthat takes thisDriveData's current leftadditionalFeedForwardand returns a newadditionalFeedForward.rfunc- AFunctionthat takes thisDriveData's current rightadditionalFeedForwardand returns a newadditionalFeedForward.- Returns:
- A copy of this
TankDriveDatawith all fields identical except for the left and rightadditionalFeedForwardfields.
-
plusHeading
@NotNull @Contract(value="_ -> new", pure=true) public @NotNull TankDriveData plusHeading(double heading)Adds the provided value to thisTankDriveData'sheading. If there is already a value present inheading, the returnedTankDriveData'sheadingwill be equal to the sum of that value plus the parameter; otherwise, the leftheadingwill be equal to the value of the provided heading parameter.- Parameters:
heading- The heading to add.- Returns:
- A new
TankDriveDatawith all fields identical except for the leftheadingfield.
-
plusTurningRate
@NotNull @Contract(value="_ -> new", pure=true) public @NotNull TankDriveData plusTurningRate(double turningRate)Adds the provided value to thisTankDriveData'sturningRate. If there is already a value present inturningRate, the returnedTankDriveData'sturningRatewill be equal to the sum of that value plus the parameter; otherwise, the leftturningRatewill be equal to the value of the provided turningRate parameter.- Parameters:
turningRate- The turningRate to add.- Returns:
- A new
TankDriveDatawith all fields identical except for the leftturningRatefield.
-
plusLeftPosition
@NotNull @Contract(value="_ -> new", pure=true) public @NotNull TankDriveData plusLeftPosition(double position)Adds the provided value to thisTankDriveData's leftposition. If there is already a value present inleft.position, the returnedTankDriveData's leftpositionwill be equal to the sum of that value plus the parameter; otherwise, the leftpositionwill be equal to the value of the provided position parameter.- Parameters:
position- The position to add.- Returns:
- A new
TankDriveDatawith all fields identical except for the leftpositionfield.
-
plusLeftVelocity
@NotNull @Contract(value="_ -> new", pure=true) public @NotNull TankDriveData plusLeftVelocity(double velocity)Adds the provided value to thisTankDriveData's leftvelocity. If there is already a value present inleft.velocity, the returnedTankDriveData's leftvelocitywill be equal to the sum of that value plus the parameter; otherwise, the leftvelocitywill be equal to the value of the provided velocity parameter.- Parameters:
velocity- The velocity to add.- Returns:
- A new
TankDriveDatawith all fields identical except for the leftvelocityfield.
-
plusLeftAcceleration
@NotNull @Contract(value="_ -> new", pure=true) public @NotNull TankDriveData plusLeftAcceleration(double acceleration)Adds the provided value to thisTankDriveData's leftacceleration. If there is already a value present inleft.acceleration, the returnedTankDriveData's leftaccelerationwill be equal to the sum of that value plus the parameter; otherwise, the leftaccelerationwill be equal to the value of the provided acceleration parameter.- Parameters:
acceleration- The acceleration to add.- Returns:
- A new
TankDriveDatawith all fields identical except for the leftaccelerationfield.
-
plusLeftAdditionalFeedForward
@NotNull @Contract(value="_ -> new", pure=true) public @NotNull TankDriveData plusLeftAdditionalFeedForward(double additionalFeedForward)Adds the provided value to thisTankDriveData's leftadditionalFeedForward. If there is already a value present inleft.additionalFeedForward, the returnedTankDriveData's leftadditionalFeedForwardwill be equal to the sum of that value plus the parameter; otherwise, the leftadditionalFeedForwardwill be equal to the value of the provided additionalFeedForward parameter.- Parameters:
additionalFeedForward- The additionalFeedForward to add.- Returns:
- A new
TankDriveDatawith all fields identical except for the leftadditionalFeedForwardfield.
-
plusRightPosition
@NotNull @Contract(value="_ -> new", pure=true) public @NotNull TankDriveData plusRightPosition(double position)Adds the provided value to thisTankDriveData's rightposition. If there is already a value present inright.position, the returnedTankDriveData's rightpositionwill be equal to the sum of that value plus the parameter; otherwise, the rightpositionwill be equal to the value of the provided position parameter.- Parameters:
position- The position to add.- Returns:
- A new
TankDriveDatawith all fields identical except for the rightpositionfield.
-
plusRightVelocity
@NotNull @Contract(value="_ -> new", pure=true) public @NotNull TankDriveData plusRightVelocity(double velocity)Adds the provided value to thisTankDriveData's rightvelocity. If there is already a value present inright.velocity, the returnedTankDriveData's rightvelocitywill be equal to the sum of that value plus the parameter; otherwise, the rightvelocitywill be equal to the value of the provided velocity parameter.- Parameters:
velocity- The velocity to add.- Returns:
- A new
TankDriveDatawith all fields identical except for the rightvelocityfield.
-
plusRightAcceleration
@NotNull @Contract(value="_ -> new", pure=true) public @NotNull TankDriveData plusRightAcceleration(double acceleration)Adds the provided value to thisTankDriveData's rightacceleration. If there is already a value present inright.acceleration, the returnedTankDriveData's rightaccelerationwill be equal to the sum of that value plus the parameter; otherwise, the rightaccelerationwill be equal to the value of the provided acceleration parameter.- Parameters:
acceleration- The acceleration to add.- Returns:
- A new
TankDriveDatawith all fields identical except for the rightaccelerationfield.
-
plusRightAdditionalFeedForward
@NotNull @Contract(value="_ -> new", pure=true) public @NotNull TankDriveData plusRightAdditionalFeedForward(double additionalFeedForward)Adds the provided value to thisTankDriveData's rightadditionalFeedForward. If there is already a value present inright.additionalFeedForward, the returnedTankDriveData's rightadditionalFeedForwardwill be equal to the sum of that value plus the parameter; otherwise, the rightadditionalFeedForwardwill be equal to the value of the provided additionalFeedForward parameter.- Parameters:
additionalFeedForward- The additionalFeedForward to add.- Returns:
- A new
TankDriveDatawith all fields identical except for the rightadditionalFeedForwardfield.
-
plusPositions
@NotNull @Contract(value="_, _ -> new", pure=true) public @NotNull TankDriveData plusPositions(double leftPosition, double rightPosition)Adds the provided values to thisTankDriveData's left and rightposition. If there is already a value present in eitherposition, the returnedTankDriveData'spositionswill be equal to the sum of that value plus the parameter; otherwise, thepositionwill be equal to the value of the provided parameter for each side.- Parameters:
leftPosition- The position to add to the left side.rightPosition- The position to add to the right side.- Returns:
- A new
TankDriveDatawith all fields identical except for the left and rightpositionfields.
-
plusVelocities
@NotNull @Contract(value="_, _ -> new", pure=true) public @NotNull TankDriveData plusVelocities(double leftVelocity, double rightVelocity)Adds the provided values to thisTankDriveData's left and rightvelocity. If there is already a value present in eithervelocity, the returnedTankDriveData'svelocitieswill be equal to the sum of that value plus the parameter; otherwise, thevelocitywill be equal to the value of the provided parameter for each side.- Parameters:
leftVelocity- The velocity to add to the left side.rightVelocity- The velocity to add to the right side.- Returns:
- A new
TankDriveDatawith all fields identical except for the left and rightvelocityfields.
-
plusAccelerations
@NotNull @Contract(value="_, _ -> new", pure=true) public @NotNull TankDriveData plusAccelerations(double leftAcceleration, double rightAcceleration)Adds the provided values to thisTankDriveData's left and rightacceleration. If there is already a value present in eitheracceleration, the returnedTankDriveData'saccelerationswill be equal to the sum of that value plus the parameter; otherwise, theaccelerationwill be equal to the value of the provided parameter for each side.- Parameters:
leftAcceleration- The acceleration to add to the left side.rightAcceleration- The acceleration to add to the right side.- Returns:
- A new
TankDriveDatawith all fields identical except for the left and rightaccelerationfields.
-
plusAdditionalFeedForwards
@NotNull @Contract(value="_, _ -> new", pure=true) public @NotNull TankDriveData plusAdditionalFeedForwards(double leftAdditionalFeedForward, double rightAdditionalFeedForward)Adds the provided values to thisTankDriveData's left and rightadditionalFeedForward. If there is already a value present in eitheradditionalFeedForward, the returnedTankDriveData'sadditionalFeedForwardswill be equal to the sum of that value plus the parameter; otherwise, theadditionalFeedForwardwill be equal to the value of the provided parameter for each side.- Parameters:
leftAdditionalFeedForward- The additionalFeedForward to add to the left side.rightAdditionalFeedForward- The additionalFeedForward to add to the right side.- Returns:
- A new
TankDriveDatawith all fields identical except for the left and rightadditionalFeedForwardfields.
-
withHeading
@NotNull @Contract(value="_ -> new", pure=true) public @NotNull TankDriveData withHeading(double heading)Creates a copy of thisTankDriveDataand sets itsheading. If there is already a value present inheading, it will be overwritten.- Parameters:
heading- The new heading.- Returns:
- A
TankDriveDatawith all fields identical except forheading.
-
withTurningRate
@NotNull @Contract(value="_ -> new", pure=true) public @NotNull TankDriveData withTurningRate(double turningRate)Creates a copy of thisTankDriveDataand sets itsturningRate. If there is already a value present inturningRate, it will be overwritten.- Parameters:
turningRate- The new turningRate.- Returns:
- A
TankDriveDatawith all fields identical except forturningRate.
-
withPositions
@NotNull @Contract(value="_, _ -> new", pure=true) public @NotNull TankDriveData withPositions(double leftPosition, double rightPosition)Creates a copy of thisTankDriveDataand sets its left and rightpositions. If there is already a value present in eitherposition, it will be overwritten during copying.- Parameters:
leftPosition- The position to set on the left side.rightPosition- The position to set on the right side.- Returns:
- A new
TankDriveDatawith all fields identical except for the left and rightpositionfields.
-
withVelocities
@NotNull @Contract(value="_, _ -> new", pure=true) public @NotNull TankDriveData withVelocities(double leftVelocity, double rightVelocity)Creates a copy of thisTankDriveDataand sets its left and rightvelocities. If there is already a value present in eithervelocity, it will be overwritten during copying.- Parameters:
leftVelocity- The velocity to set on the left side.rightVelocity- The velocity to set on the right side.- Returns:
- A new
TankDriveDatawith all fields identical except for the left and rightvelocityfields.
-
withAccelerations
@NotNull @Contract(value="_, _ -> new", pure=true) public @NotNull TankDriveData withAccelerations(double leftAcceleration, double rightAcceleration)Creates a copy of thisTankDriveDataand sets its left and rightaccelerations. If there is already a value present in eitheracceleration, it will be overwritten during copying.- Parameters:
leftAcceleration- The acceleration to set on the left side.rightAcceleration- The acceleration to set on the right side.- Returns:
- A new
TankDriveDatawith all fields identical except for the left and rightaccelerationfields.
-
withAdditionalFeedForwards
@NotNull @Contract(value="_, _ -> new", pure=true) public @NotNull TankDriveData withAdditionalFeedForwards(double leftAdditionalFeedForward, double rightAdditionalFeedForward)Creates a copy of thisTankDriveDataand sets its left and rightadditionalFeedForwards. If there is already a value present in eitheradditionalFeedForward, it will be overwritten during copying.- Parameters:
leftAdditionalFeedForward- The additionalFeedForward to set on the left side.rightAdditionalFeedForward- The additionalFeedForward to set on the right side.- Returns:
- A new
TankDriveDatawith all fields identical except for the left and rightadditionalFeedForwardfields.
-
equals
@Contract(value="null -> false", pure=true) public boolean equals(Object o)
-
-