Road.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012-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 
18 #ifndef _ROAD_HH_
19 #define _ROAD_HH_
20 
21 #include <string>
22 #include <vector>
23 #include <algorithm>
24 
25 #include <gazebo/math/Vector3.hh>
27 #include "gazebo/physics/Base.hh"
28 #include "gazebo/util/system.hh"
29 
30 namespace gazebo
31 {
32  namespace physics
33  {
36 
39  class GZ_PHYSICS_VISIBLE Road : public Base
40  {
43  public: explicit Road(BasePtr _parent);
44 
46  public: virtual ~Road();
47 
50  public: void Load(sdf::ElementPtr _sdf);
51 
53  public: virtual void Init();
54 
57  public: const std::vector<math::Vector3> &GetPoints() const;
58 
61  public: double GetWidth() const;
62 
64  private: double width;
65 
67  private: std::vector<math::Vector3> points;
68 
70  private: transport::NodePtr node;
71 
73  private: transport::PublisherPtr roadPub;
74  };
76  }
77 }
78 #endif
for building a Road from SDF
Definition: Road.hh:39
boost::shared_ptr< Base > BasePtr
Definition: PhysicsTypes.hh:72
#define GZ_PHYSICS_VISIBLE
Definition: system.hh:259
Forward declarations for transport.
Base class for most physics classes.
Definition: Base.hh:80
boost::shared_ptr< Node > NodePtr
Definition: TransportTypes.hh:57
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
boost::shared_ptr< Publisher > PublisherPtr
Definition: TransportTypes.hh:49