DVLROSPlugin.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 
16 #ifndef __UUV_DVL_ROS_PLUGIN_HH__
17 #define __UUV_DVL_ROS_PLUGIN_HH__
18 
19 #include <gazebo/gazebo.hh>
20 #include <ros/ros.h>
21 #include <boost/bind.hpp>
22 #include <boost/shared_ptr.hpp>
23 #include <geometry_msgs/TwistWithCovarianceStamped.h>
24 #include <geometry_msgs/PoseStamped.h>
25 #include <sensor_msgs/Range.h>
27 #include <uuv_sensor_ros_plugins_msgs/DVL.h>
28 #include <uuv_sensor_ros_plugins_msgs/DVLBeam.h>
31 #include <tf/transform_listener.h>
32 #include <vector>
33 #include "SensorDvl.pb.h"
34 
35 #define ALTITUDE_OUT_OF_RANGE -1.0
36 namespace gazebo
37 {
40  {
42  public: DVLROSPlugin();
43 
45  public: virtual ~DVLROSPlugin();
46 
48  public: virtual void Load(physics::ModelPtr _model, sdf::ElementPtr _sdf);
49 
51  protected: virtual bool OnUpdate(const common::UpdateInfo& _info);
52 
54  protected: void OnBeamCallback(const sensor_msgs::RangeConstPtr& _range0,
55  const sensor_msgs::RangeConstPtr& _range1,
56  const sensor_msgs::RangeConstPtr& _range2,
57  const sensor_msgs::RangeConstPtr& _range3);
58 
60  protected: bool UpdateBeamTransforms();
61 
62  protected: bool beamTransformsInitialized;
63 
65  protected: double altitude;
66 
68  protected: uuv_sensor_ros_plugins_msgs::DVL dvlROSMsg;
69 
70  protected: std::vector<uuv_sensor_ros_plugins_msgs::DVLBeam> dvlBeamMsgs;
71 
74 
76  protected: geometry_msgs::TwistWithCovarianceStamped twistROSMsg;
77 
79  protected: std::vector<std::string> beamsLinkNames;
80 
82  protected: std::vector<std::string> beamTopics;
83 
85  protected: std::vector<ignition::math::Pose3d> beamPoses;
86 
88  sensor_msgs::Range, sensor_msgs::Range, sensor_msgs::Range, sensor_msgs::Range>>
90 
92  sensor_msgs::Range>> beamSub0;
93 
95  sensor_msgs::Range>> beamSub1;
96 
98  sensor_msgs::Range>> beamSub2;
99 
101  sensor_msgs::Range>> beamSub3;
102 
104  };
105 }
106 
107 #endif // __UUV_DVL_ROS_PLUGIN_HH__
uuv_sensor_ros_plugins_msgs::DVL dvlROSMsg
ROS DVL message.
Definition: DVLROSPlugin.hh:68
std::vector< ignition::math::Pose3d > beamPoses
List of poses of each beam wrt to the DVL frame.
Definition: DVLROSPlugin.hh:85
std::vector< std::string > beamTopics
List of beam topics.
Definition: DVLROSPlugin.hh:82
bool UpdateBeamTransforms()
Updates the poses of each beam wrt the DVL frame.
virtual void Load(physics::ModelPtr _model, sdf::ElementPtr _sdf)
Load the plugin.
Definition: DVLROSPlugin.cc:31
ros::Publisher twistPub
ROS publisher for twist data.
Definition: DVLROSPlugin.hh:73
boost::shared_ptr< message_filters::Subscriber< sensor_msgs::Range > > beamSub3
boost::shared_ptr< message_filters::Subscriber< sensor_msgs::Range > > beamSub0
Definition: DVLROSPlugin.hh:92
std::vector< uuv_sensor_ros_plugins_msgs::DVLBeam > dvlBeamMsgs
Definition: DVLROSPlugin.hh:70
DVLROSPlugin()
Class constructor.
Definition: DVLROSPlugin.cc:21
boost::shared_ptr< message_filters::TimeSynchronizer< sensor_msgs::Range, sensor_msgs::Range, sensor_msgs::Range, sensor_msgs::Range > > syncBeamMessages
Definition: DVLROSPlugin.hh:89
void OnBeamCallback(const sensor_msgs::RangeConstPtr &_range0, const sensor_msgs::RangeConstPtr &_range1, const sensor_msgs::RangeConstPtr &_range2, const sensor_msgs::RangeConstPtr &_range3)
Get beam Range message update.
boost::shared_ptr< message_filters::Subscriber< sensor_msgs::Range > > beamSub1
Definition: DVLROSPlugin.hh:95
tf::TransformListener transformListener
geometry_msgs::TwistWithCovarianceStamped twistROSMsg
Store pose message since many attributes do not change (cov.).
Definition: DVLROSPlugin.hh:76
virtual ~DVLROSPlugin()
Class destructor.
Definition: DVLROSPlugin.cc:27
boost::shared_ptr< message_filters::Subscriber< sensor_msgs::Range > > beamSub2
Definition: DVLROSPlugin.hh:98
virtual bool OnUpdate(const common::UpdateInfo &_info)
Update sensor measurement.
TODO: Modify computation of velocity using the beams.
Definition: DVLROSPlugin.hh:39
std::vector< std::string > beamsLinkNames
List of beam links.
Definition: DVLROSPlugin.hh:79
double altitude
Measured altitude in meters.
Definition: DVLROSPlugin.hh:65


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