19 #ifndef __UUV_GAZEBO_PLUGINS_UMBILICAL_MODEL_HH__ 20 #define __UUV_GAZEBO_PLUGINS_UMBILICAL_MODEL_HH__ 24 #include <gazebo/gazebo.hh> 25 #include <gazebo/common/UpdateInfo.hh> 26 #include <gazebo/physics/Link.hh> 27 #include <gazebo/physics/Model.hh> 41 public:
virtual void Init();
44 public:
virtual void OnUpdate(
const common::UpdateInfo &_info,
45 const ignition::math::Vector3d& _flow) = 0;
48 protected: physics::ModelPtr
model;
63 physics::ModelPtr _model);
69 public:
bool RegisterCreator(
const std::string& _identifier,
76 private: std::map<std::string, UmbilicalModelCreator>
creators_;
80 #define REGISTER_UMBILICALMODEL(type) \ 81 static const bool registeredWithFactory 84 #define REGISTER_UMBILICALMODEL_CREATOR(type, creator) \ 85 const bool type::registeredWithFactory = \ 86 UmbilicalModelFactory::GetInstance().RegisterCreator( \ 87 type::IDENTIFIER, creator); 93 physics::ModelPtr _model);
97 physics::ModelPtr _model);
100 public:
virtual void OnUpdate(
const common::UpdateInfo &_info,
101 const ignition::math::Vector3d& _flow);
117 #endif // __UUV_GAZEBO_PLUGINS_UMBILICAL_MODEL_HH__
Factory singleton class that creates an UmbilicalModel from sdf.
std::map< std::string, UmbilicalModelCreator > creators_
Map of each registered identifiers to its corresponding creator.
static const std::string IDENTIFIER
The unique identifier of this UmbilicalModel.
double diameter
Umbilical diameter.
UmbilicalModelFactory()
Constructor is private since this is a singleton.
physics::LinkPtr connector
Moving connector link of this umbilical.
physics::ModelPtr model
Gazebo model to which this umbilical belongs.
virtual ~UmbilicalModel()
Destructor.
virtual void OnUpdate(const common::UpdateInfo &_info, const ignition::math::Vector3d &_flow)=0
Update Umbilical (and apply forces)
virtual void Init()
Initialize model.
#define REGISTER_UMBILICALMODEL(type)
Use the following macro within a ThrusterDynamics declaration:
UmbilicalModel()
Protected constructor: Use the factory instead.
UmbilicalModel *(* UmbilicalModelCreator)(sdf::ElementPtr, physics::ModelPtr)
Function pointer to create a certain conversion function.