ScenePrivate.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015 Open Source Robotics Foundation
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 */
17 #ifndef _SCENE_PRIVATE_HH_
18 #define _SCENE_PRIVATE_HH_
19 
20 #include <list>
21 #include <map>
22 #include <string>
23 #include <vector>
24 
25 #include <boost/unordered/unordered_map.hpp>
26 #include <boost/thread/recursive_mutex.hpp>
27 
28 #include <sdf/sdf.hh>
29 
30 #include "gazebo/common/Events.hh"
31 #include "gazebo/gazebo_config.h"
32 #include "gazebo/msgs/msgs.hh"
35 
36 namespace SkyX
37 {
38  class SkyX;
39  class BasicController;
40 }
41 
42 namespace Ogre
43 {
44  class SceneManager;
45  class RaySceneQuery;
46 }
47 
48 namespace boost
49 {
50  class mutex;
51 }
52 
53 namespace gazebo
54 {
55  namespace rendering
56  {
57  class Projector;
58  class Visual;
59  class Grid;
60  class Heightmap;
61 
64  typedef std::map<uint32_t, VisualPtr> Visual_M;
65 
68  typedef std::list<boost::shared_ptr<msgs::Visual const> > VisualMsgs_L;
69 
72  typedef std::list<boost::shared_ptr<msgs::Light const> > LightMsgs_L;
73 
76  typedef std::map<uint32_t, msgs::Pose> PoseMsgs_M;
77 
80  typedef std::list<boost::shared_ptr<msgs::Scene const> > SceneMsgs_L;
81 
84  typedef std::list<boost::shared_ptr<msgs::Joint const> > JointMsgs_L;
85 
88  typedef std::list<boost::shared_ptr<msgs::Link const> > LinkMsgs_L;
89 
92  typedef std::list<boost::shared_ptr<msgs::Model const> > ModelMsgs_L;
93 
96  typedef std::list<boost::shared_ptr<msgs::Sensor const> > SensorMsgs_L;
97 
100  typedef std::list<boost::shared_ptr<msgs::Request const> > RequestMsgs_L;
101 
104  typedef std::map<std::string, LightPtr> Light_M;
107  typedef std::list<boost::shared_ptr<msgs::PoseAnimation const> >
109 
112  typedef boost::unordered_map<std::string,
113  boost::shared_ptr<msgs::Joint const> > JointMsgs_M;
114 
117  {
118 /* public: enum SkyXMode {
119  GZ_SKYX_ALL = 0x0FFFFFFF,
120  GZ_SKYX_CLOUDS = 0x0000001,
121  GZ_SKYX_MOON = 0x0000002,
122  GZ_SKYX_NONE = 0
123  };*/
124 
126  public: std::string name;
127 
129  public: sdf::ElementPtr sdf;
130 
132  public: std::vector<CameraPtr> cameras;
133 
135  public: std::vector<UserCameraPtr> userCameras;
136 
137 #ifdef HAVE_OCULUS
138  public: std::vector<OculusCameraPtr> oculusCameras;
140 #endif
141 
143  public: Ogre::SceneManager *manager;
144 
146  public: Ogre::RaySceneQuery *raySceneQuery;
147 
149  public: std::vector<Grid *> grids;
150 
152  public: static uint32_t idCounter;
153 
155  public: uint32_t id;
156 
158  public: std::string idString;
159 
162 
165 
168 
171 
174 
177 
180 
183 
186 
189 
192 
195 
197  public: Visual_M visuals;
198 
200  public: Light_M lights;
201 
204 
206  public: boost::mutex *receiveMutex;
207 
209  public: boost::recursive_mutex poseMsgMutex;
210 
213 
216 
219 
222 
225 
228 
231 
234 
237 
240 
243 
246 
249 
252 
255 
257  public: std::vector<event::ConnectionPtr> connections;
258 
261 
264 
267 
273  public: std::string selectionMode;
274 
276  public: msgs::Request *requestMsg;
277 
279  public: bool enableVisualizations;
280 
282  public: Heightmap *terrain;
283 
285  public: std::map<std::string, Projector *> projectors;
286 
288  public: SkyX::SkyX *skyx;
289 
291  public: SkyX::BasicController *skyxController;
292 
294  public: bool showCOMs;
295 
297  public: bool showInertias;
298 
300  public: bool showLinkFrames;
301 
303  public: bool showCollisions;
304 
306  public: bool showJoints;
307 
309  public: bool transparent;
310 
312  public: bool wireframe;
313 
315  public: bool initialized;
316 
320 
324 
326  public: uint32_t contactVisId;
327 
330  };
331  }
332 }
333 #endif
uint32_t id
The unique ID of this scene.
Definition: ScenePrivate.hh:155
RequestMsgs_L requestMsgs
List of request message to process.
Definition: ScenePrivate.hh:194
transport::NodePtr node
Communication Node.
Definition: ScenePrivate.hh:212
bool showInertias
True when all inertias should be visualized.
Definition: ScenePrivate.hh:297
boost::mutex * receiveMutex
Mutex to lock the various message buffers.
Definition: ScenePrivate.hh:206
std::list< boost::shared_ptr< msgs::Sensor const > > SensorMsgs_L
Definition: ScenePrivate.hh:96
transport::SubscriberPtr lightSub
Subscribe to light topics.
Definition: ScenePrivate.hh:227
transport::SubscriberPtr skySub
Subscribe to sky updates.
Definition: ScenePrivate.hh:242
uint32_t contactVisId
Keeps track of the visual ID for contact visualization.
Definition: ScenePrivate.hh:326
transport::SubscriberPtr jointSub
Subscribe to joint updates.
Definition: ScenePrivate.hh:233
boost::shared_ptr< Subscriber > SubscriberPtr
Definition: TransportTypes.hh:53
bool showLinkFrames
True when all link frames should be visualized.
Definition: ScenePrivate.hh:300
std::map< std::string, LightPtr > Light_M
Definition: ScenePrivate.hh:104
std::vector< Grid * > grids
All the grids in the scene.
Definition: ScenePrivate.hh:149
transport::SubscriberPtr sceneSub
Subscribe to scene topic.
Definition: ScenePrivate.hh:218
Forward declarations for transport.
transport::PublisherPtr requestPub
Publish requests.
Definition: ScenePrivate.hh:254
bool initialized
Initialized.
Definition: ScenePrivate.hh:315
transport::SubscriberPtr skeletonPoseSub
Subscribe to skeleton pose updates.
Definition: ScenePrivate.hh:239
boost::recursive_mutex poseMsgMutex
Mutex to lock the pose message buffers.
Definition: ScenePrivate.hh:209
transport::SubscriberPtr visSub
Subscribe to visual topic.
Definition: ScenePrivate.hh:224
common::Time sceneSimTimePosesReceived
SimTime of this Scene, as we receive PosesStamped from the world, we update this time accordingly...
Definition: ScenePrivate.hh:319
transport::SubscriberPtr responseSub
Subscribe to reponses.
Definition: ScenePrivate.hh:236
std::list< boost::shared_ptr< msgs::Model const > > ModelMsgs_L
Definition: ScenePrivate.hh:92
transport::SubscriberPtr modelInfoSub
Subscribe to model info updates.
Definition: ScenePrivate.hh:245
transport::SubscriberPtr sensorSub
Subscribe to sensor topic.
Definition: ScenePrivate.hh:215
PoseMsgs_M poseMsgs
List of pose message to process.
Definition: ScenePrivate.hh:176
std::list< boost::shared_ptr< msgs::Scene const > > SceneMsgs_L
Definition: ScenePrivate.hh:80
ModelMsgs_L modelMsgs
List of model message to process.
Definition: ScenePrivate.hh:188
Heightmap * terrain
The heightmap, if any.
Definition: ScenePrivate.hh:282
std::list< boost::shared_ptr< msgs::Light const > > LightMsgs_L
Definition: ScenePrivate.hh:72
std::map< std::string, Projector * > projectors
All the projectors.
Definition: ScenePrivate.hh:285
VisualMsgs_L linkVisualMsgs
List of link visual messages to process.
Definition: ScenePrivate.hh:164
std::string name
Name of the scene.
Definition: ScenePrivate.hh:126
sdf::ElementPtr sdf
Scene SDF element.
Definition: ScenePrivate.hh:129
std::list< boost::shared_ptr< msgs::Joint const > > JointMsgs_L
Definition: ScenePrivate.hh:84
OriginVisualPtr originVisual
Visual representing the world origin frame.
Definition: ScenePrivate.hh:263
LightMsgs_L lightMsgs
List of light message to process.
Definition: ScenePrivate.hh:173
std::vector< CameraPtr > cameras
All the cameras.
Definition: ScenePrivate.hh:132
Private data for the Visual class.
Definition: ScenePrivate.hh:116
Light_M lights
Map of all the lights in this scene.
Definition: ScenePrivate.hh:200
std::list< boost::shared_ptr< msgs::Visual const > > VisualMsgs_L
Definition: ScenePrivate.hh:68
Rendering a terrain using heightmap information.
Definition: Heightmap.hh:84
transport::PublisherPtr lightPub
Publish light updates.
Definition: ScenePrivate.hh:248
std::map< uint32_t, VisualPtr > Visual_M
Definition: ScenePrivate.hh:64
static uint32_t idCounter
Unique ID counter.
Definition: ScenePrivate.hh:152
SkyX::BasicController * skyxController
Controls the sky.
Definition: ScenePrivate.hh:291
transport::SubscriberPtr requestSub
Subscribe to the request topic.
Definition: ScenePrivate.hh:221
SensorMsgs_L sensorMsgs
List of sensor message to process.
Definition: ScenePrivate.hh:191
JointMsgs_M joints
Keep track of data of joints.
Definition: ScenePrivate.hh:329
std::vector< UserCameraPtr > userCameras
All the user cameras.
Definition: ScenePrivate.hh:135
JointMsgs_L jointMsgs
List of joint message to process.
Definition: ScenePrivate.hh:182
Visual_M visuals
Map of all the visuals in this scene.
Definition: ScenePrivate.hh:197
std::list< boost::shared_ptr< msgs::PoseAnimation const > > SkeletonPoseMsgs_L
Definition: ScenePrivate.hh:108
Ogre::SceneManager * manager
The ogre scene manager.
Definition: ScenePrivate.hh:143
std::list< boost::shared_ptr< msgs::Link const > > LinkMsgs_L
Definition: ScenePrivate.hh:88
VisualPtr selectedVis
Pointer to a visual selected by a user via the GUI.
Definition: ScenePrivate.hh:266
boost::shared_ptr< Node > NodePtr
Definition: TransportTypes.hh:57
SkyX::SkyX * skyx
Pointer to the sky.
Definition: ScenePrivate.hh:288
common::Time sceneSimTimePosesApplied
SimTime of this Scene, after applying PosesStamped to scene, we update this time accordingly.
Definition: ScenePrivate.hh:323
std::vector< event::ConnectionPtr > connections
Event connections.
Definition: ScenePrivate.hh:257
bool wireframe
True when all objects should be wireframe.
Definition: ScenePrivate.hh:312
std::string idString
String form of the id.
Definition: ScenePrivate.hh:158
transport::SubscriberPtr poseSub
Subscribe to pose updates.
Definition: ScenePrivate.hh:230
SkeletonPoseMsgs_L skeletonPoseMsgs
List of skeleton message to process.
Definition: ScenePrivate.hh:203
VisualMsgs_L collisionVisualMsgs
List of collision visual messages to process.
Definition: ScenePrivate.hh:170
boost::shared_ptr< Visual > VisualPtr
Definition: RenderTypes.hh:107
bool showCOMs
True when all COMs should be visualized.
Definition: ScenePrivate.hh:294
msgs::Request * requestMsg
Keep around our request message.
Definition: ScenePrivate.hh:276
SceneMsgs_L sceneMsgs
List of scene message to process.
Definition: ScenePrivate.hh:179
VisualMsgs_L modelVisualMsgs
List of model visual messages to process.
Definition: ScenePrivate.hh:161
VisualPtr worldVisual
The top level in our tree of visuals.
Definition: ScenePrivate.hh:260
boost::shared_ptr< Publisher > PublisherPtr
Definition: TransportTypes.hh:49
transport::PublisherPtr responsePub
Respond to requests.
Definition: ScenePrivate.hh:251
boost::shared_ptr< OriginVisual > OriginVisualPtr
Definition: RenderTypes.hh:167
Ogre::RaySceneQuery * raySceneQuery
A ray query used to locate distances to visuals.
Definition: ScenePrivate.hh:146
std::list< boost::shared_ptr< msgs::Request const > > RequestMsgs_L
Definition: ScenePrivate.hh:100
bool showCollisions
True when all collisions should be visualized.
Definition: ScenePrivate.hh:303
std::map< uint32_t, msgs::Pose > PoseMsgs_M
Definition: ScenePrivate.hh:76
bool transparent
True when all objects should be transparent.
Definition: ScenePrivate.hh:309
std::string selectionMode
Selection mode (normal or move).
Definition: ScenePrivate.hh:273
VisualMsgs_L visualMsgs
List of visual messages to process.
Definition: ScenePrivate.hh:167
bool showJoints
True when all joints should be visualized.
Definition: ScenePrivate.hh:306
LinkMsgs_L linkMsgs
List of link message to process.
Definition: ScenePrivate.hh:185
A Time class, can be used to hold wall- or sim-time.
Definition: Time.hh:39
boost::unordered_map< std::string, boost::shared_ptr< msgs::Joint const > > JointMsgs_M
Definition: ScenePrivate.hh:113
bool enableVisualizations
True if visualizations should be rendered.
Definition: ScenePrivate.hh:279