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
29#include "gazebo/util/system.hh"
30
31namespace 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
Forward declarations for transport.
Base class for most physics classes.
Definition Base.hh:72
for building a Road from SDF
Definition Road.hh:41
const std::vector< ignition::math::Vector3d > & Points() const
Get the points that define the road.
double GetWidth() const
Get the road width in meters.
Road(BasePtr _parent)
Constructor.
virtual void Fini()
Finalize the road.
virtual void Init()
Initialize the road.
virtual ~Road()
Destructor.
void Load(sdf::ElementPtr _sdf)
Load the road from SDF.
boost::shared_ptr< Base > BasePtr
Definition PhysicsTypes.hh:77
boost::shared_ptr< Publisher > PublisherPtr
Definition TransportTypes.hh:49
boost::shared_ptr< Node > NodePtr
Definition TransportTypes.hh:57
Forward declarations for the common classes.
Definition Animation.hh:27