Road.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012 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 
18 #ifndef GAZEBO_PHYSICS_ROAD_HH_
19 #define GAZEBO_PHYSICS_ROAD_HH_
20 
21 #include <string>
22 #include <vector>
23 #include <algorithm>
24 #include <ignition/math/Vector3.hh>
25 #include <ignition/transport/Node.hh>
26 
28 #include "gazebo/physics/Base.hh"
29 #include "gazebo/util/system.hh"
30 
31 namespace gazebo
32 {
33  namespace physics
34  {
37 
40  class GZ_PHYSICS_VISIBLE Road : public Base
41  {
44  public: explicit Road(BasePtr _parent);
45 
47  public: virtual ~Road();
48 
51  public: void Load(sdf::ElementPtr _sdf);
52 
54  public: virtual void Init();
55 
57  public: virtual void Fini();
58 
61  public: const std::vector<ignition::math::Vector3d> &Points() const;
62 
65  public: double GetWidth() const;
66 
68  private: double width;
69 
71  private: std::vector<ignition::math::Vector3d> points;
72 
74  private: transport::NodePtr node;
75 
77  private: transport::PublisherPtr roadPub;
78 
79  // Place ignition::transport objects at the end of this file to
80  // guarantee they are destructed first.
81 
83  private: ignition::transport::Node nodeIgn;
84 
86  private: ignition::transport::Node::Publisher roadPubIgn;
87  };
89  }
90 }
91 #endif
for building a Road from SDF
Definition: Road.hh:40
Forward declarations for transport.
boost::shared_ptr< Publisher > PublisherPtr
Definition: TransportTypes.hh:49
boost::shared_ptr< Node > NodePtr
Definition: TransportTypes.hh:57
Base class for most physics classes.
Definition: Base.hh:77
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
boost::shared_ptr< Base > BasePtr
Definition: PhysicsTypes.hh:77