public final class MecanumDriveData extends edu.wpi.first.shuffleboard.api.data.ComplexData<MecanumDriveData>
Constructor and Description |
---|
MecanumDriveData(double frontLeftSpeed,
double frontRightSpeed,
double rearLeftSpeed,
double rearRightSpeed)
Creates a new mecanum drive data object.
|
Modifier and Type | Method and Description |
---|---|
java.util.Map<java.lang.String,java.lang.Object> |
asMap() |
boolean |
equals(java.lang.Object o) |
static MecanumDriveData |
fromMap(java.util.Map<java.lang.String,?> map)
Creates a new mecanum drive data object from a map.
|
edu.wpi.first.shuffleboard.api.util.Vector2D |
getDirection()
Gets a vector describing the direction of movement of the drive base.
|
double |
getFrontLeftSpeed() |
double |
getFrontRightSpeed() |
double |
getMoment()
Gets the moment about the drive base's center of rotation.
|
double |
getRearLeftSpeed() |
double |
getRearRightSpeed() |
double |
getTurn()
Gets a value describing how the drive base is turning in a differential-drive style.
|
int |
hashCode() |
java.lang.String |
toString() |
MecanumDriveData |
withFrontLeftSpeed(double frontLeftSpeed) |
MecanumDriveData |
withFrontRightSpeed(double frontRightSpeed) |
MecanumDriveData |
withRearLeftSpeed(double rearLeftSpeed) |
MecanumDriveData |
withRearRightSpeed(double rearRightSpeed) |
public MecanumDriveData(double frontLeftSpeed, double frontRightSpeed, double rearLeftSpeed, double rearRightSpeed)
frontLeftSpeed
- the speed of the front-left motorfrontRightSpeed
- the speed of the front-right motorrearLeftSpeed
- the speed of the rear-left motorrearRightSpeed
- the speed of the rear-right motorpublic static MecanumDriveData fromMap(java.util.Map<java.lang.String,?> map)
map
- the map to create a data object fromjava.util.NoSuchElementException
- if the map is missing any entry for any motor speed valuepublic java.util.Map<java.lang.String,java.lang.Object> asMap()
asMap
in class edu.wpi.first.shuffleboard.api.data.ComplexData<MecanumDriveData>
public double getFrontLeftSpeed()
public double getFrontRightSpeed()
public double getRearLeftSpeed()
public double getRearRightSpeed()
public double getMoment()
public edu.wpi.first.shuffleboard.api.util.Vector2D getDirection()
public double getTurn()
public MecanumDriveData withFrontLeftSpeed(double frontLeftSpeed)
public MecanumDriveData withFrontRightSpeed(double frontRightSpeed)
public MecanumDriveData withRearLeftSpeed(double rearLeftSpeed)
public MecanumDriveData withRearRightSpeed(double rearRightSpeed)
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object