19 #ifndef __UUV_GAZEBO_PLUGINS_THRUSTER_DYNAMICS_HH__ 20 #define __UUV_GAZEBO_PLUGINS_THRUSTER_DYNAMICS_HH__ 39 public:
virtual std::string
GetType() = 0;
44 public:
virtual double update(
double _cmd,
double _t) = 0;
47 public:
virtual void Reset();
57 typedef Dynamics* (*DynamicsCreator)(sdf::ElementPtr);
63 public:
Dynamics* CreateDynamics(sdf::ElementPtr _sdf);
69 public:
bool RegisterCreator(
const std::string& _identifier,
76 private: std::map<std::string, DynamicsCreator>
creators_;
80 #define REGISTER_DYNAMICS(type) static const bool registeredWithFactory 83 #define REGISTER_DYNAMICS_CREATOR(type, creator) \ 84 const bool type::registeredWithFactory = \ 85 DynamicsFactory::GetInstance().RegisterCreator( \ 86 type::IDENTIFIER, creator); 93 public:
static Dynamics* create(sdf::ElementPtr _sdf);
96 public:
virtual std::string
GetType() {
return IDENTIFIER; }
99 public:
virtual double update(
double _cmd,
double _t);
116 public:
static Dynamics* create(sdf::ElementPtr _sdf);
119 public:
virtual std::string
GetType() {
return IDENTIFIER; }
122 public:
virtual double update(
double _cmd,
double _t);
146 public:
static Dynamics* create(sdf::ElementPtr _sdf);
149 public:
virtual std::string
GetType() {
return IDENTIFIER; }
152 public:
virtual double update(
double _cmd,
double _t);
179 public:
static Dynamics* create(sdf::ElementPtr _sdf);
182 public:
virtual std::string
GetType() {
return IDENTIFIER; }
185 public:
virtual double update(
double _cmd,
double _t);
195 double _Kt,
double _Rm);
std::map< std::string, DynamicsCreator > creators_
Map of each registered identifier to its corresponding creator.
#define REGISTER_DYNAMICS(type)
Use the following macro within a ThrusterDynamics declaration:
virtual ~Dynamics()
Destructor.
Yoerger's dynamic thruster model.
Dynamics()
Protected constructor: Use the factory for object creation.
DynamicsZeroOrder()
Constructor.
double alpha
Lumped model parameter with no direct physical meaning.
Bessa's dynamic thruster model.
double Kv2
Empirically-determined model parameter.
static const std::string IDENTIFIER
Unique identifier for this dynamical model.
virtual std::string GetType()=0
Return (derived) type of thruster dynamics.
DynamicsFactory()
Constructor is private since this is a singleton.
Dynamics *(* DynamicsCreator)(sdf::ElementPtr)
Function pointer to create a certain thruster dynamics object.
double tau
Time constant tau.
double Kv1
Empirically-determined model parameter.
virtual std::string GetType()
Return (derived) type of dynamic system.
double beta
Lumped model parameter with no direct physical meaning.
static const std::string IDENTIFIER
Unique identifier for this dynamical model.
virtual std::string GetType()
Return (derived) type of dynamic system.
double prevTime
Time of last state update.
static const std::string IDENTIFIER
Unique identifier for this dynamical model.
double Rm
Winding resistance.
Abstract base class for thruster dynamics.
double state
Latest state.
virtual std::string GetType()
Return (derived) type of dynamic system.
double Kt
Motor torque constant.
First-order dynamic system.
virtual std::string GetType()
Return (derived) type of dynamic system.
static const std::string IDENTIFIER
Unique identifier for this dynamical model.
Trivial (no dynamics) zero-order dynamic system.
Factory singleton class that creates a ThrusterDynamics from sdf.
virtual double update(double _cmd, double _t)=0
Update the dynamic model.
double Jmsp
Motor-shaft-propeller inertia.