17 #ifndef _GAZEBO_SONARSENSOR_HH_
18 #define _GAZEBO_SONARSENSOR_HH_
22 #include <ignition/math/Pose3.hh>
50 public:
virtual void Load(
const std::string &_worldName);
53 public:
virtual void Init();
56 protected:
virtual bool UpdateImpl(
bool _force);
59 protected:
virtual void Fini();
62 public:
virtual std::string GetTopic()
const;
66 public:
double GetRangeMin()
const;
70 public:
double GetRangeMax()
const;
74 public:
double GetRadius()
const;
84 public:
double GetRange();
87 public:
virtual bool IsActive();
92 public:
template<
typename T>
94 {
return update.Connect(_subscriber);}
99 {update.Disconnect(_conn);}
102 private:
void OnContacts(ConstContactsPtr &_msg);
120 private: msgs::SonarStamped sonarMsg;
123 private: boost::mutex mutex;
126 typedef std::list<boost::shared_ptr<msgs::Contacts const> > ContactMsgs_L;
129 private: ContactMsgs_L incomingContacts;
132 private: ignition::math::Pose3d sonarMidPose;
135 private:
double rangeMin;
138 private:
double rangeMax;
141 private:
double radius;
boost::shared_ptr< Connection > ConnectionPtr
Definition: CommonTypes.hh:147
Sensor with sonar cone.
Definition: SonarSensor.hh:41
void DisconnectUpdate(event::ConnectionPtr &_conn)
Disconnect from the update signal.
Definition: SonarSensor.hh:98
boost::shared_ptr< Subscriber > SubscriberPtr
Definition: TransportTypes.hh:53
Forward declarations for transport.
event::EventT< void(msgs::SonarStamped)> update
Update event.
Definition: SonarSensor.hh:144
boost::shared_ptr< Collision > CollisionPtr
Definition: PhysicsTypes.hh:96
boost::shared_ptr< Entity > EntityPtr
Definition: PhysicsTypes.hh:76
GAZEBO_VISIBLE void Init(google::protobuf::Message &_message, const std::string &_id="")
Initialize a message.
boost::shared_ptr< MeshShape > MeshShapePtr
Definition: PhysicsTypes.hh:160
boost::shared_ptr< Publisher > PublisherPtr
Definition: TransportTypes.hh:49
Base class for sensors.
Definition: Sensor.hh:69
#define GAZEBO_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system.hh:66
event::ConnectionPtr ConnectUpdate(T _subscriber)
Connect a to the new update signal.
Definition: SonarSensor.hh:93