public static class RotationController.PD extends RotationController
RotationController.P,
RotationController.DRotationController.D, RotationController.P, RotationController.PD| Modifier and Type | Field and Description |
|---|---|
private java.lang.Number |
angle
the setpoint
|
private java.lang.Number |
gainD
the gain of the derivative component
|
private java.lang.Number |
gainP
the gain of the proportional component
|
private com.badlogic.gdx.math.Vector2 |
target
the point to rotate towards (may be null)
|
defaultUserDataAccessor| Constructor and Description |
|---|
PD(java.lang.Number gainP,
java.lang.Number gainD,
java.lang.Number angle) |
PD(java.lang.Number gainP,
java.lang.Number gainD,
java.lang.Number angle,
com.badlogic.gdx.math.Vector2 target) |
PD(java.lang.Number gainP,
java.lang.Number gainD,
com.badlogic.gdx.math.Vector2 target) |
| Modifier and Type | Method and Description |
|---|---|
float |
calculateTorque(com.badlogic.gdx.physics.box2d.Body body) |
static float |
calculateTorque(float gainP,
float gainD,
float rotation,
float target,
float vel) |
java.lang.Number |
getAngle() |
java.lang.Number |
getGainD() |
java.lang.Number |
getGainP() |
com.badlogic.gdx.math.Vector2 |
getTarget() |
void |
setAngle(java.lang.Number angle) |
void |
setGainD(java.lang.Number gainD) |
void |
setGainP(java.lang.Number gainP) |
void |
setTarget(com.badlogic.gdx.math.Vector2 target) |
applyTorque, applyTorque, getUserDataAccessor, setUserDataAccessorprivate java.lang.Number gainP
private java.lang.Number gainD
private java.lang.Number angle
private com.badlogic.gdx.math.Vector2 target
public PD(java.lang.Number gainP,
java.lang.Number gainD,
java.lang.Number angle)
public PD(java.lang.Number gainP,
java.lang.Number gainD,
com.badlogic.gdx.math.Vector2 target)
public static float calculateTorque(float gainP,
float gainD,
float rotation,
float target,
float vel)
public float calculateTorque(com.badlogic.gdx.physics.box2d.Body body)
calculateTorque in class RotationControllerpublic java.lang.Number getGainP()
gainPpublic void setGainP(java.lang.Number gainP)
gainP - the gainP to setpublic java.lang.Number getGainD()
gainDpublic void setGainD(java.lang.Number gainD)
gainD - the gainD to setpublic java.lang.Number getAngle()
anglepublic void setAngle(java.lang.Number angle)
angle - the angle to setpublic com.badlogic.gdx.math.Vector2 getTarget()
targetpublic void setTarget(com.badlogic.gdx.math.Vector2 target)
target - the target to set