23 std::cout << __PRETTY_FUNCTION__ << std::endl;
31 #if GAZEBO_MAJOR_VERSION >= 8 43 this->
world = _model->GetWorld();
45 GZ_ASSERT(_sdf->HasElement(
"umbilical_model"),
46 "Could not find umbilical_model.");
49 _sdf->GetElement(
"umbilical_model"), _model));
54 this->
node = transport::NodePtr(
new transport::Node());
55 std::string worldName;
56 #if GAZEBO_MAJOR_VERSION >= 8 57 worldName = this->
world->Name();
59 worldName = this->
world->GetName();
61 this->
node->Init(worldName);
64 GZ_ASSERT(_sdf->HasElement(
"flow_velocity_topic"),
65 "Umbilical model requires flow velocity topic");
66 std::string flowTopic = _sdf->Get<std::string>(
"flow_velocity_topic");
67 GZ_ASSERT(!flowTopic.empty(),
68 "Fluid velocity topic tag cannot be empty");
75 event::Events::ConnectWorldUpdateBegin(
gazebo::physics::ModelPtr model
Pointer to the model structure.
gazebo::transport::SubscriberPtr flowSubscriber
Subcriber to flow message.
static UmbilicalModelFactory & GetInstance()
Return the singleton instance of this factory.
std::shared_ptr< UmbilicalModel > umbilical
Pointer to UmbilicalModel used in this plugin.
GZ_REGISTER_MODEL_PLUGIN(UmbilicalPlugin)
gazebo::transport::NodePtr node
Gazebo node.
Model plugin for the umbilical (tether) of an ROV.
UmbilicalPlugin()
Destructor.
event::ConnectionPtr updateConnection
Pointer to the update event connection.
~UmbilicalPlugin()
Constructor.
ignition::math::Vector3d flowVelocity
Flow velocity vector read from topic.
virtual void OnUpdate(const common::UpdateInfo &)
Update callback from simulation.
void UpdateFlowVelocity(ConstVector3dPtr &_msg)
Reads flow velocity topic.
virtual void Load(physics::ModelPtr _model, sdf::ElementPtr _sdf)
Load plugin and its configuration from sdf.
gazebo::physics::WorldPtr world
Pointer to the world plugin.