##

Wind.hh
Go to the documentation of this file.
/*
* Copyright (C) 2016 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_WIND_HH_
#define GAZEBO_PHYSICS_WIND_HH_
#include <string>
#include <functional>
#include <memory>
#include <boost/any.hpp>
#include "gazebo/msgs/msgs.hh"
#include "gazebo/physics/PhysicsTypes.hh"
#include "gazebo/util/system.hh"
namespace gazebo
{
namespace physics
{
// Forward declare private data class.
class WindPrivate;
class GZ_PHYSICS_VISIBLE Wind
{
public: explicit Wind(World &_world, sdf::ElementPtr _sdf);
public: virtual ~Wind();
public: virtual void Load(sdf::ElementPtr _sdf);
public: bool SetParam(const std::string &_key,
const boost::any &_value);
public: boost::any Param(const std::string &_key) const;
public: bool Param(const std::string &_key, boost::any &_value) const;
private: void OnWindMsg(ConstWindPtr &_msg);
private: void OnRequest(ConstRequestPtr &_msg);
public: ignition::math::Vector3d WorldLinearVel(const Entity *_entity)
const;
public: ignition::math::Vector3d RelativeLinearVel(const Entity *_entity)
const;
public: const ignition::math::Vector3d& LinearVel(void) const;
public: void SetLinearVel(const ignition::math::Vector3d& _vel);
public: void SetLinearVelFunc(std::function< ignition::math::Vector3d (
const Wind *_wind, const Entity *_entity) > _linearVelFunc);
private: ignition::math::Vector3d LinearVelDefault(const Wind *_wind,
const Entity *_entity);
private: std::unique_ptr<WindPrivate> dataPtr;
};
}
}
#endif
gazebo
Forward declarations for the common classes.
Definition: Animation.hh:26
gazebo::physics::Wind::SetLinearVel
void SetLinearVel(const ignition::math::Vector3d &_vel)
Set the global wind velocity.
system.hh
gazebo::physics::Wind::Load
virtual void Load(sdf::ElementPtr _sdf)
Load the wind.
msgs.hh
gazebo::physics::Wind::LinearVel
const ignition::math::Vector3d & LinearVel(void) const
Get the global wind velocity.
PhysicsTypes.hh
default namespace for gazebo
gazebo::physics::Wind::SetParam
bool SetParam(const std::string &_key, const boost::any &_value)
Set a parameter of the wind.
gazebo::physics::Wind::WorldLinearVel
ignition::math::Vector3d WorldLinearVel(const Entity *_entity) const
Get the wind velocity at an entity location in the world coordinate frame.
gazebo::physics::Wind::Wind
Wind(World &_world, sdf::ElementPtr _sdf)
Default constructor.
gazebo::physics::Wind::SetLinearVelFunc
void SetLinearVelFunc(std::function< ignition::math::Vector3d(const Wind *_wind, const Entity *_entity) > _linearVelFunc)
Setup function to compute the wind.
gazebo::physics::World
The world provides access to all other object within a simulated environment.
Definition: World.hh:74
gazebo::physics::Wind::RelativeLinearVel
ignition::math::Vector3d RelativeLinearVel(const Entity *_entity) const
Get the wind velocity at an entity location.
gazebo::physics::Wind
Base class for wind.
Definition: Wind.hh:41
gazebo::physics::Entity
Base class for all physics objects in Gazebo.
Definition: Entity.hh:52
gazebo::physics::Wind::~Wind
virtual ~Wind()
Destructor.
gazebo::physics::Wind::Param
boost::any Param(const std::string &_key) const
Get a wind parameter.