##

SonarSensor.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_SONARSENSOR_HH_
#define _GAZEBO_SENSORS_SONARSENSOR_HH_
#include <memory>
#include <string>
#include "gazebo/sensors/Sensor.hh"
#include "gazebo/util/system.hh"
namespace gazebo
{
namespace sensors
{
// Forward declare private data class.
class SonarSensorPrivate;
class GZ_SENSORS_VISIBLE SonarSensor: public Sensor
{
public: SonarSensor();
public: virtual ~SonarSensor();
// Documentation inherited
public: virtual void Load(const std::string &_worldName);
// Documentation inherited
public: virtual void Init();
// Documentation inherited
public: virtual std::string Topic() const;
public: double RangeMin() const;
public: double RangeMax() const;
public: double Radius() const;
public: double Range();
// Documentation inherited
public: virtual bool IsActive() const;
public: event::ConnectionPtr ConnectUpdate(
std::function<void (msgs::SonarStamped)> _subscriber);
// Documentation inherited
protected: virtual bool UpdateImpl(const bool _force);
// Documentation inherited
protected: virtual void Fini();
private: void OnContacts(ConstContactsPtr &_msg);
private: std::unique_ptr<SonarSensorPrivate> dataPtr;
};
}
}
#endif
gazebo
Forward declarations for the common classes.
Definition: Animation.hh:26
sensors
sensors
Definition: SensorManager.hh:35
gazebo::sensors::SonarSensor::UpdateImpl
virtual bool UpdateImpl(const bool _force)
This gets overwritten by derived sensor types.
system.hh
gazebo::sensors::SonarSensor::SonarSensor
SonarSensor()
Constructor.
gazebo::sensors::SonarSensor::Fini
virtual void Fini()
Finalize the sensor.
gazebo::sensors::SonarSensor::ConnectUpdate
event::ConnectionPtr ConnectUpdate(std::function< void(msgs::SonarStamped)> _subscriber)
Connect a to the new update signal.
Sensor.hh
gazebo::sensors::SonarSensor::Range
double Range()
Get detected range for a sonar.
gazebo::sensors::SonarSensor::RangeMin
double RangeMin() const
Get the minimum range of the sonar.
gazebo::event::ConnectionPtr
boost::shared_ptr< Connection > ConnectionPtr
Definition: CommonTypes.hh:134
gazebo::sensors::SonarSensor::Topic
virtual std::string Topic() const
Returns the topic name as set in SDF.
gazebo::msgs::Init
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
gazebo::sensors::SonarSensor::Load
virtual void Load(const std::string &_worldName)
Load the sensor with default parameters.
gazebo::sensors::SonarSensor::IsActive
virtual bool IsActive() const
Returns true if sensor generation is active.
gazebo::sensors::Sensor
Base class for sensors.
Definition: Sensor.hh:51
gazebo::sensors::SonarSensor::Radius
double Radius() const
Get the radius of the sonar cone at maximum range.
gazebo::sensors::SonarSensor::Init
virtual void Init()
Initialize the sensor.
gazebo::sensors::SonarSensor
Sensor with sonar cone.
Definition: SonarSensor.hh:42
gazebo::sensors::SonarSensor::~SonarSensor
virtual ~SonarSensor()
Destructor.
gazebo::sensors::SonarSensor::RangeMax
double RangeMax() const
Get the minimum range of the sonar.