gazebo_ros_projector.h
Go to the documentation of this file.
1 /*
2  * Desc: A dynamic controller plugin that controls texture projection.
3  * Author: Jared Duke
4  * Date: 17 June 2010
5  * SVN: $Id$
6  */
7 #ifndef GAZEBO_ROS_PROJECTOR_HH
8 #define GAZEBO_ROS_PROJECTOR_HH
9 
10 // Custom Callback Queue
11 #include <ros/callback_queue.h>
12 #include <ros/subscribe_options.h>
13 
14 #include <ros/ros.h>
15 #include <boost/thread/mutex.hpp>
16 
17 #include <gazebo/physics/physics.hh>
18 #include <gazebo/transport/TransportTypes.hh>
19 #include <gazebo/transport/Node.hh>
20 #include <gazebo/common/Time.hh>
21 #include <gazebo/common/Plugin.hh>
22 #include <gazebo/common/Events.hh>
23 #include <gazebo/rendering/RenderTypes.hh>
24 
25 #include <std_msgs/String.h>
26 #include <std_msgs/Int32.h>
27 
28 #include <OgrePrerequisites.h>
29 #include <OgreTexture.h>
30 #include <OgreFrameListener.h>
31 
32 namespace Ogre
33 {
34  class PlaneBoundedVolumeListSceneQuery;
35  class Frustum;
36  class Pass;
37  class SceneNode;
38 }
39 
40 namespace gazebo
41 {
42 
45 
75 class GazeboRosProjector : public ModelPlugin
76 {
79  public: GazeboRosProjector();
80 
82  public: virtual ~GazeboRosProjector();
83 
86  protected: virtual void Load( physics::ModelPtr _parent, sdf::ElementPtr _sdf );
87 
89  private: physics::WorldPtr world_;
90 
92  private: void LoadImage(const std_msgs::String::ConstPtr& imageMsg);
93 
95  private: void ToggleProjector(const std_msgs::Int32::ConstPtr& projectorMsg);
96 
101 
103  private: std::string texture_topic_name_;
104 
106  private: std::string projector_topic_name_;
107 
109  private: std::string robot_namespace_;
110 
111  // Custom Callback Queue
113  private: void QueueThread();
114  private: boost::thread callback_queue_thread_;
115 
116  private: event::ConnectionPtr add_model_event_;
117 
118  private: transport::NodePtr node_;
119  private: transport::PublisherPtr projector_pub_;
120 };
121 
123 
125 }
126 #endif
127 
Ogre
Definition: gazebo_ros_projector.h:32
gazebo
gazebo::GazeboRosProjector::projector_topic_name_
std::string projector_topic_name_
ROS projector topic name.
Definition: gazebo_ros_projector.h:106
ros.h
gazebo::GazeboRosProjector::callback_queue_thread_
boost::thread callback_queue_thread_
Definition: gazebo_ros_projector.h:114
gazebo::GazeboRosProjector::texture_topic_name_
std::string texture_topic_name_
ROS texture topic name.
Definition: gazebo_ros_projector.h:103
gazebo::GazeboRosProjector::LoadImage
void LoadImage(const std_msgs::String::ConstPtr &imageMsg)
Callback when a texture is published.
Definition: gazebo_ros_projector.cpp:146
gazebo::GazeboRosProjector::add_model_event_
event::ConnectionPtr add_model_event_
Definition: gazebo_ros_projector.h:116
gazebo::GazeboRosProjector::imageSubscriber_
ros::Subscriber imageSubscriber_
Definition: gazebo_ros_projector.h:99
gazebo::GazeboRosProjector::ToggleProjector
void ToggleProjector(const std_msgs::Int32::ConstPtr &projectorMsg)
Callbakc when a projector toggle is published.
Definition: gazebo_ros_projector.cpp:163
gazebo::GazeboRosProjector::node_
transport::NodePtr node_
Definition: gazebo_ros_projector.h:118
ros::CallbackQueue
gazebo::GazeboRosProjector::projector_pub_
transport::PublisherPtr projector_pub_
Definition: gazebo_ros_projector.h:119
gazebo::GazeboRosProjector::~GazeboRosProjector
virtual ~GazeboRosProjector()
Destructor.
Definition: gazebo_ros_projector.cpp:66
callback_queue.h
gazebo::GazeboRosProjector::Load
virtual void Load(physics::ModelPtr _parent, sdf::ElementPtr _sdf)
Load the controller.
Definition: gazebo_ros_projector.cpp:79
gazebo::GazeboRosProjector
Definition: gazebo_ros_projector.h:75
gazebo::GazeboRosProjector::robot_namespace_
std::string robot_namespace_
For setting ROS name space.
Definition: gazebo_ros_projector.h:109
gazebo::GazeboRosProjector::projectorSubscriber_
ros::Subscriber projectorSubscriber_
Definition: gazebo_ros_projector.h:100
gazebo::GazeboRosProjector::queue_
ros::CallbackQueue queue_
Definition: gazebo_ros_projector.h:112
gazebo::GazeboRosProjector::QueueThread
void QueueThread()
Definition: gazebo_ros_projector.cpp:181
subscribe_options.h
ros::NodeHandle
ros::Subscriber
gazebo::GazeboRosProjector::world_
physics::WorldPtr world_
pointer to the world
Definition: gazebo_ros_projector.h:89
gazebo::GazeboRosProjector::GazeboRosProjector
GazeboRosProjector()
Constructor.
Definition: gazebo_ros_projector.cpp:58
gazebo::GazeboRosProjector::rosnode_
ros::NodeHandle * rosnode_
A pointer to the ROS node. A node will be instantiated if it does not exist.
Definition: gazebo_ros_projector.h:98


gazebo_plugins
Author(s): John Hsu
autogenerated on Thu Nov 23 2023 03:50:28