YARP
Yet Another Robot Platform
GetPlanReply.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/GetPlanReply" 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_GetPlanReply_h
16 #define YARP_ROSMSG_nav_msgs_GetPlanReply_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  plan()
36  {
37  }
38 
39  void clear()
40  {
41  // *** plan ***
42  plan.clear();
43  }
44 
45  bool readBare(yarp::os::ConnectionReader& connection) override
46  {
47  // *** plan ***
48  if (!plan.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  // *** plan ***
64  if (!plan.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  // *** plan ***
81  if (!plan.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  // *** plan ***
94  if (!plan.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/GetPlanReply";
116 
117  // The checksum for this message, ROS will need this
118  static constexpr const char* typeChecksum = "0002bc113c0259d71f6cf8cbc9430e18";
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/Path\n\
125 #An array of poses that represents a Path for a robot to follow\n\
126 Header header\n\
127 geometry_msgs/PoseStamped[] poses\n\
128 \n\
129 ================================================================================\n\
130 MSG: std_msgs/Header\n\
131 # Standard metadata for higher-level stamped data types.\n\
132 # This is generally used to communicate timestamped data \n\
133 # in a particular coordinate frame.\n\
134 # \n\
135 # sequence ID: consecutively increasing ID \n\
136 uint32 seq\n\
137 #Two-integer timestamp that is expressed as:\n\
138 # * stamp.sec: seconds (stamp_secs) since epoch (in Python the variable is called 'secs')\n\
139 # * stamp.nsec: nanoseconds since stamp_secs (in Python the variable is called 'nsecs')\n\
140 # time-handling sugar is provided by the client library\n\
141 time stamp\n\
142 #Frame this data is associated with\n\
143 # 0: no frame\n\
144 # 1: global frame\n\
145 string frame_id\n\
146 \n\
147 ================================================================================\n\
148 MSG: geometry_msgs/PoseStamped\n\
149 # A Pose with reference coordinate frame and timestamp\n\
150 Header header\n\
151 Pose pose\n\
152 \n\
153 ================================================================================\n\
154 MSG: geometry_msgs/Pose\n\
155 # A representation of pose in free space, composed of position and orientation. \n\
156 Point position\n\
157 Quaternion orientation\n\
158 \n\
159 ================================================================================\n\
160 MSG: geometry_msgs/Point\n\
161 # This contains the position of a point in free space\n\
162 float64 x\n\
163 float64 y\n\
164 float64 z\n\
165 \n\
166 ================================================================================\n\
167 MSG: geometry_msgs/Quaternion\n\
168 # This represents an orientation in free space in quaternion form.\n\
169 \n\
170 float64 x\n\
171 float64 y\n\
172 float64 z\n\
173 float64 w\n\
174 ";
175 
176  yarp::os::Type getType() const override
177  {
179  typ.addProperty("md5sum", yarp::os::Value(typeChecksum));
180  typ.addProperty("message_definition", yarp::os::Value(typeText));
181  return typ;
182  }
183 };
184 
185 } // namespace nav_msgs
186 } // namespace rosmsg
187 } // namespace yarp
188 
189 #endif // YARP_ROSMSG_nav_msgs_GetPlanReply_h
yarp::rosmsg::nav_msgs::GetPlanReply::clear
void clear()
Definition: GetPlanReply.h:39
yarp::rosmsg::nav_msgs::GetPlanReply::readBare
bool readBare(yarp::os::ConnectionReader &connection) override
Definition: GetPlanReply.h:45
WireTypes.h
BOTTLE_TAG_LIST
#define BOTTLE_TAG_LIST
Definition: Bottle.h:30
yarp::rosmsg::nav_msgs::Path
Definition: Path.h:34
yarp::os::idl::BottleStyle
Definition: BottleStyle.h:22
yarp::os::Type
Definition: Type.h:24
yarp::rosmsg::nav_msgs::GetPlanReply::typeName
static constexpr const char * typeName
Definition: GetPlanReply.h:115
yarp::rosmsg::nav_msgs::Path::read
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
Definition: Path.h:102
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::GetPlanReply::rosStyle
yarp::os::idl::BareStyle< yarp::rosmsg::nav_msgs::GetPlanReply > rosStyle
Definition: GetPlanReply.h:111
yarp::rosmsg::nav_msgs::GetPlanReply
Definition: GetPlanReply.h:30
yarp::rosmsg::nav_msgs::GetPlanReply::read
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
Definition: GetPlanReply.h:72
yarp::rosmsg::nav_msgs::GetPlanReply::writeBottle
bool writeBottle(yarp::os::ConnectionWriter &connection) const override
Definition: GetPlanReply.h:88
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
yarp::rosmsg::nav_msgs::GetPlanReply::typeChecksum
static constexpr const char * typeChecksum
Definition: GetPlanReply.h:118
Type.h
yarp::os::ConnectionWriter
An interface for writing to a network connection.
Definition: ConnectionWriter.h:40
yarp::rosmsg::nav_msgs::Path::clear
void clear()
Definition: Path.h:45
yarp::os::ConnectionReader::isError
virtual bool isError() const =0
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::GetPlanReply::GetPlanReply
GetPlanReply()
Definition: GetPlanReply.h:34
yarp::os::idl::WirePortable
A "tamed" Portable, that promises to serialize itself in an IDL-friendly way.
Definition: WirePortable.h:26
yarp::os::ConnectionWriter::isBareMode
virtual bool isBareMode() const =0
Check if the connection is bare mode.
yarp::rosmsg::nav_msgs::GetPlanReply::getType
yarp::os::Type getType() const override
Definition: GetPlanReply.h:176
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::os::ConnectionReader
An interface for reading from a network connection.
Definition: ConnectionReader.h:40
Path.h
yarp::os::idl::BareStyle
Definition: BareStyle.h:22
yarp::rosmsg::nav_msgs::Path::write
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
Definition: Path.h:150
yarp::rosmsg::nav_msgs::GetPlanReply::bottleStyle
yarp::os::idl::BottleStyle< yarp::rosmsg::nav_msgs::GetPlanReply > bottleStyle
Definition: GetPlanReply.h:112
yarp
The main, catch-all namespace for YARP.
Definition: environment.h:18
yarp::rosmsg::nav_msgs::GetPlanReply::readBottle
bool readBottle(yarp::os::ConnectionReader &connection) override
Definition: GetPlanReply.h:55
yarp::rosmsg::nav_msgs::GetPlanReply::writeBare
bool writeBare(yarp::os::ConnectionWriter &connection) const override
Definition: GetPlanReply.h:78
yarp::rosmsg::nav_msgs::GetPlanReply::plan
yarp::rosmsg::nav_msgs::Path plan
Definition: GetPlanReply.h:32
yarp::os::Value
A single value (typically within a Bottle).
Definition: Value.h:47
yarp::rosmsg::nav_msgs::GetPlanReply::typeText
static constexpr const char * typeText
Definition: GetPlanReply.h:121
yarp::rosmsg::nav_msgs::GetPlanReply::write
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
Definition: GetPlanReply.h:103
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