Class ModuleState
java.lang.Object
me.wobblyyyy.pathfinder.kinematics.ModuleState
- Direct Known Subclasses:
SwerveState
public class ModuleState
extends java.lang.Object
Represent the state of a single drive motor module. The power values
stored in this module state correspond to 1 being full speed forwards,
negative 1 being full speed backwards, 0 being no speed at all, and
anything in between representing a combination of two of those values.
Please note that these module states ARE NOT adjusted for motors on one side of the robot spinning in the opposite direction as the other side of the robot. You have to handle this manually, preferably through whatever motor implementation you've chosen to make.
- Since:
- 0.3.0
- Author:
- Colin Robertson
-
Field Summary
Fields Modifier and Type Field Description private double
power
-
Constructor Summary
Constructors Constructor Description ModuleState()
ModuleState(double power)
-
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Field Details
-
power
private final double power
-
-
Constructor Details
-
ModuleState
public ModuleState() -
ModuleState
public ModuleState(double power)
-
-
Method Details
-
getPower
public double getPower()Get the module's suggested power.- Returns:
- the motor's power value. This value is within the range of -1 to 1, with -1 being full speed BACKWARDS and +1 being full speed FORWARDS. A power value of 0 represents that the motor shouldn't be spinning at all. These power values are relative to the center of the robot. If every wheel is set to 1.0 power, the robot should move forwards in a straight line.
-
toString
public java.lang.String toString()- Overrides:
toString
in classjava.lang.Object
-