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