All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RFIDSensor.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012-2014 Open Source Robotics Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16 */
17 /* Desc: Gazebo RFID Sensor
18  * Author: Jonas Mellin & Zakiruz Zaman
19  * Date: 6th December 2011
20  */
21 
22 #ifndef _RFIDSENSOR_HH_
23 #define _RFIDSENSOR_HH_
24 
25 #include <vector>
26 #include <string>
27 
29 
31 
32 #include "gazebo/math/Pose.hh"
33 
34 #include "gazebo/sensors/Sensor.hh"
35 
36 namespace gazebo
37 {
40  namespace sensors
41  {
42  class RFIDTag;
43 
46 
49  class RFIDSensor: public Sensor
50  {
52  public: RFIDSensor();
53 
55  public: virtual ~RFIDSensor();
56 
57  // Documentation inherited
58  public: virtual void Load(const std::string &_worldName,
59  sdf::ElementPtr _sdf);
60 
61  // Documentation inherited
62  public: virtual void Load(const std::string &_worldName);
63 
64  // Documentation inherited
65  public: virtual void Init();
66 
67  // Documentation inherited
68  public: void AddTag(RFIDTag *_tag);
69 
70  protected: virtual void UpdateImpl(bool _force);
71 
72  // Documentation inherited
73  public: virtual void Fini();
74 
77  private: void EvaluateTags();
78 
82  private: bool CheckTagRange(const math::Pose &_pose);
83 
87  // private: bool CheckRayIntersection(const math::Pose &_pose);
88 
90  private: physics::EntityPtr entity;
91 
93  // private: physics::CollisionPtr laserCollision;
94 
96  // private: physics::RayShapePtr laserShape;
97 
99  private: transport::PublisherPtr scanPub;
100 
102  private: std::vector<RFIDTag*> tags;
103  };
105  }
106 }
107 #endif