MIRA
LaserTemplate.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) by
3  * MetraLabs GmbH (MLAB), GERMANY
4  * All rights reserved.
5  *
6  * Redistribution and modification of this code is strictly prohibited.
7  *
8  * IN NO EVENT SHALL "MLAB" BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
9  * SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE
10  * OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF "MLABS" HS BEEN
11  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
12  *
13  * "MLAB" SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT
14  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
15  * A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS ON AN
16  * "AS IS" BASIS, AND "MLAB" HAS NO OBLIGATION TO PROVIDE MAINTENANCE,
17  * SUPPORT, UPDATES, ENHANCEMENTS OR MODIFICATIONS.
18  */
19 
28 #ifndef _MLAB_LASERTEMPLATE_H_
29 #define _MLAB_LASERTEMPLATE_H_
30 
31 #include <serialization/adapters/std/vector>
32 #include <fw/Framework.h>
33 
34 #include <localization/Curve.h>
35 
36 namespace mira {
37 namespace localization {
38 
40 
41 class CurveTemplate : public mira::Object {
43 public:
45  CurveTemplate(const Curve& _c, const Pose2& _p) : c(_c), p(_p) {}
46 
47  template<typename Reflector>
48  void reflect(Reflector& r)
49  {
50  r.member("Curve", c, "");
51  r.member("Pose", p, "");
52  }
53 
54  Curve c; // the template as seen by the laser when the
55  // robot is located at p
56 
57  Pose2 p; // the template position in world coords
58 };
59 
61 
62 typedef std::vector<CurveTemplate> CurveTemplates;
63 
65 
66 class LaserTemplate : public mira::Object {
67  MIRA_OBJECT(LaserTemplate);
68 public:
70 
71  template<typename Reflector>
72  void reflect(Reflector& r)
73  {
74  r.member("MinPhi", laserMinPhi, "Minimum viewing angle of the attached range scanner");
75  r.member("MaxPhi", laserMaxPhi, "Maximum viewing angle of the attached range scanner");
76  r.member("Laser", laserName, "Name of the attache range scan channel");
77  }
78 
80  Curve scan; // the current laser scan
81 
84  std::string laserName;
85  std::string laserFrame;
87  boost::optional<Pose3> laserBase;
88 };
89 
91 
92 }}
93 
94 #endif
Definition: LaserTemplate.h:41
CurveTemplate()
Definition: LaserTemplate.h:44
SignedAnglef laserMaxPhi
Definition: LaserTemplate.h:83
void reflect(Reflector &r)
Definition: LaserTemplate.h:72
Curve scan
Definition: LaserTemplate.h:80
std::vector< CurveTemplate > CurveTemplates
Definition: LaserTemplate.h:62
Curve c
Definition: LaserTemplate.h:54
SignedAnglef laserMinPhi
Definition: LaserTemplate.h:82
Definition: LaserTemplate.h:66
std::string laserName
Definition: LaserTemplate.h:84
Definition: Curve.h:40
LaserTemplate()
Definition: LaserTemplate.h:69
#define MIRA_OBJECT(classIdentifier)
Time laserTime
Definition: LaserTemplate.h:86
Pose2 p
Definition: LaserTemplate.h:57
CurveTemplate(const Curve &_c, const Pose2 &_p)
Definition: LaserTemplate.h:45
void reflect(Reflector &r)
Definition: LaserTemplate.h:48
std::string laserFrame
Definition: LaserTemplate.h:85
boost::optional< Pose3 > laserBase
Definition: LaserTemplate.h:87
CurveTemplates templates
Definition: LaserTemplate.h:79