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 #include "gazebo/util/system.hh"
36 
37 namespace gazebo
38 {
41  namespace sensors
42  {
43  class RFIDTag;
44 
47 
51  {
53  public: RFIDSensor();
54 
56  public: virtual ~RFIDSensor();
57 
58  // Documentation inherited
59  public: virtual void Load(const std::string &_worldName,
60  sdf::ElementPtr _sdf);
61 
62  // Documentation inherited
63  public: virtual void Load(const std::string &_worldName);
64 
65  // Documentation inherited
66  public: virtual void Init();
67 
68  // Documentation inherited
69  public: void AddTag(RFIDTag *_tag);
70 
71  // Documentation inherited.
72  protected: virtual bool UpdateImpl(bool _force);
73 
74  // Documentation inherited
75  public: virtual void Fini();
76 
79  private: void EvaluateTags();
80 
84  private: bool CheckTagRange(const math::Pose &_pose);
85 
89  // private: bool CheckRayIntersection(const math::Pose &_pose);
90 
92  private: physics::EntityPtr entity;
93 
95  // private: physics::CollisionPtr laserCollision;
96 
98  // private: physics::RayShapePtr laserShape;
99 
101  private: transport::PublisherPtr scanPub;
102 
104  private: std::vector<RFIDTag*> tags;
105  };
107  }
108 }
109 #endif