##

Road.hh
Go to the documentation of this file.
/*
* Copyright (C) 2012 Open Source Robotics Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#ifndef GAZEBO_PHYSICS_ROAD_HH_
#define GAZEBO_PHYSICS_ROAD_HH_
#include <string>
#include <vector>
#include <algorithm>
#include <ignition/math/Vector3.hh>
#include <ignition/transport/Node.hh>
#include "gazebo/transport/TransportTypes.hh"
#include "gazebo/physics/Base.hh"
#include "gazebo/util/system.hh"
namespace gazebo
{
namespace physics
{
class GZ_PHYSICS_VISIBLE Road : public Base
{
public: explicit Road(BasePtr _parent);
public: virtual ~Road();
public: void Load(sdf::ElementPtr _sdf);
public: virtual void Init();
public: virtual void Fini();
public: const std::vector<ignition::math::Vector3d> &Points() const;
public: double GetWidth() const;
private: double width;
private: std::vector<ignition::math::Vector3d> points;
private: transport::NodePtr node;
private: transport::PublisherPtr roadPub;
// Place ignition::transport objects at the end of this file to
// guarantee they are destructed first.
private: ignition::transport::Node nodeIgn;
private: ignition::transport::Node::Publisher roadPubIgn;
};
}
}
#endif
gazebo::physics::Road::Points
const std::vector< ignition::math::Vector3d > & Points() const
Get the points that define the road.
gazebo
Forward declarations for the common classes.
Definition: Animation.hh:26
gazebo::transport::PublisherPtr
boost::shared_ptr< Publisher > PublisherPtr
Definition: TransportTypes.hh:49
TransportTypes.hh
Forward declarations for transport.
system.hh
gazebo::transport::NodePtr
boost::shared_ptr< Node > NodePtr
Definition: TransportTypes.hh:57
gazebo::physics::Base
Base class for most physics classes.
Definition: Base.hh:71
gazebo::physics::Road::Load
void Load(sdf::ElementPtr _sdf)
Load the road from SDF.
gazebo::physics::Road::Init
virtual void Init()
Initialize the road.
Base.hh
gazebo::physics::BasePtr
boost::shared_ptr< Base > BasePtr
Definition: PhysicsTypes.hh:77
gazebo::physics::Road::~Road
virtual ~Road()
Destructor.
gazebo::msgs::Init
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
gazebo::physics::Road::Road
Road(BasePtr _parent)
Constructor.
gazebo::physics::Road::Fini
virtual void Fini()
Finalize the road.
gazebo::physics::Road
for building a Road from SDF
Definition: Road.hh:40
gazebo::physics::Road::GetWidth
double GetWidth() const
Get the road width in meters.