16 #ifndef __THRUSTER_ROS_PLUGIN_HH__ 17 #define __THRUSTER_ROS_PLUGIN_HH__ 25 #include <boost/scoped_ptr.hpp> 26 #include <gazebo/common/Plugin.hh> 28 #include <uuv_gazebo_ros_plugins_msgs/FloatStamped.h> 29 #include <geometry_msgs/WrenchStamped.h> 30 #include <std_msgs/Bool.h> 31 #include <std_msgs/Float64.h> 33 #include <uuv_gazebo_ros_plugins_msgs/SetThrusterState.h> 34 #include <uuv_gazebo_ros_plugins_msgs/GetThrusterState.h> 35 #include <uuv_gazebo_ros_plugins_msgs/SetThrusterEfficiency.h> 36 #include <uuv_gazebo_ros_plugins_msgs/GetThrusterEfficiency.h> 37 #include <uuv_gazebo_ros_plugins_msgs/GetThrusterConversionFcn.h> 50 public:
void Load(gazebo::physics::ModelPtr _parent, sdf::ElementPtr _sdf);
57 const uuv_gazebo_ros_plugins_msgs::FloatStamped::ConstPtr &_msg);
66 public:
virtual void Init();
69 public:
virtual void Reset();
73 uuv_gazebo_ros_plugins_msgs::SetThrusterEfficiency::Request& _req,
74 uuv_gazebo_ros_plugins_msgs::SetThrusterEfficiency::Response& _res);
78 uuv_gazebo_ros_plugins_msgs::GetThrusterEfficiency::Request& _req,
79 uuv_gazebo_ros_plugins_msgs::GetThrusterEfficiency::Response& _res);
83 uuv_gazebo_ros_plugins_msgs::SetThrusterEfficiency::Request& _req,
84 uuv_gazebo_ros_plugins_msgs::SetThrusterEfficiency::Response& _res);
88 uuv_gazebo_ros_plugins_msgs::GetThrusterEfficiency::Request& _req,
89 uuv_gazebo_ros_plugins_msgs::GetThrusterEfficiency::Response& _res);
93 uuv_gazebo_ros_plugins_msgs::SetThrusterState::Request& _req,
94 uuv_gazebo_ros_plugins_msgs::SetThrusterState::Response& _res);
98 uuv_gazebo_ros_plugins_msgs::GetThrusterState::Request& _req,
99 uuv_gazebo_ros_plugins_msgs::GetThrusterState::Response& _res);
103 uuv_gazebo_ros_plugins_msgs::GetThrusterConversionFcn::Request& _req,
104 uuv_gazebo_ros_plugins_msgs::GetThrusterConversionFcn::Response& _res);
107 private: std::map<std::string, ros::ServiceServer>
services;
110 private: boost::scoped_ptr<ros::NodeHandle>
rosNode;
141 #endif // __THRUSTER_ROS_PLUGIN_HH__ ros::Publisher pubThrustForceEff
Publisher for the thrust force efficiency.
bool GetThrustForceEfficiency(uuv_gazebo_ros_plugins_msgs::GetThrusterEfficiency::Request &_req, uuv_gazebo_ros_plugins_msgs::GetThrusterEfficiency::Response &_res)
Get the thrust efficiency factor.
gazebo::common::Time GetRosPublishPeriod()
Return the ROS publish period.
gazebo::event::ConnectionPtr rosPublishConnection
Connection for callbacks on update world.
boost::scoped_ptr< ros::NodeHandle > rosNode
Pointer to this ROS node's handle.
bool SetThrusterState(uuv_gazebo_ros_plugins_msgs::SetThrusterState::Request &_req, uuv_gazebo_ros_plugins_msgs::SetThrusterState::Response &_res)
Turn thruster on/off.
ros::Publisher pubThrust
Publisher for current actual thrust.
ros::Publisher pubThrustWrench
Publisher for current actual thrust as wrench.
std::map< std::string, ros::ServiceServer > services
Map of thruster services.
void RosPublishStates()
Publish thruster state via ROS.
void SetThrustReference(const uuv_gazebo_ros_plugins_msgs::FloatStamped::ConstPtr &_msg)
Set new set point (desired thrust [N]) for thruster.
ros::Publisher pubDynamicStateEff
Publisher for the dynamic state efficiency.
~ThrusterROSPlugin()
Destructor.
virtual void Reset()
Reset Module.
ThrusterROSPlugin()
Constrcutor.
bool SetThrustForceEfficiency(uuv_gazebo_ros_plugins_msgs::SetThrusterEfficiency::Request &_req, uuv_gazebo_ros_plugins_msgs::SetThrusterEfficiency::Response &_res)
Set the thrust efficiency factor.
bool GetDynamicStateEfficiency(uuv_gazebo_ros_plugins_msgs::GetThrusterEfficiency::Request &_req, uuv_gazebo_ros_plugins_msgs::GetThrusterEfficiency::Response &_res)
Get the dynamic state efficiency factor.
bool GetThrusterConversionFcn(uuv_gazebo_ros_plugins_msgs::GetThrusterConversionFcn::Request &_req, uuv_gazebo_ros_plugins_msgs::GetThrusterConversionFcn::Response &_res)
Get thruster conversion function parameters.
bool GetThrusterState(uuv_gazebo_ros_plugins_msgs::GetThrusterState::Request &_req, uuv_gazebo_ros_plugins_msgs::GetThrusterState::Response &_res)
Get thruster state.
void SetRosPublishRate(double _hz)
Set the ROS publish frequency (Hz).
bool SetDynamicStateEfficiency(uuv_gazebo_ros_plugins_msgs::SetThrusterEfficiency::Request &_req, uuv_gazebo_ros_plugins_msgs::SetThrusterEfficiency::Response &_res)
Set the dynamic state efficiency factor.
ros::Publisher pubThrusterState
Publisher for the thruster state.
void Load(gazebo::physics::ModelPtr _parent, sdf::ElementPtr _sdf)
Load module and read parameters from SDF.
ros::Subscriber subThrustReference
Subscriber reacting to new reference thrust set points.
gazebo::common::Time rosPublishPeriod
Period after which we should publish a message via ROS.
gazebo::common::Time lastRosPublishTime
Last time we published a message via ROS.
virtual void Init()
Initialize Module.