public abstract class BasicMotorBehavior extends MotorBehavior
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
UNNAMED_FILE_TXT
name of a file that was not saved
|
Constructor and Description |
---|
BasicMotorBehavior(BasicMotorBehavior source)
Copy constructor
|
BasicMotorBehavior(java.lang.String name,
IThoughtModel thoughtModel,
java.lang.String filepath,
float slowDown,
float startSlowDown)
Instantiates and initializes a new Balance behavior object
|
Modifier and Type | Method and Description |
---|---|
MotorManager |
addNewMotorManager(java.lang.String jointName,
java.lang.String functionType,
boolean forceAdd)
Adds a new joint to the joints of the selected behavior
|
abstract BasicMotorBehavior |
copy()
Creates a copy of this instance
|
void |
fixCurrentStep(float step,
boolean fix) |
java.lang.String |
getAbsoluteFilepath()
Retrieve the absolute path to the movement data file
|
float |
getCurrentStep() |
java.lang.String |
getFilePath() |
java.util.Set<java.lang.String> |
getMotorManagerNames() |
java.util.Map<java.lang.String,MotorManager> |
getMotorManagers() |
float |
getPeriod() |
float |
getSlowDownFactor() |
float |
getStartSlowDownFactor() |
void |
init()
Reinitializes the Behavior-StateMachine (if present)
|
void |
perform()
Called to perform the behavior
|
void |
reAddMotorManager(MotorManager manager)
Re-Add a motor manager
|
MotorManager |
removeMotorManager(java.lang.String manager)
Remove a motor manager
|
void |
saveToFile()
Save internal movement data to file
|
void |
setFilePath(java.lang.String filePath) |
void |
setSoftLogging(boolean softLogging) |
isFinished, reload, setFinished, stayIn
abort, getConsecutivePerforms, getIntensity, getName, getPerforms, getRootBehavior, getSuccessfulPerforms, getUnsuccessfulPerforms, onLeavingBehavior, setIntensity, setName, switchFrom, toString
public static final java.lang.String UNNAMED_FILE_TXT
public BasicMotorBehavior(java.lang.String name, IThoughtModel thoughtModel, java.lang.String filepath, float slowDown, float startSlowDown)
name
- Behavior namethoughtModel
- Reference to the thought model objectfilepath
- Path to movement data fileslowDown
- Slow down factorstartSlowDown
- Startup slowdown factorpublic BasicMotorBehavior(BasicMotorBehavior source)
source
- Source object to copy frompublic void init()
IBehavior
init
in interface IBehavior
init
in class MotorBehavior
public void perform()
IBehavior
public java.util.Map<java.lang.String,MotorManager> getMotorManagers()
public java.util.Set<java.lang.String> getMotorManagerNames()
public abstract BasicMotorBehavior copy()
public void saveToFile()
public MotorManager addNewMotorManager(java.lang.String jointName, java.lang.String functionType, boolean forceAdd)
jointName
- the name of the jointfunctionType
- the type (spline, sin, linear, ...)forceAdd
- True if the addition process should be forced if the joint
already existspublic void reAddMotorManager(MotorManager manager)
manager
- Reference to motor manager objectpublic MotorManager removeMotorManager(java.lang.String manager)
manager
- Name of the motor manager object to removepublic void setSoftLogging(boolean softLogging)
softLogging
- the softLogging to setpublic float getSlowDownFactor()
public float getCurrentStep()
public float getPeriod()
public float getStartSlowDownFactor()
public void fixCurrentStep(float step, boolean fix)
step
- the current x coordinate of the motor filefix
- true to fix current steppublic java.lang.String getAbsoluteFilepath()
public java.lang.String getFilePath()
public void setFilePath(java.lang.String filePath)
filePath
- the filePath to set