17 #ifndef _GAZEBO_SENSORS_GPURAYSENSOR_HH_
18 #define _GAZEBO_SENSORS_GPURAYSENSOR_HH_
24 #include <ignition/math/Angle.hh>
25 #include <ignition/math/Pose3.hh>
39 class GpuRaySensorPrivate;
61 public:
virtual void Load(
const std::string &_worldName,
62 sdf::ElementPtr _sdf)
override;
66 public:
virtual void Load(
const std::string &_worldName)
override;
69 public:
virtual void Init()
override;
80 public:
void Update(
bool _force)
override;
87 protected:
virtual bool UpdateImpl(
const bool _force)
override;
90 protected:
virtual void Fini()
override;
93 public:
virtual std::string
Topic()
const override;
185 public:
double Range(
const int _index)
const;
189 public:
void Ranges(std::vector<double> &_ranges)
const;
200 public:
double Retro(
const int _index)
const;
211 public:
int Fiducial(
const unsigned int _index)
const;
264 std::function<
void(
const float *,
unsigned int,
unsigned int,
265 unsigned int,
const std::string &)> _subscriber);
271 private:
void Render();
274 private:
void PrerenderEnded();
278 private: std::unique_ptr<GpuRaySensorPrivate> dataPtr;
sensors
Definition: SensorManager.hh:37
Forward declarations for transport.
GPU based laser sensor.
Definition: GpuRaySensor.hh:51
double Range(const int _index) const
Get detected range for a ray.
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.
virtual bool UpdateImpl(const bool _force) override
This gets overwritten by derived sensor types.
double HorzFOV() const
Get the horizontal field of view of the laser sensor.
double HorzHalfAngle() const
Get (horizontal_max_angle + horizontal_min_angle) * 0.5.
double RangeMax() const
Get the maximum range.
double VerticalAngleResolution() const
Get the vertical angle in radians between each range.
virtual std::string Topic() const override
Returns the topic name as set in SDF.
double VertFOV() const
Get the vertical field-of-view.
GpuRaySensor()
Constructor.
double NextRequiredTimestamp() const override
Return the next timestamp going to be used by the sensor.
int RayCount() const
Get the ray count.
void SetAngleMax(const double _angle)
Set the scan maximum angle.
void Update(bool _force) override
Update the sensor.
double CosHorzFOV() const
Get Cos Horz field-of-view.
ignition::math::Angle AngleMin() const
Get the minimum angle.
int VerticalRangeCount() const
Get the vertical scan line count.
double RangeCountRatio() const
Return the ratio of horizontal range count to vertical range count.
double RangeMin() const
Get the minimum range.
void ResetLastUpdateTime() override
reset timing related members
void SetVerticalAngleMax(const double _angle)
Set the vertical scan line top angle.
void SetActive(bool _value) override
Set whether the sensor is active or not.
double RangeResolution() const
Get the range resolution If RangeResolution is 1, the number of simulated rays is equal to the number...
virtual void Load(const std::string &_worldName, sdf::ElementPtr _sdf) override
Load the sensor with SDF parameters.
int VerticalRayCount() const
Get the vertical scan line count.
double VertHalfAngle() const
Get (vertical_max_angle + vertical_min_angle) * 0.5.
double RayCountRatio() const
Return the ratio of horizontal ray count to vertical ray count.
void Ranges(std::vector< double > &_ranges) const
Get all the ranges.
unsigned int CameraCount() const
Gets the camera count.
rendering::GpuLaserPtr LaserCamera() const
Returns a pointer to the internally kept rendering::GpuLaser.
double AngleResolution() const
Get radians between each range.
virtual bool IsActive() const override
Returns true if sensor generation is active.
double Retro(const int _index) const
Get detected retro (intensity) value for a ray.
ignition::math::Angle VerticalAngleMin() const
Get the vertical scan bottom angle.
void SetAngleMin(const double _angle)
Set the scan minimum angle.
ignition::math::Angle AngleMax() const
Get the maximum angle.
bool NeedsUpdate() override
Return true if the sensor needs to be updated.
virtual void Fini() override
Finalize the ray.
virtual void Load(const std::string &_worldName) override
Load the sensor with default parameters.
int Fiducial(const unsigned int _index) const
Get detected fiducial value for a ray.
void SetVerticalAngleMin(const double _angle)
Set the vertical scan bottom angle.
double CosVertFOV() const
Get Cos Vert field-of-view.
bool IsHorizontal() const
Gets if sensor is horizontal.
int RangeCount() const
Get the range count.
virtual void Init() override
Initialize the ray.
virtual ~GpuRaySensor()
Destructor.
ignition::math::Angle VerticalAngleMax() const
Get the vertical scan line top angle.
Base class for sensors.
Definition: Sensor.hh:53
boost::shared_ptr< Connection > ConnectionPtr
Definition: CommonTypes.hh:134
boost::shared_ptr< GpuLaser > GpuLaserPtr
Definition: RenderTypes.hh:106
Forward declarations for the common classes.
Definition: Animation.hh:27