##

GpuRaySensor.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_SENSORS_GPURAYSENSOR_HH_
#define _GAZEBO_SENSORS_GPURAYSENSOR_HH_
#include <memory>
#include <string>
#include <vector>
#include <ignition/math/Angle.hh>
#include <ignition/math/Pose3.hh>
#include "gazebo/rendering/RenderTypes.hh"
#include "gazebo/sensors/Sensor.hh"
#include "gazebo/transport/TransportTypes.hh"
#include "gazebo/util/system.hh"
namespace gazebo
{
namespace sensors
{
// Forward declare private data pointer.
class GpuRaySensorPrivate;
class GZ_SENSORS_VISIBLE GpuRaySensor: public Sensor
{
public: GpuRaySensor();
public: virtual ~GpuRaySensor();
public: virtual void Load(const std::string &_worldName,
sdf::ElementPtr _sdf);
public: virtual void Load(const std::string &_worldName);
public: virtual void Init();
// Documentation inherited
protected: virtual bool UpdateImpl(const bool _force);
protected: virtual void Fini();
// Documentation inherited
public: virtual std::string Topic() const;
public: rendering::GpuLaserPtr LaserCamera() const;
public: ignition::math::Angle AngleMin() const;
public: void SetAngleMin(const double _angle);
public: ignition::math::Angle AngleMax() const;
public: void SetAngleMax(const double _angle);
public: double AngleResolution() const;
public: double RangeMin() const;
public: double RangeMax() const;
public: double RangeResolution() const;
public: int RayCount() const;
public: int RangeCount() const;
public: int VerticalRayCount() const;
public: int VerticalRangeCount() const;
public: ignition::math::Angle VerticalAngleMin() const;
public: void SetVerticalAngleMin(const double _angle);
public: ignition::math::Angle VerticalAngleMax() const;
public: void SetVerticalAngleMax(const double _angle);
public: double VerticalAngleResolution() const;
public: double Range(const int _index) const;
public: void Ranges(std::vector<double> &_ranges) const;
public: double Retro(const int _index) const;
public: int Fiducial(const unsigned int _index) const;
public: unsigned int CameraCount() const;
public: bool IsHorizontal() const;
public: double RayCountRatio() const;
public: double RangeCountRatio() const;
public: double HorzFOV() const;
public: double CosHorzFOV() const;
public: double VertFOV() const;
public: double CosVertFOV() const;
public: double HorzHalfAngle() const;
public: double VertHalfAngle() const;
public: event::ConnectionPtr ConnectNewLaserFrame(
std::function<void(const float *, unsigned int, unsigned int,
unsigned int, const std::string &)> _subscriber);
// Documentation inherited
public: virtual bool IsActive() const;
private: void Render();
private: std::unique_ptr<GpuRaySensorPrivate> dataPtr;
};
}
}
#endif
gazebo::sensors::GpuRaySensor::UpdateImpl
virtual bool UpdateImpl(const bool _force)
This gets overwritten by derived sensor types.
gazebo::sensors::GpuRaySensor::RayCount
int RayCount() const
Get the ray count.
gazebo::sensors::GpuRaySensor::~GpuRaySensor
virtual ~GpuRaySensor()
Destructor.
gazebo::sensors::GpuRaySensor::RangeMin
double RangeMin() const
Get the minimum range.
gazebo::sensors::GpuRaySensor::Retro
double Retro(const int _index) const
Get detected retro (intensity) value for a ray.
gazebo::sensors::GpuRaySensor::ConnectNewLaserFrame
event::ConnectionPtr ConnectNewLaserFrame(std::function< void(const float *, unsigned int, unsigned int, unsigned int, const std::string &)> _subscriber)
Connect to the new laser frame event.
gazebo::sensors::GpuRaySensor::HorzHalfAngle
double HorzHalfAngle() const
Get (horizontal_max_angle + horizontal_min_angle) * 0.5.
gazebo
Forward declarations for the common classes.
Definition: Animation.hh:26
gazebo::rendering::GpuLaserPtr
boost::shared_ptr< GpuLaser > GpuLaserPtr
Definition: RenderTypes.hh:106
gazebo::sensors::GpuRaySensor::VertFOV
double VertFOV() const
Get the vertical field-of-view.
sensors
sensors
Definition: SensorManager.hh:35
gazebo::sensors::GpuRaySensor::VerticalRangeCount
int VerticalRangeCount() const
Get the vertical scan line count.
TransportTypes.hh
Forward declarations for transport.
gazebo::sensors::GpuRaySensor::HorzFOV
double HorzFOV() const
Get the horizontal field of view of the laser sensor.
gazebo::sensors::GpuRaySensor::SetVerticalAngleMin
void SetVerticalAngleMin(const double _angle)
Set the vertical scan bottom angle.
system.hh
gazebo::sensors::GpuRaySensor::CosHorzFOV
double CosHorzFOV() const
Get Cos Horz field-of-view.
gazebo::sensors::GpuRaySensor::VerticalAngleMax
ignition::math::Angle VerticalAngleMax() const
Get the vertical scan line top angle.
gazebo::sensors::GpuRaySensor::Range
double Range(const int _index) const
Get detected range for a ray.
gazebo::sensors::GpuRaySensor::Fiducial
int Fiducial(const unsigned int _index) const
Get detected fiducial value for a ray.
gazebo::sensors::GpuRaySensor::VerticalAngleMin
ignition::math::Angle VerticalAngleMin() const
Get the vertical scan bottom angle.
gazebo::sensors::GpuRaySensor::RangeResolution
double RangeResolution() const
Get the range resolution If RangeResolution is 1, the number of simulated rays is equal to the number...
gazebo::sensors::GpuRaySensor::Topic
virtual std::string Topic() const
Returns the topic name as set in SDF.
gazebo::sensors::GpuRaySensor
GPU based laser sensor.
Definition: GpuRaySensor.hh:50
Sensor.hh
gazebo::sensors::GpuRaySensor::AngleMax
ignition::math::Angle AngleMax() const
Get the maximum angle.
RenderTypes.hh
gazebo::sensors::GpuRaySensor::Load
virtual void Load(const std::string &_worldName, sdf::ElementPtr _sdf)
Load the sensor with SDF parameters.
gazebo::sensors::GpuRaySensor::VerticalRayCount
int VerticalRayCount() const
Get the vertical scan line count.
gazebo::sensors::GpuRaySensor::IsHorizontal
bool IsHorizontal() const
Gets if sensor is horizontal.
gazebo::event::ConnectionPtr
boost::shared_ptr< Connection > ConnectionPtr
Definition: CommonTypes.hh:134
gazebo::msgs::Init
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
gazebo::sensors::GpuRaySensor::CosVertFOV
double CosVertFOV() const
Get Cos Vert field-of-view.
gazebo::sensors::GpuRaySensor::VertHalfAngle
double VertHalfAngle() const
Get (vertical_max_angle + vertical_min_angle) * 0.5.
gazebo::sensors::GpuRaySensor::LaserCamera
rendering::GpuLaserPtr LaserCamera() const
Returns a pointer to the internally kept rendering::GpuLaser.
gazebo::sensors::GpuRaySensor::SetAngleMin
void SetAngleMin(const double _angle)
Set the scan minimum angle.
gazebo::sensors::GpuRaySensor::SetVerticalAngleMax
void SetVerticalAngleMax(const double _angle)
Set the vertical scan line top angle.
gazebo::sensors::GpuRaySensor::GpuRaySensor
GpuRaySensor()
Constructor.
gazebo::sensors::Sensor
Base class for sensors.
Definition: Sensor.hh:51
gazebo::sensors::GpuRaySensor::VerticalAngleResolution
double VerticalAngleResolution() const
Get the vertical angle in radians between each range.
gazebo::sensors::GpuRaySensor::Init
virtual void Init()
Initialize the ray.
gazebo::sensors::GpuRaySensor::SetAngleMax
void SetAngleMax(const double _angle)
Set the scan maximum angle.
gazebo::sensors::GpuRaySensor::RayCountRatio
double RayCountRatio() const
Return the ratio of horizontal ray count to vertical ray count.
gazebo::sensors::GpuRaySensor::AngleResolution
double AngleResolution() const
Get radians between each range.
gazebo::sensors::GpuRaySensor::RangeCountRatio
double RangeCountRatio() const
Return the ratio of horizontal range count to vertical range count.
gazebo::sensors::GpuRaySensor::RangeCount
int RangeCount() const
Get the range count.
gazebo::sensors::GpuRaySensor::RangeMax
double RangeMax() const
Get the maximum range.
gazebo::sensors::GpuRaySensor::Ranges
void Ranges(std::vector< double > &_ranges) const
Get all the ranges.
gazebo::sensors::GpuRaySensor::CameraCount
unsigned int CameraCount() const
Gets the camera count.
gazebo::sensors::GpuRaySensor::Fini
virtual void Fini()
Finalize the ray.
gazebo::sensors::GpuRaySensor::AngleMin
ignition::math::Angle AngleMin() const
Get the minimum angle.
gazebo::sensors::GpuRaySensor::IsActive
virtual bool IsActive() const
Returns true if sensor generation is active.