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 
27 #include "gazebo/math/Vector3.hh"
29 #include "gazebo/physics/Base.hh"
30 #include "gazebo/util/system.hh"
31 
32 namespace gazebo
33 {
34  namespace physics
35  {
38 
41  class GZ_PHYSICS_VISIBLE Road : public Base
42  {
45  public: explicit Road(BasePtr _parent);
46 
48  public: virtual ~Road();
49 
52  public: void Load(sdf::ElementPtr _sdf);
53 
55  public: virtual void Init();
56 
58  public: virtual void Fini();
59 
63  public: const std::vector<math::Vector3> GetPoints() const
64  GAZEBO_DEPRECATED(8.0);
65 
68  public: const std::vector<ignition::math::Vector3d> &Points() const;
69 
72  public: double GetWidth() const;
73 
75  private: double width;
76 
78  private: std::vector<ignition::math::Vector3d> points;
79 
81  private: transport::NodePtr node;
82 
84  private: transport::PublisherPtr roadPub;
85 
86  // Place ignition::transport objects at the end of this file to
87  // guarantee they are destructed first.
88 
90  private: ignition::transport::Node nodeIgn;
91 
93  private: ignition::transport::Node::Publisher roadPubIgn;
94  };
96  }
97 }
98 #endif
for building a Road from SDF
Definition: Road.hh:41
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
#define GAZEBO_DEPRECATED(version)
Definition: system.hh:302
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
boost::shared_ptr< Base > BasePtr
Definition: PhysicsTypes.hh:77