YARP
Yet Another Robot Platform
GetMapReply.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2020 Istituto Italiano di Tecnologia (IIT)
3  * All rights reserved.
4  *
5  * This software may be modified and distributed under the terms of the
6  * BSD-3-Clause license. See the accompanying LICENSE file for details.
7  */
8 
9 // This is an automatically generated file.
10 
11 // Generated from the following "nav_msgs/GetMapReply" msg definition:
12 // Instances of this class can be read and written with YARP ports,
13 // using a ROS-compatible format.
14 
15 #ifndef YARP_ROSMSG_nav_msgs_GetMapReply_h
16 #define YARP_ROSMSG_nav_msgs_GetMapReply_h
17 
18 #include <yarp/os/Wire.h>
19 #include <yarp/os/Type.h>
20 #include <yarp/os/idl/WireTypes.h>
21 #include <string>
22 #include <vector>
24 
25 namespace yarp {
26 namespace rosmsg {
27 namespace nav_msgs {
28 
30 {
31 public:
33 
35  map()
36  {
37  }
38 
39  void clear()
40  {
41  // *** map ***
42  map.clear();
43  }
44 
45  bool readBare(yarp::os::ConnectionReader& connection) override
46  {
47  // *** map ***
48  if (!map.read(connection)) {
49  return false;
50  }
51 
52  return !connection.isError();
53  }
54 
55  bool readBottle(yarp::os::ConnectionReader& connection) override
56  {
57  connection.convertTextMode();
58  yarp::os::idl::WireReader reader(connection);
59  if (!reader.readListHeader(1)) {
60  return false;
61  }
62 
63  // *** map ***
64  if (!map.read(connection)) {
65  return false;
66  }
67 
68  return !connection.isError();
69  }
70 
72  bool read(yarp::os::ConnectionReader& connection) override
73  {
74  return (connection.isBareMode() ? readBare(connection)
75  : readBottle(connection));
76  }
77 
78  bool writeBare(yarp::os::ConnectionWriter& connection) const override
79  {
80  // *** map ***
81  if (!map.write(connection)) {
82  return false;
83  }
84 
85  return !connection.isError();
86  }
87 
88  bool writeBottle(yarp::os::ConnectionWriter& connection) const override
89  {
90  connection.appendInt32(BOTTLE_TAG_LIST);
91  connection.appendInt32(1);
92 
93  // *** map ***
94  if (!map.write(connection)) {
95  return false;
96  }
97 
98  connection.convertTextMode();
99  return !connection.isError();
100  }
101 
103  bool write(yarp::os::ConnectionWriter& connection) const override
104  {
105  return (connection.isBareMode() ? writeBare(connection)
106  : writeBottle(connection));
107  }
108 
109  // This class will serialize ROS style or YARP style depending on protocol.
110  // If you need to force a serialization style, use one of these classes:
113 
114  // The name for this message, ROS will need this
115  static constexpr const char* typeName = "nav_msgs/GetMapReply";
116 
117  // The checksum for this message, ROS will need this
118  static constexpr const char* typeChecksum = "6cdd0a18e0aff5b0a3ca2326a89b54ff";
119 
120  // The source text for this message, ROS will need this
121  static constexpr const char* typeText = "\
122 \n\
123 ================================================================================\n\
124 MSG: nav_msgs/OccupancyGrid\n\
125 # This represents a 2-D grid map, in which each cell represents the probability of\n\
126 # occupancy.\n\
127 \n\
128 Header header \n\
129 \n\
130 #MetaData for the map\n\
131 MapMetaData info\n\
132 \n\
133 # The map data, in row-major order, starting with (0,0). Occupancy\n\
134 # probabilities are in the range [0,100]. Unknown is -1.\n\
135 int8[] data\n\
136 \n\
137 ================================================================================\n\
138 MSG: std_msgs/Header\n\
139 # Standard metadata for higher-level stamped data types.\n\
140 # This is generally used to communicate timestamped data \n\
141 # in a particular coordinate frame.\n\
142 # \n\
143 # sequence ID: consecutively increasing ID \n\
144 uint32 seq\n\
145 #Two-integer timestamp that is expressed as:\n\
146 # * stamp.sec: seconds (stamp_secs) since epoch (in Python the variable is called 'secs')\n\
147 # * stamp.nsec: nanoseconds since stamp_secs (in Python the variable is called 'nsecs')\n\
148 # time-handling sugar is provided by the client library\n\
149 time stamp\n\
150 #Frame this data is associated with\n\
151 # 0: no frame\n\
152 # 1: global frame\n\
153 string frame_id\n\
154 \n\
155 ================================================================================\n\
156 MSG: nav_msgs/MapMetaData\n\
157 # This hold basic information about the characterists of the OccupancyGrid\n\
158 \n\
159 # The time at which the map was loaded\n\
160 time map_load_time\n\
161 # The map resolution [m/cell]\n\
162 float32 resolution\n\
163 # Map width [cells]\n\
164 uint32 width\n\
165 # Map height [cells]\n\
166 uint32 height\n\
167 # The origin of the map [m, m, rad]. This is the real-world pose of the\n\
168 # cell (0,0) in the map.\n\
169 geometry_msgs/Pose origin\n\
170 ================================================================================\n\
171 MSG: geometry_msgs/Pose\n\
172 # A representation of pose in free space, composed of position and orientation. \n\
173 Point position\n\
174 Quaternion orientation\n\
175 \n\
176 ================================================================================\n\
177 MSG: geometry_msgs/Point\n\
178 # This contains the position of a point in free space\n\
179 float64 x\n\
180 float64 y\n\
181 float64 z\n\
182 \n\
183 ================================================================================\n\
184 MSG: geometry_msgs/Quaternion\n\
185 # This represents an orientation in free space in quaternion form.\n\
186 \n\
187 float64 x\n\
188 float64 y\n\
189 float64 z\n\
190 float64 w\n\
191 ";
192 
193  yarp::os::Type getType() const override
194  {
196  typ.addProperty("md5sum", yarp::os::Value(typeChecksum));
197  typ.addProperty("message_definition", yarp::os::Value(typeText));
198  return typ;
199  }
200 };
201 
202 } // namespace nav_msgs
203 } // namespace rosmsg
204 } // namespace yarp
205 
206 #endif // YARP_ROSMSG_nav_msgs_GetMapReply_h
yarp::rosmsg::nav_msgs::GetMapReply::map
yarp::rosmsg::nav_msgs::OccupancyGrid map
Definition: GetMapReply.h:32
yarp::rosmsg::nav_msgs::OccupancyGrid::clear
void clear()
Definition: OccupancyGrid.h:55
WireTypes.h
BOTTLE_TAG_LIST
#define BOTTLE_TAG_LIST
Definition: Bottle.h:30
yarp::os::idl::BottleStyle
Definition: BottleStyle.h:22
yarp::os::Type
Definition: Type.h:24
yarp::os::idl::WirePortable::read
virtual bool read(yarp::os::idl::WireReader &reader)
Definition: WirePortable.cpp:14
yarp::os::ConnectionReader::isBareMode
virtual bool isBareMode() const =0
Check if the connection is bare mode.
Wire.h
yarp::rosmsg::nav_msgs::GetMapReply::writeBare
bool writeBare(yarp::os::ConnectionWriter &connection) const override
Definition: GetMapReply.h:78
yarp::rosmsg::nav_msgs::GetMapReply::typeName
static constexpr const char * typeName
Definition: GetMapReply.h:115
yarp::rosmsg::nav_msgs::GetMapReply
Definition: GetMapReply.h:30
yarp::rosmsg::nav_msgs::OccupancyGrid::write
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
Definition: OccupancyGrid.h:175
yarp::rosmsg::nav_msgs::GetMapReply::rosStyle
yarp::os::idl::BareStyle< yarp::rosmsg::nav_msgs::GetMapReply > rosStyle
Definition: GetMapReply.h:111
yarp::rosmsg::nav_msgs::GetMapReply::typeText
static constexpr const char * typeText
Definition: GetMapReply.h:121
yarp::rosmsg::nav_msgs::GetMapReply::readBottle
bool readBottle(yarp::os::ConnectionReader &connection) override
Definition: GetMapReply.h:55
yarp::os::ConnectionWriter::isError
virtual bool isError() const =0
yarp::os::Type::byName
static Type byName(const char *name)
Definition: Type.cpp:174
yarp::os::Type::addProperty
Type & addProperty(const char *key, const Value &val)
Definition: Type.cpp:137
Type.h
yarp::os::ConnectionWriter
An interface for writing to a network connection.
Definition: ConnectionWriter.h:40
OccupancyGrid.h
yarp::os::ConnectionReader::isError
virtual bool isError() const =0
yarp::rosmsg::nav_msgs::GetMapReply::write
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
Definition: GetMapReply.h:103
yarp::os::ConnectionReader::convertTextMode
virtual bool convertTextMode()=0
Reads in a standard description in text mode, and converts it to a standard description in binary.
yarp::rosmsg::nav_msgs::GetMapReply::getType
yarp::os::Type getType() const override
Definition: GetMapReply.h:193
yarp::os::idl::WirePortable
A "tamed" Portable, that promises to serialize itself in an IDL-friendly way.
Definition: WirePortable.h:26
yarp::rosmsg::nav_msgs::GetMapReply::read
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
Definition: GetMapReply.h:72
yarp::os::ConnectionWriter::isBareMode
virtual bool isBareMode() const =0
Check if the connection is bare mode.
yarp::rosmsg::nav_msgs::GetMapReply::clear
void clear()
Definition: GetMapReply.h:39
yarp::os::ConnectionWriter::convertTextMode
virtual bool convertTextMode()=0
Converts a standard description in binary into a textual description, if the connection is in text-mo...
yarp::os::ConnectionWriter::appendInt32
virtual void appendInt32(std::int32_t data)=0
Send a representation of a 32-bit integer to the network connection.
nav_msgs
Definition: GetMap.h:22
yarp::os::idl::WireReader
IDL-friendly connection reader.
Definition: WireReader.h:33
yarp::rosmsg::nav_msgs::GetMapReply::GetMapReply
GetMapReply()
Definition: GetMapReply.h:34
yarp::os::ConnectionReader
An interface for reading from a network connection.
Definition: ConnectionReader.h:40
yarp::os::idl::BareStyle
Definition: BareStyle.h:22
yarp::rosmsg::nav_msgs::GetMapReply::readBare
bool readBare(yarp::os::ConnectionReader &connection) override
Definition: GetMapReply.h:45
yarp::rosmsg::nav_msgs::OccupancyGrid
Definition: OccupancyGrid.h:42
yarp::rosmsg::nav_msgs::GetMapReply::writeBottle
bool writeBottle(yarp::os::ConnectionWriter &connection) const override
Definition: GetMapReply.h:88
yarp
The main, catch-all namespace for YARP.
Definition: environment.h:18
yarp::rosmsg::nav_msgs::GetMapReply::bottleStyle
yarp::os::idl::BottleStyle< yarp::rosmsg::nav_msgs::GetMapReply > bottleStyle
Definition: GetMapReply.h:112
yarp::rosmsg::nav_msgs::OccupancyGrid::read
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
Definition: OccupancyGrid.h:121
yarp::os::Value
A single value (typically within a Bottle).
Definition: Value.h:47
yarp::rosmsg::nav_msgs::GetMapReply::typeChecksum
static constexpr const char * typeChecksum
Definition: GetMapReply.h:118
yarp::os::idl::WireReader::readListHeader
bool readListHeader()
Definition: WireReader.cpp:470
yarp::os::idl::WirePortable::write
virtual bool write(const yarp::os::idl::WireWriter &writer) const
Definition: WirePortable.cpp:20