hmi.physics.controller
Class FrictionController

java.lang.Object
  extended by hmi.physics.controller.FrictionController
All Implemented Interfaces:
PhysicalController

public class FrictionController
extends Object
implements PhysicalController

Applies uniform friction on each DoF of a joint, implemented as a damper TODO: test through BML

Author:
welberge

Field Summary
private  float[] dAngle
           
private  String[] desJointIDs
           
private  float friction
           
private  PhysicalJoint joint
           
private  String jointId
           
private  String[] jointIDs
           
private  float[] oldAngle
           
private  PhysicalHumanoid pHuman
           
 
Constructor Summary
FrictionController()
           
FrictionController(PhysicalJoint j, float fric)
          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 setFriction(float f)
           
 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 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

friction

private float friction

joint

private PhysicalJoint joint

oldAngle

private float[] oldAngle

dAngle

private float[] dAngle

jointIDs

private String[] jointIDs

desJointIDs

private String[] desJointIDs

jointId

private String jointId

pHuman

private PhysicalHumanoid pHuman
Constructor Detail

FrictionController

public FrictionController()

FrictionController

public FrictionController(PhysicalJoint j,
                          float fric)
Constructor

Parameters:
j - Joint to apply friction on
fric - amount of friction
Method Detail

setFriction

public void setFriction(float f)

setPhysicalHumanoid

public void setPhysicalHumanoid(PhysicalHumanoid ph)
Description copied from interface: PhysicalController
Links the controller to a new set of physical joints

Specified by:
setPhysicalHumanoid in interface PhysicalController
Parameters:
ph - physical humanoid to link to

reset

public void reset()
Description copied from interface: PhysicalController
Clears out all previous time dependen variables

Specified by:
reset in interface PhysicalController

update

public void update(double timeDiff)
Description copied from interface: PhysicalController
Updates the controller

Specified by:
update in interface PhysicalController
Parameters:
timeDiff - time since last update

getRequiredJointIDs

public String[] getRequiredJointIDs()
Description copied from interface: PhysicalController
Gets the ids of controlled joints

Specified by:
getRequiredJointIDs in interface PhysicalController

copy

public PhysicalController copy(PhysicalHumanoid ph)
Description copied from interface: PhysicalController
Creates a copy of the controller

Specified by:
copy in interface PhysicalController

getParameterValue

public String getParameterValue(String name)
Description copied from interface: PhysicalController
Get the parameter value of parameter name, return null if not found

Specified by:
getParameterValue in interface PhysicalController

setParameterValue

public void setParameterValue(String name,
                              String value)
Specified by:
setParameterValue in interface PhysicalController

setParameterValue

public void setParameterValue(String name,
                              float value)
Specified by:
setParameterValue in interface PhysicalController

getDesiredJointIDs

public String[] getDesiredJointIDs()
Description copied from interface: PhysicalController
Gets the ids of joints the controller would like to steer if available

Specified by:
getDesiredJointIDs in interface PhysicalController