UmbilicalPlugin.hh
Go to the documentation of this file.
1 // Copyright (c) 2016 The UUV Simulator Authors.
2 // All rights reserved.
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 
18 
19 #ifndef __UUV_GAZEBO_PLUGINS_UMBILICAL_PLUGIN_HH__
20 #define __UUV_GAZEBO_PLUGINS_UMBILICAL_PLUGIN_HH__
21 
22 #include <memory>
23 #include <string>
24 
25 #include <gazebo/gazebo.hh>
26 #include <gazebo/common/UpdateInfo.hh>
27 #include <gazebo/common/Plugin.hh>
28 #include <gazebo/physics/World.hh>
29 #include <gazebo/transport/TransportTypes.hh>
30 
32 
33 namespace gazebo
34 {
36 {
37  public:
39 
40  UmbilicalSegment(const std::string& _name,
41  const std::string& _fromLink,
42  const ignition::math::Pose3d& _fromPose,
43  const ignition::math::Pose3d& _toPose,
44  physics::ModelPtr _model);
45 
46  void initSdfSegment();
47 
48  physics::LinkPtr link;
49  physics::LinkPtr linkA;
50  physics::JointPtr jointA;
51  physics::JointPtr jointB;
52 
53  std::shared_ptr<UmbilicalSegment> prev, next;
54 
55  static sdf::SDFPtr sdfSegment;
56 };
57 
58 typedef boost::shared_ptr<UmbilicalSegment> UmbilicalSegmentPtr;
59 
60 class UmbilicalPlugin : public ModelPlugin
61 {
63  public: UmbilicalPlugin();
64 
66  public: ~UmbilicalPlugin();
67 
69  protected: virtual void Load(physics::ModelPtr _model, sdf::ElementPtr _sdf);
70 
72  protected: virtual void OnUpdate(const common::UpdateInfo&);
73 
75  protected: void UpdateFlowVelocity(ConstVector3dPtr &_msg);
76 
78  protected: event::ConnectionPtr updateConnection;
79 
81  protected: gazebo::physics::ModelPtr model;
82 
84  protected: gazebo::physics::WorldPtr world;
85 
87  protected: gazebo::transport::NodePtr node;
88 
90  protected: gazebo::transport::SubscriberPtr flowSubscriber;
91 
93  protected: ignition::math::Vector3d flowVelocity;
94 
96  protected: std::shared_ptr<UmbilicalModel> umbilical;
97 };
98 }
99 
100 #endif
gazebo::physics::ModelPtr model
Pointer to the model structure.
physics::JointPtr jointB
gazebo::transport::SubscriberPtr flowSubscriber
Subcriber to flow message.
std::shared_ptr< UmbilicalSegment > prev
std::shared_ptr< UmbilicalModel > umbilical
Pointer to UmbilicalModel used in this plugin.
gazebo::transport::NodePtr node
Gazebo node.
std::shared_ptr< UmbilicalSegment > next
event::ConnectionPtr updateConnection
Pointer to the update event connection.
Various umbilical models.
static sdf::SDFPtr sdfSegment
physics::JointPtr jointA
boost::shared_ptr< UmbilicalSegment > UmbilicalSegmentPtr
ignition::math::Vector3d flowVelocity
Flow velocity vector read from topic.
gazebo::physics::WorldPtr world
Pointer to the world plugin.


uuv_gazebo_plugins
Author(s): Musa Morena Marcusso Manhaes , Sebastian Scherer , Luiz Ricardo Douat
autogenerated on Mon Jul 1 2019 19:39:12