MIRA
MapAttributes.h
Go to the documentation of this file.
1 /*
2 Copyright (c) 2013,
3  Neuroinformatics and Cognitive Robotics Labs at TU Ilmenau, Germany
4 
5 All rights reserved.
6 
7 Copying, resale, or redistribution, with or without modification, is strictly
8 prohibited.
9 
10 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
11 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
12 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
13 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
14 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES,
15 EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
16 */
17 
26 #pragma once
27 
28 #include <geometry/Rect.h>
29 
30 #include <topomap/Attribute.h>
31 
32 #include <utils/Stamped.h>
33 #include <maps/GridMap.h>
34 
35 namespace viros { namespace topomap {
36 
37 using namespace mira;
39 
40 class MapAttribute : public Attribute
41 {
43 public:
44 
45  MapAttribute() : optional(false), planner(false), localization(false) {}
46  MapAttribute(const std::string& iChannel) :
47  channel(iChannel), optional(false), planner(false), localization(false) {}
48 
50  return boost::make_shared<MapAttribute>();
51  }
52 
53  static MapAttributePtr create(const std::string& iChannel) {
54  return boost::make_shared<MapAttribute>(iChannel);
55  }
56 
57  template<typename Reflector>
58  void reflect(Reflector& r)
59  {
61  r.member("channel",channel,"");
62  r.member("optional",optional,"");
63  r.member("planner",planner,"");
64  r.member("localization",localization,"");
65  }
66 public:
67  std::string channel;
68  bool optional;
69  bool planner;
71 };
72 
73 class RegionAttribute : public Attribute
74 {
76 public:
77 
79  RegionAttribute(const Rect2i& r) : rect(r) {}
80 
81  static RegionAttributePtr create(const Rect2i& r) {
82  return boost::make_shared<RegionAttribute>(r);
83  }
84 
85  template<typename Reflector>
86  void reflect(Reflector& r)
87  {
89  r.member("rect",rect,"");
90  }
91 public:
93 };
94 
96 {
98 public:
99 
101  CostMapAttribute(const Stamped<maps::GridMap<double>>& costmap) : costmap(costmap) {}
102 
103  static CostMapAttributePtr create(const Stamped<maps::GridMap<double>>& costmap) {
104  return boost::make_shared<CostMapAttribute>(costmap);
105  }
106 
107  template<typename Reflector>
108  void reflect(Reflector& r)
109  {
111  r.member("CostMap",costmap,"");
112  }
113 public:
115 };
116 
118 
119 } } // namespace
void reflect(Reflector &r)
Definition: MapAttributes.h:58
void reflect(Reflector &r)
Definition: MapAttributes.h:86
std::string channel
Definition: MapAttributes.h:67
#define MIRA_REFLECT_BASE(reflector, BaseClass)
bool optional
Definition: MapAttributes.h:68
boost::shared_ptr< CostMapAttribute > CostMapAttributePtr
Definition: TopoMapFwd.h:78
void reflect(Reflector &r)
Definition: MapAttributes.h:108
CostMapAttribute()
Definition: MapAttributes.h:100
RegionAttribute(const Rect2i &r)
Definition: MapAttributes.h:79
Definition: Attribute.h:37
Definition: MapAttributes.h:40
static MapAttributePtr create()
Definition: MapAttributes.h:49
static MapAttributePtr create(const std::string &iChannel)
Definition: MapAttributes.h:53
static CostMapAttributePtr create(const Stamped< maps::GridMap< double >> &costmap)
Definition: MapAttributes.h:103
boost::shared_ptr< RegionAttribute > RegionAttributePtr
Definition: TopoMapFwd.h:77
MapAttribute()
Definition: MapAttributes.h:45
Definition: MapAttributes.h:95
Stamped< maps::GridMap< double > > costmap
Definition: MapAttributes.h:114
Rect2i rect
Definition: MapAttributes.h:92
static RegionAttributePtr create(const Rect2i &r)
Definition: MapAttributes.h:81
#define MIRA_OBJECT(classIdentifier)
MapAttribute(const std::string &iChannel)
Definition: MapAttributes.h:46
RegionAttribute()
Definition: MapAttributes.h:78
Definition: MapAttributes.h:73
bool planner
Definition: MapAttributes.h:69
Definition: MetricCostmapTopoMapPlanner.h:45
CostMapAttribute(const Stamped< maps::GridMap< double >> &costmap)
Definition: MapAttributes.h:101
bool localization
Definition: MapAttributes.h:70
boost::shared_ptr< MapAttribute > MapAttributePtr
Definition: TopoMapFwd.h:76