##

RayShape.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_RAYSHAPE_HH_
#define GAZEBO_PHYSICS_RAYSHAPE_HH_
#include <string>
#include "gazebo/physics/PhysicsTypes.hh"
#include "gazebo/physics/Shape.hh"
#include "gazebo/util/system.hh"
namespace gazebo
{
namespace physics
{
class GZ_PHYSICS_VISIBLE RayShape : public Shape
{
public: explicit RayShape(PhysicsEnginePtr _physicsEngine);
public: explicit RayShape(CollisionPtr _parent);
public: virtual ~RayShape();
public: virtual void SetPoints(const ignition::math::Vector3d &_posStart,
const ignition::math::Vector3d &_posEnd);
public: ignition::math::Vector3d Start() const;
public: ignition::math::Vector3d End() const;
public: virtual void RelativePoints(ignition::math::Vector3d &_posA,
ignition::math::Vector3d &_posB);
public: virtual void GlobalPoints(ignition::math::Vector3d &_posA,
ignition::math::Vector3d &_posB);
public: virtual void SetLength(double _len);
public: double GetLength() const;
public: virtual void SetScale(const ignition::math::Vector3d &_scale);
public: virtual void Update() = 0;
public: virtual void GetIntersection(double &_dist,
std::string &_entity) = 0;
public: void SetRetro(float _retro);
public: std::string CollisionName() const;
public: float GetRetro() const;
public: void SetFiducial(int _fid);
public: int GetFiducial() const;
public: virtual void Init();
public: void FillMsg(msgs::Geometry &_msg);
public: virtual void ProcessMsg(const msgs::Geometry &_msg);
public: virtual double ComputeVolume() const;
protected: void SetCollisionName(const std::string &_name);
// Contact information; this is filled out during collision
// detection.
protected: double contactLen;
protected: double contactRetro;
protected: int contactFiducial;
protected: ignition::math::Vector3d relativeStartPos;
protected: ignition::math::Vector3d relativeEndPos;
protected: ignition::math::Vector3d globalStartPos;
protected: ignition::math::Vector3d globalEndPos;
private: std::string collisionName;
protected: friend class ODEMultiRayShape;
};
}
}
#endif
gazebo::physics::RayShape::globalEndPos
ignition::math::Vector3d globalEndPos
End position of the ray in global cs.
Definition: RayShape.hh:159
gazebo::physics::RayShape::RayShape
RayShape(PhysicsEnginePtr _physicsEngine)
Constructor for a global ray.
gazebo::physics::RayShape::End
ignition::math::Vector3d End() const
Get the end point.
gazebo::physics::RayShape::contactLen
double contactLen
Length of the ray.
Definition: RayShape.hh:141
gazebo::physics::RayShape::SetLength
virtual void SetLength(double _len)
Set the length of the ray.
gazebo::physics::RayShape::Update
virtual void Update()=0
Update the ray collision.
gazebo
Forward declarations for the common classes.
Definition: Animation.hh:26
gazebo::physics::RayShape::ComputeVolume
virtual double ComputeVolume() const
Documentation inherited.
gazebo::physics::ODEMultiRayShape
ODE specific version of MultiRayShape.
Definition: ODEMultiRayShape.hh:31
gazebo::physics::RayShape::FillMsg
void FillMsg(msgs::Geometry &_msg)
Fill a message with data from this object.
gazebo::physics::RayShape::GetLength
double GetLength() const
Get the length of the ray.
gazebo::physics::RayShape::SetScale
virtual void SetScale(const ignition::math::Vector3d &_scale)
Set the scale of the ray.
system.hh
gazebo::physics::RayShape::ProcessMsg
virtual void ProcessMsg(const msgs::Geometry &_msg)
Update this shape from a message.
PhysicsTypes.hh
default namespace for gazebo
gazebo::physics::RayShape::SetFiducial
void SetFiducial(int _fid)
Set the fiducial id detected by this ray.
gazebo::physics::RayShape::relativeStartPos
ignition::math::Vector3d relativeStartPos
Start position of the ray, relative to the body.
Definition: RayShape.hh:150
gazebo::physics::RayShape::Init
virtual void Init()
In the ray.
gazebo::physics::RayShape::contactRetro
double contactRetro
Retro reflectance value.
Definition: RayShape.hh:144
gazebo::physics::RayShape::GetIntersection
virtual void GetIntersection(double &_dist, std::string &_entity)=0
Get the nearest intersection.
gazebo::physics::RayShape::~RayShape
virtual ~RayShape()
Destructor.
gazebo::physics::RayShape::relativeEndPos
ignition::math::Vector3d relativeEndPos
End position of the ray, relative to the body.
Definition: RayShape.hh:153
gazebo::physics::RayShape::GetRetro
float GetRetro() const
Get the retro-reflectivness detected by this ray.
gazebo::physics::RayShape
Base class for Ray collision geometry.
Definition: RayShape.hh:35
gazebo::physics::RayShape::SetCollisionName
void SetCollisionName(const std::string &_name)
Set the name of the object this ray has collided with.
gazebo::physics::RayShape::SetPoints
virtual void SetPoints(const ignition::math::Vector3d &_posStart, const ignition::math::Vector3d &_posEnd)
Set the ray based on starting and ending points relative to the body.
gazebo::physics::RayShape::globalStartPos
ignition::math::Vector3d globalStartPos
Start position of the ray in global cs.
Definition: RayShape.hh:156
Shape.hh
gazebo::physics::RayShape::GetFiducial
int GetFiducial() const
Get the fiducial id detected by this ray.
gazebo::msgs::Init
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
gazebo::physics::RayShape::contactFiducial
int contactFiducial
Fiducial ID value.
Definition: RayShape.hh:147
gazebo::physics::RayShape::CollisionName
std::string CollisionName() const
Get the name of the object this ray collided with.
gazebo::physics::RayShape::GlobalPoints
virtual void GlobalPoints(ignition::math::Vector3d &_posA, ignition::math::Vector3d &_posB)
Get the global starting and ending points.
gazebo::physics::RayShape::SetRetro
void SetRetro(float _retro)
Set the retro-reflectivness detected by this ray.
gazebo::physics::PhysicsEnginePtr
boost::shared_ptr< PhysicsEngine > PhysicsEnginePtr
Definition: PhysicsTypes.hh:125
gazebo::physics::CollisionPtr
boost::shared_ptr< Collision > CollisionPtr
Definition: PhysicsTypes.hh:113
gazebo::physics::RayShape::Start
ignition::math::Vector3d Start() const
Get the start point.
gazebo::physics::RayShape::RelativePoints
virtual void RelativePoints(ignition::math::Vector3d &_posA, ignition::math::Vector3d &_posB)
Get the relative starting and ending points.
gazebo::physics::Shape
Base class for all shapes.
Definition: Shape.hh:39