|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecthmi.physics.controller.HingeJointController
public class HingeJointController
A PD-controller that guides a hinge joint (or one angle of a joint with more DoF) to a certain desired angle and (optionally) desired avelocity torque = ks * (desiredangle-currentangle) + ds * (desiredavelocity - currentavelocity) with ks the spring gain, ds the damper gain
| Field Summary | |
|---|---|
private float |
angle
|
private float |
aprev
|
private float |
avel
|
private int |
axis
|
private String[] |
desJointIDs
|
private float |
ds
|
private static float |
DS_DEFAULT
|
private boolean |
firstRun
|
private PhysicalJoint |
joint
|
private String |
jointId
|
private String[] |
jointIDs
|
private float |
ks
|
private static float |
KS_DEFAULT
|
private PhysicalHumanoid |
pHuman
|
| Constructor Summary | |
|---|---|
HingeJointController()
|
|
HingeJointController(PhysicalJoint j,
float a)
Sets up a PD-controller with 0 velocity and default gain values |
|
HingeJointController(PhysicalJoint j,
float a,
float av,
float k,
float d,
int ax)
Constructor |
|
| Method Summary | |
|---|---|
PhysicalController |
copy(PhysicalHumanoid ph)
Creates a copy of the controller |
String[] |
getDesiredJointIDs()
Gets the ids of joints the controller would like to steer if available |
String |
getParameterValue(String name)
Get the parameter value of parameter name, return null if not found |
String[] |
getRequiredJointIDs()
Gets the ids of controlled joints |
void |
reset()
Clears out all previous time dependen variables |
void |
setDamper(float d)
Sets the damper gain |
void |
setParameterValue(String name,
float value)
|
void |
setParameterValue(String name,
String value)
|
void |
setPhysicalHumanoid(PhysicalHumanoid ph)
Links the controller to a new set of physical joints |
void |
setSpring(float k)
Set the spring gain |
void |
update(double timeDiff)
Updates the controller |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private PhysicalJoint joint
private String jointId
private float angle
private float aprev
private static final float KS_DEFAULT
private static final float DS_DEFAULT
private float ks
private float ds
private float avel
private int axis
private boolean firstRun
private PhysicalHumanoid pHuman
private String[] jointIDs
private String[] desJointIDs
| Constructor Detail |
|---|
public HingeJointController(PhysicalJoint j,
float a,
float av,
float k,
float d,
int ax)
j - controlled jointa - desired joint angleav - desired angular velocityk - spring gaind - damper gainax - joint axis to control (0..2)public HingeJointController()
public HingeJointController(PhysicalJoint j,
float a)
j - controlled jointa - desired joint angle
Default spring and damper gains set up a controller that loosely keeps an elbow hanging down| Method Detail |
|---|
public void setDamper(float d)
d - damper gainpublic void setSpring(float k)
k - spring gainpublic void reset()
PhysicalController
reset in interface PhysicalControllerpublic void update(double timeDiff)
PhysicalController
update in interface PhysicalControllertimeDiff - time since last updatepublic String[] getRequiredJointIDs()
PhysicalController
getRequiredJointIDs in interface PhysicalControllerpublic void setPhysicalHumanoid(PhysicalHumanoid ph)
PhysicalController
setPhysicalHumanoid in interface PhysicalControllerph - physical humanoid to link topublic PhysicalController copy(PhysicalHumanoid ph)
PhysicalController
copy in interface PhysicalControllerpublic String getParameterValue(String name)
PhysicalController
getParameterValue in interface PhysicalController
public void setParameterValue(String name,
String value)
setParameterValue in interface PhysicalController
public void setParameterValue(String name,
float value)
setParameterValue in interface PhysicalControllerpublic String[] getDesiredJointIDs()
PhysicalController
getDesiredJointIDs in interface PhysicalController
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||