AnimatLab  2
Test
MuscleBase.h
Go to the documentation of this file.
1 
7 #pragma once
8 
9 namespace AnimatSim
10 {
11  namespace Environment
12  {
13  namespace Bodies
14  {
15 
24  class ANIMAT_PORT MuscleBase : public LineBase
25  {
26  protected:
29 
33  float m_fltVm;
34 
36  float m_fltTdot;
37 
39  float m_fltTension;
40 
43 
45  SigmoidGain m_gainStimTension;
46 
48  LengthTensionGain m_gainLengthTension;
49 
56  virtual void CalculateTension() = 0;
57 
58  public:
59  MuscleBase();
60  virtual ~MuscleBase();
61 
62  static MuscleBase *CastToDerived(AnimatBase *lpBase) {return static_cast<MuscleBase*>(lpBase);}
63 
64  float Tension();
65  void Tension(float fltVal);
66 
67  float MaxTension();
68  void MaxTension(float fltVal);
69 
70  float Vm();
71  float Tdot();
72  float PrevTension();
73 
74  virtual bool Enabled();
75  virtual void Enabled(bool bVal);
76 
77  virtual SigmoidGain *StimTension();
78  virtual void StimTension(std::string strXml);
79 
80  virtual LengthTensionGain *LengthTension();
81  virtual void LengthTension(std::string strXml);
82 
95  virtual void CalculateInverseDynamics(float fltLength, float fltVelocity, float fltT, float &fltVm, float &fltA) = 0;
96  virtual void AddExternalNodeInput(int iTargetDataType, float fltInput);
97 
98  virtual void SetSystemPointers(Simulator *lpSim, Structure *lpStructure, NeuralModule *lpModule, Node *lpNode, bool bVerify);
99  virtual void VerifySystemPointers();
100 
101  virtual void ResetSimulation();
102 
103  virtual float *GetDataPointer(const std::string &strDataType);
104  virtual bool SetData(const std::string &strDataType, const std::string &strValue, bool bThrowError = true);
105  virtual void QueryProperties(CStdPtrArray<TypeProperty> &aryProperties);
106 
107  virtual void Load(CStdXml &oXml);
108  };
109 
110  } //Bodies
111  } // Environment
112 } //AnimatSim
Simulates the entire environment.
Definition: Simulator.h:31
Root namespace for the base simulation library for AnimatLab.
SigmoidGain m_gainStimTension
The stimulus-tension gain.
Definition: MuscleBase.h:45
A "static" structure in the simulation.
Definition: Structure.h:84
float m_fltPrevTension
Tension of the muscle in the last time slice.
Definition: MuscleBase.h:42
float m_fltMaxTension
The maximum tension that this muscle can ever generate. This is an upper limit to prevent unrealistic...
Definition: MuscleBase.h:28
Animat base class.
Definition: AnimatBase.h:36
Base class for body parts and neural network nodes.
Definition: Node.h:25
float m_fltTension
Tension of the muscle.
Definition: MuscleBase.h:39
LengthTensionGain m_gainLengthTension
The length-tension gain.
Definition: MuscleBase.h:48
Base class for Line body part types.
Definition: LineBase.h:25
float m_fltTdot
The derivative of tension at the current time step.
Definition: MuscleBase.h:36