Class TankDriveData
- java.lang.Object
-
- org.team1540.rooster.drive.pipeline.TankDriveData
-
public class TankDriveData extends Object
Encapsulates drive commands for a tank drive.TankDriveData
instances are usually passed around in drive pipelines. EachTankDriveData
instance containsDriveData
instances 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 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.@NotNull DriveData
left
The drive data for the left side.@NotNull DriveData
right
The drive data for the right side.@NotNull OptionalDouble
turningRate
The 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 newTankDriveData
with all fields empty.TankDriveData(@NotNull DriveData left, @NotNull DriveData right, @NotNull OptionalDouble heading, @NotNull OptionalDouble turningRate)
Creates a newTankDriveData
with the supplied values.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
int
hashCode()
@NotNull TankDriveData
modifyAcceleration(@NotNull Function<OptionalDouble,OptionalDouble> lfunc, @NotNull Function<OptionalDouble,OptionalDouble> rfunc)
Creates a copy of thisTankDriveData
with modified left and right accelerations.@NotNull TankDriveData
modifyAdditionalFeedForward(@NotNull Function<OptionalDouble,OptionalDouble> lfunc, @NotNull Function<OptionalDouble,OptionalDouble> rfunc)
Creates a copy of thisTankDriveData
with modified left and right feed-forwards.@NotNull TankDriveData
modifyHeading(@NotNull Function<OptionalDouble,OptionalDouble> function)
Creates a copy of thisTankDriveData
with a modifiedheading
.@NotNull TankDriveData
modifyLeftAcceleration(@NotNull Function<OptionalDouble,OptionalDouble> function)
Creates a copy of thisTankDriveData
with a modified leftacceleration
.@NotNull TankDriveData
modifyLeftAdditionalFeedForward(@NotNull Function<OptionalDouble,OptionalDouble> function)
Creates a copy of thisTankDriveData
with a modified leftadditionalFeedForward
.@NotNull TankDriveData
modifyLeftPosition(@NotNull Function<OptionalDouble,OptionalDouble> function)
Creates a copy of thisTankDriveData
with a modified leftposition
.@NotNull TankDriveData
modifyLeftVelocity(@NotNull Function<OptionalDouble,OptionalDouble> function)
Creates a copy of thisTankDriveData
with a modified leftvelocity
.@NotNull TankDriveData
modifyPosition(@NotNull Function<OptionalDouble,OptionalDouble> lfunc, @NotNull Function<OptionalDouble,OptionalDouble> rfunc)
Creates a copy of thisTankDriveData
with modified left and right positions.@NotNull TankDriveData
modifyRightAcceleration(@NotNull Function<OptionalDouble,OptionalDouble> function)
Creates a copy of thisTankDriveData
with a modified rightacceleration
.@NotNull TankDriveData
modifyRightAdditionalFeedForward(@NotNull Function<OptionalDouble,OptionalDouble> function)
Creates a copy of thisTankDriveData
with a modified rightadditionalFeedForward
.@NotNull TankDriveData
modifyRightPosition(@NotNull Function<OptionalDouble,OptionalDouble> function)
Creates a copy of thisTankDriveData
with a modified rightposition
.@NotNull TankDriveData
modifyRightVelocity(@NotNull Function<OptionalDouble,OptionalDouble> function)
Creates a copy of thisTankDriveData
with a modified rightvelocity
.@NotNull TankDriveData
modifyTurningRate(@NotNull Function<OptionalDouble,OptionalDouble> function)
Creates a copy of thisTankDriveData
with a modifiedturningRate
.@NotNull TankDriveData
modifyVelocity(@NotNull Function<OptionalDouble,OptionalDouble> lfunc, @NotNull Function<OptionalDouble,OptionalDouble> rfunc)
Creates a copy of thisTankDriveData
with modified left and right velocitys.@NotNull TankDriveData
plusAccelerations(double leftAcceleration, double rightAcceleration)
Adds the provided values to thisTankDriveData
's left and rightacceleration
.@NotNull TankDriveData
plusAdditionalFeedForwards(double leftAdditionalFeedForward, double rightAdditionalFeedForward)
Adds the provided values to thisTankDriveData
's left and rightadditionalFeedForward
.@NotNull TankDriveData
plusHeading(double heading)
Adds the provided value to thisTankDriveData
'sheading
.@NotNull TankDriveData
plusLeftAcceleration(double acceleration)
Adds the provided value to thisTankDriveData
's leftacceleration
.@NotNull TankDriveData
plusLeftAdditionalFeedForward(double additionalFeedForward)
Adds the provided value to thisTankDriveData
's leftadditionalFeedForward
.@NotNull TankDriveData
plusLeftPosition(double position)
Adds the provided value to thisTankDriveData
's leftposition
.@NotNull TankDriveData
plusLeftVelocity(double velocity)
Adds the provided value to thisTankDriveData
's leftvelocity
.@NotNull TankDriveData
plusPositions(double leftPosition, double rightPosition)
Adds the provided values to thisTankDriveData
's left and rightposition
.@NotNull TankDriveData
plusRightAcceleration(double acceleration)
Adds the provided value to thisTankDriveData
's rightacceleration
.@NotNull TankDriveData
plusRightAdditionalFeedForward(double additionalFeedForward)
Adds the provided value to thisTankDriveData
's rightadditionalFeedForward
.@NotNull TankDriveData
plusRightPosition(double position)
Adds the provided value to thisTankDriveData
's rightposition
.@NotNull TankDriveData
plusRightVelocity(double velocity)
Adds the provided value to thisTankDriveData
's rightvelocity
.@NotNull TankDriveData
plusTurningRate(double turningRate)
Adds the provided value to thisTankDriveData
'sturningRate
.@NotNull TankDriveData
plusVelocities(double leftVelocity, double rightVelocity)
Adds the provided values to thisTankDriveData
's left and rightvelocity
.String
toString()
@NotNull TankDriveData
withAccelerations(double leftAcceleration, double rightAcceleration)
Creates a copy of thisTankDriveData
and sets its left and rightaccelerations
.@NotNull TankDriveData
withAdditionalFeedForwards(double leftAdditionalFeedForward, double rightAdditionalFeedForward)
Creates a copy of thisTankDriveData
and sets its left and rightadditionalFeedForwards
.@NotNull TankDriveData
withHeading(double heading)
Creates a copy of thisTankDriveData
and sets itsheading
.@NotNull TankDriveData
withPositions(double leftPosition, double rightPosition)
Creates a copy of thisTankDriveData
and sets its left and rightpositions
.@NotNull TankDriveData
withTurningRate(double turningRate)
Creates a copy of thisTankDriveData
and sets itsturningRate
.@NotNull TankDriveData
withVelocities(double leftVelocity, double rightVelocity)
Creates a copy of thisTankDriveData
and 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 newTankDriveData
with all fields empty.
-
TankDriveData
public TankDriveData(@NotNull @NotNull DriveData left, @NotNull @NotNull DriveData right, @NotNull @NotNull OptionalDouble heading, @NotNull @NotNull OptionalDouble turningRate)
Creates a newTankDriveData
with the supplied values.- Parameters:
left
- TheDriveData
for the left side.right
- TheDriveData
for 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 thisTankDriveData
with a modifiedheading
.
-
modifyTurningRate
@NotNull @Contract(value="_ -> new", pure=true) public @NotNull TankDriveData modifyTurningRate(@NotNull @NotNull Function<OptionalDouble,OptionalDouble> function)
Creates a copy of thisTankDriveData
with a modifiedturningRate
.- Parameters:
function
- AFunction
that takes thisDriveData
's currentturningRate
and returns a newturningRate
.- Returns:
- A copy of this
TankDriveData
with all fields identical except for theturningRate
field.
-
modifyLeftPosition
@NotNull @Contract(value="_ -> new", pure=true) public @NotNull TankDriveData modifyLeftPosition(@NotNull @NotNull Function<OptionalDouble,OptionalDouble> function)
Creates a copy of thisTankDriveData
with a modified leftposition
.
-
modifyLeftVelocity
@NotNull @Contract(value="_ -> new", pure=true) public @NotNull TankDriveData modifyLeftVelocity(@NotNull @NotNull Function<OptionalDouble,OptionalDouble> function)
Creates a copy of thisTankDriveData
with a modified leftvelocity
.
-
modifyLeftAcceleration
@NotNull @Contract(value="_ -> new", pure=true) public @NotNull TankDriveData modifyLeftAcceleration(@NotNull @NotNull Function<OptionalDouble,OptionalDouble> function)
Creates a copy of thisTankDriveData
with a modified leftacceleration
.- Parameters:
function
- AFunction
that takes thisDriveData
's current leftacceleration
and returns a newacceleration
.- Returns:
- A copy of this
TankDriveData
with all fields identical except for the leftacceleration
field.
-
modifyLeftAdditionalFeedForward
@NotNull @Contract(value="_ -> new", pure=true) public @NotNull TankDriveData modifyLeftAdditionalFeedForward(@NotNull @NotNull Function<OptionalDouble,OptionalDouble> function)
Creates a copy of thisTankDriveData
with a modified leftadditionalFeedForward
.- Parameters:
function
- AFunction
that takes thisDriveData
's current leftadditionalFeedForward
and returns a newadditionalFeedForward
.- Returns:
- A copy of this
TankDriveData
with all fields identical except for the leftadditionalFeedForward
field.
-
modifyRightPosition
@NotNull @Contract(value="_ -> new", pure=true) public @NotNull TankDriveData modifyRightPosition(@NotNull @NotNull Function<OptionalDouble,OptionalDouble> function)
Creates a copy of thisTankDriveData
with a modified rightposition
.
-
modifyRightVelocity
@NotNull @Contract(value="_ -> new", pure=true) public @NotNull TankDriveData modifyRightVelocity(@NotNull @NotNull Function<OptionalDouble,OptionalDouble> function)
Creates a copy of thisTankDriveData
with a modified rightvelocity
.
-
modifyRightAcceleration
@NotNull @Contract(value="_ -> new", pure=true) public @NotNull TankDriveData modifyRightAcceleration(@NotNull @NotNull Function<OptionalDouble,OptionalDouble> function)
Creates a copy of thisTankDriveData
with a modified rightacceleration
.- Parameters:
function
- AFunction
that takes thisDriveData
's current rightacceleration
and returns a newacceleration
.- Returns:
- A copy of this
TankDriveData
with all fields identical except for the rightacceleration
field.
-
modifyRightAdditionalFeedForward
@NotNull @Contract(value="_ -> new", pure=true) public @NotNull TankDriveData modifyRightAdditionalFeedForward(@NotNull @NotNull Function<OptionalDouble,OptionalDouble> function)
Creates a copy of thisTankDriveData
with a modified rightadditionalFeedForward
.- Parameters:
function
- AFunction
that takes thisDriveData
's current rightadditionalFeedForward
and returns a newadditionalFeedForward
.- Returns:
- A copy of this
TankDriveData
with all fields identical except for the rightadditionalFeedForward
field.
-
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 thisTankDriveData
with modified left and right positions.- Parameters:
lfunc
- AFunction
that takes thisDriveData
's current leftposition
and returns a newposition
.rfunc
- AFunction
that takes thisDriveData
's current rightposition
and returns a newposition
.- Returns:
- A copy of this
TankDriveData
with all fields identical except for the left and rightadditionalFeedForward
fields.
-
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 thisTankDriveData
with modified left and right velocitys.- Parameters:
lfunc
- AFunction
that takes thisDriveData
's current leftvelocity
and returns a newvelocity
.rfunc
- AFunction
that takes thisDriveData
's current rightvelocity
and returns a newvelocity
.- Returns:
- A copy of this
TankDriveData
with all fields identical except for the left and rightadditionalFeedForward
fields.
-
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 thisTankDriveData
with modified left and right accelerations.- Parameters:
lfunc
- AFunction
that takes thisDriveData
's current leftacceleration
and returns a newacceleration
.rfunc
- AFunction
that takes thisDriveData
's current rightacceleration
and returns a newacceleration
.- Returns:
- A copy of this
TankDriveData
with all fields identical except for the left and rightadditionalFeedForward
fields.
-
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 thisTankDriveData
with modified left and right feed-forwards.- Parameters:
lfunc
- AFunction
that takes thisDriveData
's current leftadditionalFeedForward
and returns a newadditionalFeedForward
.rfunc
- AFunction
that takes thisDriveData
's current rightadditionalFeedForward
and returns a newadditionalFeedForward
.- Returns:
- A copy of this
TankDriveData
with all fields identical except for the left and rightadditionalFeedForward
fields.
-
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
'sheading
will be equal to the sum of that value plus the parameter; otherwise, the leftheading
will be equal to the value of the provided heading parameter.- Parameters:
heading
- The heading to add.- Returns:
- A new
TankDriveData
with all fields identical except for the leftheading
field.
-
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
'sturningRate
will be equal to the sum of that value plus the parameter; otherwise, the leftturningRate
will be equal to the value of the provided turningRate parameter.- Parameters:
turningRate
- The turningRate to add.- Returns:
- A new
TankDriveData
with all fields identical except for the leftturningRate
field.
-
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 leftposition
will be equal to the sum of that value plus the parameter; otherwise, the leftposition
will be equal to the value of the provided position parameter.- Parameters:
position
- The position to add.- Returns:
- A new
TankDriveData
with all fields identical except for the leftposition
field.
-
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 leftvelocity
will be equal to the sum of that value plus the parameter; otherwise, the leftvelocity
will be equal to the value of the provided velocity parameter.- Parameters:
velocity
- The velocity to add.- Returns:
- A new
TankDriveData
with all fields identical except for the leftvelocity
field.
-
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 leftacceleration
will be equal to the sum of that value plus the parameter; otherwise, the leftacceleration
will be equal to the value of the provided acceleration parameter.- Parameters:
acceleration
- The acceleration to add.- Returns:
- A new
TankDriveData
with all fields identical except for the leftacceleration
field.
-
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 leftadditionalFeedForward
will be equal to the sum of that value plus the parameter; otherwise, the leftadditionalFeedForward
will be equal to the value of the provided additionalFeedForward parameter.- Parameters:
additionalFeedForward
- The additionalFeedForward to add.- Returns:
- A new
TankDriveData
with all fields identical except for the leftadditionalFeedForward
field.
-
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 rightposition
will be equal to the sum of that value plus the parameter; otherwise, the rightposition
will be equal to the value of the provided position parameter.- Parameters:
position
- The position to add.- Returns:
- A new
TankDriveData
with all fields identical except for the rightposition
field.
-
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 rightvelocity
will be equal to the sum of that value plus the parameter; otherwise, the rightvelocity
will be equal to the value of the provided velocity parameter.- Parameters:
velocity
- The velocity to add.- Returns:
- A new
TankDriveData
with all fields identical except for the rightvelocity
field.
-
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 rightacceleration
will be equal to the sum of that value plus the parameter; otherwise, the rightacceleration
will be equal to the value of the provided acceleration parameter.- Parameters:
acceleration
- The acceleration to add.- Returns:
- A new
TankDriveData
with all fields identical except for the rightacceleration
field.
-
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 rightadditionalFeedForward
will be equal to the sum of that value plus the parameter; otherwise, the rightadditionalFeedForward
will be equal to the value of the provided additionalFeedForward parameter.- Parameters:
additionalFeedForward
- The additionalFeedForward to add.- Returns:
- A new
TankDriveData
with all fields identical except for the rightadditionalFeedForward
field.
-
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
'spositions
will be equal to the sum of that value plus the parameter; otherwise, theposition
will 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
TankDriveData
with all fields identical except for the left and rightposition
fields.
-
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
'svelocities
will be equal to the sum of that value plus the parameter; otherwise, thevelocity
will 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
TankDriveData
with all fields identical except for the left and rightvelocity
fields.
-
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
'saccelerations
will be equal to the sum of that value plus the parameter; otherwise, theacceleration
will 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
TankDriveData
with all fields identical except for the left and rightacceleration
fields.
-
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
'sadditionalFeedForwards
will be equal to the sum of that value plus the parameter; otherwise, theadditionalFeedForward
will 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
TankDriveData
with all fields identical except for the left and rightadditionalFeedForward
fields.
-
withHeading
@NotNull @Contract(value="_ -> new", pure=true) public @NotNull TankDriveData withHeading(double heading)
Creates a copy of thisTankDriveData
and sets itsheading
. If there is already a value present inheading
, it will be overwritten.- Parameters:
heading
- The new heading.- Returns:
- A
TankDriveData
with all fields identical except forheading
.
-
withTurningRate
@NotNull @Contract(value="_ -> new", pure=true) public @NotNull TankDriveData withTurningRate(double turningRate)
Creates a copy of thisTankDriveData
and sets itsturningRate
. If there is already a value present inturningRate
, it will be overwritten.- Parameters:
turningRate
- The new turningRate.- Returns:
- A
TankDriveData
with all fields identical except forturningRate
.
-
withPositions
@NotNull @Contract(value="_, _ -> new", pure=true) public @NotNull TankDriveData withPositions(double leftPosition, double rightPosition)
Creates a copy of thisTankDriveData
and 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
TankDriveData
with all fields identical except for the left and rightposition
fields.
-
withVelocities
@NotNull @Contract(value="_, _ -> new", pure=true) public @NotNull TankDriveData withVelocities(double leftVelocity, double rightVelocity)
Creates a copy of thisTankDriveData
and 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
TankDriveData
with all fields identical except for the left and rightvelocity
fields.
-
withAccelerations
@NotNull @Contract(value="_, _ -> new", pure=true) public @NotNull TankDriveData withAccelerations(double leftAcceleration, double rightAcceleration)
Creates a copy of thisTankDriveData
and 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
TankDriveData
with all fields identical except for the left and rightacceleration
fields.
-
withAdditionalFeedForwards
@NotNull @Contract(value="_, _ -> new", pure=true) public @NotNull TankDriveData withAdditionalFeedForwards(double leftAdditionalFeedForward, double rightAdditionalFeedForward)
Creates a copy of thisTankDriveData
and 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
TankDriveData
with all fields identical except for the left and rightadditionalFeedForward
fields.
-
equals
@Contract(value="null -> false", pure=true) public boolean equals(Object o)
-
-