16 #ifndef __UUV_DVL_ROS_PLUGIN_HH__ 17 #define __UUV_DVL_ROS_PLUGIN_HH__ 19 #include <gazebo/gazebo.hh> 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> 33 #include "SensorDvl.pb.h" 35 #define ALTITUDE_OUT_OF_RANGE -1.0 48 public:
virtual void Load(physics::ModelPtr _model, sdf::ElementPtr _sdf);
51 protected:
virtual bool OnUpdate(
const common::UpdateInfo& _info);
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);
68 protected: uuv_sensor_ros_plugins_msgs::DVL
dvlROSMsg;
70 protected: std::vector<uuv_sensor_ros_plugins_msgs::DVLBeam>
dvlBeamMsgs;
76 protected: geometry_msgs::TwistWithCovarianceStamped
twistROSMsg;
85 protected: std::vector<ignition::math::Pose3d>
beamPoses;
88 sensor_msgs::Range, sensor_msgs::Range, sensor_msgs::Range, sensor_msgs::Range>>
107 #endif // __UUV_DVL_ROS_PLUGIN_HH__ uuv_sensor_ros_plugins_msgs::DVL dvlROSMsg
ROS DVL message.
std::vector< ignition::math::Pose3d > beamPoses
List of poses of each beam wrt to the DVL frame.
std::vector< std::string > beamTopics
List of beam topics.
bool UpdateBeamTransforms()
Updates the poses of each beam wrt the DVL frame.
virtual void Load(physics::ModelPtr _model, sdf::ElementPtr _sdf)
Load the plugin.
ros::Publisher twistPub
ROS publisher for twist data.
boost::shared_ptr< message_filters::Subscriber< sensor_msgs::Range > > beamSub3
boost::shared_ptr< message_filters::Subscriber< sensor_msgs::Range > > beamSub0
std::vector< uuv_sensor_ros_plugins_msgs::DVLBeam > dvlBeamMsgs
DVLROSPlugin()
Class constructor.
boost::shared_ptr< message_filters::TimeSynchronizer< sensor_msgs::Range, sensor_msgs::Range, sensor_msgs::Range, sensor_msgs::Range > > syncBeamMessages
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
bool beamTransformsInitialized
tf::TransformListener transformListener
geometry_msgs::TwistWithCovarianceStamped twistROSMsg
Store pose message since many attributes do not change (cov.).
virtual ~DVLROSPlugin()
Class destructor.
boost::shared_ptr< message_filters::Subscriber< sensor_msgs::Range > > beamSub2
virtual bool OnUpdate(const common::UpdateInfo &_info)
Update sensor measurement.
TODO: Modify computation of velocity using the beams.
std::vector< std::string > beamsLinkNames
List of beam links.
double altitude
Measured altitude in meters.