ScenePrivate.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015-2016 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 _GAZEBO_RENDERING_SCENE_PRIVATE_HH_
18 #define _GAZEBO_RENDERING_SCENE_PRIVATE_HH_
19 
20 #include <list>
21 #include <map>
22 #include <string>
23 #include <vector>
24 #include <mutex>
25 
26 #include <boost/unordered/unordered_map.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 gazebo
49 {
50  namespace rendering
51  {
52  class Projector;
53  class Visual;
54  class Grid;
55  class Heightmap;
56 
59  typedef std::map<uint32_t, VisualPtr> Visual_M;
60 
63  typedef std::list<boost::shared_ptr<msgs::Visual const> > VisualMsgs_L;
64 
67  typedef std::list<boost::shared_ptr<msgs::Light const> > LightMsgs_L;
68 
71  typedef std::map<uint32_t, msgs::Pose> PoseMsgs_M;
72 
75  typedef std::list<boost::shared_ptr<msgs::Scene const> > SceneMsgs_L;
76 
79  typedef std::list<boost::shared_ptr<msgs::Joint const> > JointMsgs_L;
80 
83  typedef std::list<boost::shared_ptr<msgs::Link const> > LinkMsgs_L;
84 
87  typedef std::list<boost::shared_ptr<msgs::Model const> > ModelMsgs_L;
88 
91  typedef std::list<boost::shared_ptr<msgs::Sensor const> > SensorMsgs_L;
92 
95  typedef std::list<boost::shared_ptr<msgs::Request const> > RequestMsgs_L;
96 
99  typedef std::map<std::string, LightPtr> Light_M;
100 
103  typedef std::list<boost::shared_ptr<msgs::PoseAnimation const> >
105 
108  typedef boost::unordered_map<std::string,
109  boost::shared_ptr<msgs::Joint const> > JointMsgs_M;
110 
113  {
114 /* public: enum SkyXMode {
115  GZ_SKYX_ALL = 0x0FFFFFFF,
116  GZ_SKYX_CLOUDS = 0x0000001,
117  GZ_SKYX_MOON = 0x0000002,
118  GZ_SKYX_NONE = 0
119  };*/
120 
122  public: std::string name;
123 
125  public: sdf::ElementPtr sdf;
126 
128  public: std::vector<CameraPtr> cameras;
129 
131  public: std::vector<UserCameraPtr> userCameras;
132 
133 #ifdef HAVE_OCULUS
134  public: std::vector<OculusCameraPtr> oculusCameras;
136 #endif
137 
139  public: Ogre::SceneManager *manager;
140 
142  public: Ogre::RaySceneQuery *raySceneQuery;
143 
145  public: std::vector<Grid *> grids;
146 
148  public: static uint32_t idCounter;
149 
151  public: uint32_t id;
152 
154  public: std::string idString;
155 
158 
161 
164 
167 
170 
173 
176 
179 
182 
185 
188 
191 
194 
196  public: Visual_M visuals;
197 
199  public: Light_M lights;
200 
203 
205  public: std::mutex *receiveMutex;
206 
208  public: std::recursive_mutex poseMsgMutex;
209 
212 
215 
218 
221 
224 
227 
230 
233 
236 
239 
242 
245 
248 
251 
254 
256  public: std::vector<event::ConnectionPtr> connections;
257 
260 
263 
266 
272  public: std::string selectionMode;
273 
275  public: msgs::Request *requestMsg;
276 
278  public: bool enableVisualizations;
279 
281  public: Heightmap *terrain;
282 
284  public: std::map<std::string, Projector *> projectors;
285 
287  public: SkyX::SkyX *skyx;
288 
290  public: SkyX::BasicController *skyxController;
291 
293  public: bool showCOMs;
294 
296  public: bool showInertias;
297 
299  public: bool showLinkFrames;
300 
302  public: bool showCollisions;
303 
305  public: bool showJoints;
306 
308  public: bool transparent;
309 
311  public: bool wireframe;
312 
314  public: bool initialized;
315 
319 
323 
325  public: uint32_t contactVisId;
326 
329  };
330  }
331 }
332 #endif
uint32_t id
The unique ID of this scene.
Definition: ScenePrivate.hh:151
RequestMsgs_L requestMsgs
List of request message to process.
Definition: ScenePrivate.hh:193
transport::NodePtr node
Communication Node.
Definition: ScenePrivate.hh:211
bool showInertias
True when all inertias should be visualized.
Definition: ScenePrivate.hh:296
std::list< boost::shared_ptr< msgs::Sensor const > > SensorMsgs_L
Definition: ScenePrivate.hh:91
transport::SubscriberPtr skySub
Subscribe to sky updates.
Definition: ScenePrivate.hh:244
uint32_t contactVisId
Keeps track of the visual ID for contact visualization.
Definition: ScenePrivate.hh:325
transport::SubscriberPtr jointSub
Subscribe to joint updates.
Definition: ScenePrivate.hh:235
std::shared_ptr< OriginVisual > OriginVisualPtr
Definition: RenderTypes.hh:176
boost::shared_ptr< Subscriber > SubscriberPtr
Definition: TransportTypes.hh:53
bool showLinkFrames
True when all link frames should be visualized.
Definition: ScenePrivate.hh:299
std::map< std::string, LightPtr > Light_M
Definition: ScenePrivate.hh:99
std::vector< Grid * > grids
All the grids in the scene.
Definition: ScenePrivate.hh:145
transport::SubscriberPtr sceneSub
Subscribe to scene topic.
Definition: ScenePrivate.hh:217
Forward declarations for transport.
transport::PublisherPtr requestPub
Publish requests.
Definition: ScenePrivate.hh:253
LightMsgs_L lightModifyMsgs
List of light modify message to process.
Definition: ScenePrivate.hh:172
bool initialized
Initialized.
Definition: ScenePrivate.hh:314
transport::SubscriberPtr skeletonPoseSub
Subscribe to skeleton pose updates.
Definition: ScenePrivate.hh:241
transport::SubscriberPtr visSub
Subscribe to visual topic.
Definition: ScenePrivate.hh:223
common::Time sceneSimTimePosesReceived
SimTime of this Scene, as we receive PosesStamped from the world, we update this time accordingly...
Definition: ScenePrivate.hh:318
transport::SubscriberPtr responseSub
Subscribe to reponses.
Definition: ScenePrivate.hh:238
std::list< boost::shared_ptr< msgs::Model const > > ModelMsgs_L
Definition: ScenePrivate.hh:87
transport::SubscriberPtr modelInfoSub
Subscribe to model info updates.
Definition: ScenePrivate.hh:247
transport::SubscriberPtr sensorSub
Subscribe to sensor topic.
Definition: ScenePrivate.hh:214
std::shared_ptr< Visual > VisualPtr
Definition: RenderTypes.hh:112
PoseMsgs_M poseMsgs
List of pose message to process.
Definition: ScenePrivate.hh:175
std::list< boost::shared_ptr< msgs::Scene const > > SceneMsgs_L
Definition: ScenePrivate.hh:75
ModelMsgs_L modelMsgs
List of model message to process.
Definition: ScenePrivate.hh:187
Heightmap * terrain
The heightmap, if any.
Definition: ScenePrivate.hh:281
std::list< boost::shared_ptr< msgs::Light const > > LightMsgs_L
Definition: ScenePrivate.hh:67
std::map< std::string, Projector * > projectors
All the projectors.
Definition: ScenePrivate.hh:284
VisualMsgs_L linkVisualMsgs
List of link visual messages to process.
Definition: ScenePrivate.hh:160
std::string name
Name of the scene.
Definition: ScenePrivate.hh:122
sdf::ElementPtr sdf
Scene SDF element.
Definition: ScenePrivate.hh:125
std::list< boost::shared_ptr< msgs::Joint const > > JointMsgs_L
Definition: ScenePrivate.hh:79
OriginVisualPtr originVisual
Visual representing the world origin frame.
Definition: ScenePrivate.hh:262
std::vector< OculusCameraPtr > oculusCameras
All the oculus cameras.
Definition: ScenePrivate.hh:135
std::vector< CameraPtr > cameras
All the cameras.
Definition: ScenePrivate.hh:128
Private data for the Visual class.
Definition: ScenePrivate.hh:112
Light_M lights
Map of all the lights in this scene.
Definition: ScenePrivate.hh:199
std::list< boost::shared_ptr< msgs::Visual const > > VisualMsgs_L
Definition: ScenePrivate.hh:63
Rendering a terrain using heightmap information.
Definition: Heightmap.hh:68
std::map< uint32_t, VisualPtr > Visual_M
Definition: ScenePrivate.hh:59
static uint32_t idCounter
Unique ID counter.
Definition: ScenePrivate.hh:148
SkyX::BasicController * skyxController
Controls the sky.
Definition: ScenePrivate.hh:290
transport::SubscriberPtr requestSub
Subscribe to the request topic.
Definition: ScenePrivate.hh:220
SensorMsgs_L sensorMsgs
List of sensor message to process.
Definition: ScenePrivate.hh:190
JointMsgs_M joints
Keep track of data of joints.
Definition: ScenePrivate.hh:328
std::vector< UserCameraPtr > userCameras
All the user cameras.
Definition: ScenePrivate.hh:131
JointMsgs_L jointMsgs
List of joint message to process.
Definition: ScenePrivate.hh:181
Visual_M visuals
Map of all the visuals in this scene.
Definition: ScenePrivate.hh:196
std::list< boost::shared_ptr< msgs::PoseAnimation const > > SkeletonPoseMsgs_L
Definition: ScenePrivate.hh:104
Ogre::SceneManager * manager
The ogre scene manager.
Definition: ScenePrivate.hh:139
std::list< boost::shared_ptr< msgs::Link const > > LinkMsgs_L
Definition: ScenePrivate.hh:83
VisualPtr selectedVis
Pointer to a visual selected by a user via the GUI.
Definition: ScenePrivate.hh:265
boost::shared_ptr< Node > NodePtr
Definition: TransportTypes.hh:57
std::recursive_mutex poseMsgMutex
Mutex to lock the pose message buffers.
Definition: ScenePrivate.hh:208
SkyX::SkyX * skyx
Pointer to the sky.
Definition: ScenePrivate.hh:287
common::Time sceneSimTimePosesApplied
SimTime of this Scene, after applying PosesStamped to scene, we update this time accordingly.
Definition: ScenePrivate.hh:322
std::vector< event::ConnectionPtr > connections
Event connections.
Definition: ScenePrivate.hh:256
bool wireframe
True when all objects should be wireframe.
Definition: ScenePrivate.hh:311
std::string idString
String form of the id.
Definition: ScenePrivate.hh:154
transport::SubscriberPtr poseSub
Subscribe to pose updates.
Definition: ScenePrivate.hh:232
std::mutex * receiveMutex
Mutex to lock the various message buffers.
Definition: ScenePrivate.hh:205
SkeletonPoseMsgs_L skeletonPoseMsgs
List of skeleton message to process.
Definition: ScenePrivate.hh:202
VisualMsgs_L collisionVisualMsgs
List of collision visual messages to process.
Definition: ScenePrivate.hh:166
transport::SubscriberPtr lightFactorySub
Subscribe to light factory topic.
Definition: ScenePrivate.hh:226
bool showCOMs
True when all COMs should be visualized.
Definition: ScenePrivate.hh:293
msgs::Request * requestMsg
Keep around our request message.
Definition: ScenePrivate.hh:275
SceneMsgs_L sceneMsgs
List of scene message to process.
Definition: ScenePrivate.hh:178
VisualMsgs_L modelVisualMsgs
List of model visual messages to process.
Definition: ScenePrivate.hh:157
transport::SubscriberPtr lightModifySub
Subscribe to light modify topic.
Definition: ScenePrivate.hh:229
VisualPtr worldVisual
The top level in our tree of visuals.
Definition: ScenePrivate.hh:259
boost::shared_ptr< Publisher > PublisherPtr
Definition: TransportTypes.hh:49
transport::PublisherPtr responsePub
Respond to requests.
Definition: ScenePrivate.hh:250
Ogre::RaySceneQuery * raySceneQuery
A ray query used to locate distances to visuals.
Definition: ScenePrivate.hh:142
std::list< boost::shared_ptr< msgs::Request const > > RequestMsgs_L
Definition: ScenePrivate.hh:95
bool showCollisions
True when all collisions should be visualized.
Definition: ScenePrivate.hh:302
std::map< uint32_t, msgs::Pose > PoseMsgs_M
Definition: ScenePrivate.hh:71
bool transparent
True when all objects should be transparent.
Definition: ScenePrivate.hh:308
std::string selectionMode
Selection mode (normal or move).
Definition: ScenePrivate.hh:272
VisualMsgs_L visualMsgs
List of visual messages to process.
Definition: ScenePrivate.hh:163
bool showJoints
True when all joints should be visualized.
Definition: ScenePrivate.hh:305
LinkMsgs_L linkMsgs
List of link message to process.
Definition: ScenePrivate.hh:184
A Time class, can be used to hold wall- or sim-time.
Definition: Time.hh:44
LightMsgs_L lightFactoryMsgs
List of light factory message to process.
Definition: ScenePrivate.hh:169
boost::unordered_map< std::string, boost::shared_ptr< msgs::Joint const > > JointMsgs_M
Definition: ScenePrivate.hh:109
bool enableVisualizations
True if visualizations should be rendered.
Definition: ScenePrivate.hh:278