YARP
Yet Another Robot Platform
GetPlanReply.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/GetPlanReply" 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_GetPlanReply_h
13#define YARP_ROSMSG_nav_msgs_GetPlanReply_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 plan()
33 {
34 }
35
36 void clear()
37 {
38 // *** plan ***
39 plan.clear();
40 }
41
42 bool readBare(yarp::os::ConnectionReader& connection) override
43 {
44 // *** plan ***
45 if (!plan.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 // *** plan ***
61 if (!plan.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 // *** plan ***
78 if (!plan.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 // *** plan ***
91 if (!plan.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/GetPlanReply";
113
114 // The checksum for this message, ROS will need this
115 static constexpr const char* typeChecksum = "0002bc113c0259d71f6cf8cbc9430e18";
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/Path\n\
122#An array of poses that represents a Path for a robot to follow\n\
123Header header\n\
124geometry_msgs/PoseStamped[] poses\n\
125\n\
126================================================================================\n\
127MSG: std_msgs/Header\n\
128# Standard metadata for higher-level stamped data types.\n\
129# This is generally used to communicate timestamped data \n\
130# in a particular coordinate frame.\n\
131# \n\
132# sequence ID: consecutively increasing ID \n\
133uint32 seq\n\
134#Two-integer timestamp that is expressed as:\n\
135# * stamp.sec: seconds (stamp_secs) since epoch (in Python the variable is called 'secs')\n\
136# * stamp.nsec: nanoseconds since stamp_secs (in Python the variable is called 'nsecs')\n\
137# time-handling sugar is provided by the client library\n\
138time stamp\n\
139#Frame this data is associated with\n\
140# 0: no frame\n\
141# 1: global frame\n\
142string frame_id\n\
143\n\
144================================================================================\n\
145MSG: geometry_msgs/PoseStamped\n\
146# A Pose with reference coordinate frame and timestamp\n\
147Header header\n\
148Pose pose\n\
149\n\
150================================================================================\n\
151MSG: geometry_msgs/Pose\n\
152# A representation of pose in free space, composed of position and orientation. \n\
153Point position\n\
154Quaternion orientation\n\
155\n\
156================================================================================\n\
157MSG: geometry_msgs/Point\n\
158# This contains the position of a point in free space\n\
159float64 x\n\
160float64 y\n\
161float64 z\n\
162\n\
163================================================================================\n\
164MSG: geometry_msgs/Quaternion\n\
165# This represents an orientation in free space in quaternion form.\n\
166\n\
167float64 x\n\
168float64 y\n\
169float64 z\n\
170float64 w\n\
171";
172
173 yarp::os::Type getType() const override
174 {
177 typ.addProperty("message_definition", yarp::os::Value(typeText));
178 return typ;
179 }
180};
181
182} // namespace nav_msgs
183} // namespace rosmsg
184} // namespace yarp
185
186#endif // YARP_ROSMSG_nav_msgs_GetPlanReply_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 write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
Definition: GetPlanReply.h:100
bool writeBare(yarp::os::ConnectionWriter &connection) const override
Definition: GetPlanReply.h:75
yarp::os::idl::BottleStyle< yarp::rosmsg::nav_msgs::GetPlanReply > bottleStyle
Definition: GetPlanReply.h:109
bool readBare(yarp::os::ConnectionReader &connection) override
Definition: GetPlanReply.h:42
static constexpr const char * typeText
Definition: GetPlanReply.h:118
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
Definition: GetPlanReply.h:69
static constexpr const char * typeChecksum
Definition: GetPlanReply.h:115
static constexpr const char * typeName
Definition: GetPlanReply.h:112
bool readBottle(yarp::os::ConnectionReader &connection) override
Definition: GetPlanReply.h:52
yarp::rosmsg::nav_msgs::Path plan
Definition: GetPlanReply.h:29
yarp::os::Type getType() const override
Definition: GetPlanReply.h:173
bool writeBottle(yarp::os::ConnectionWriter &connection) const override
Definition: GetPlanReply.h:85
yarp::os::idl::BareStyle< yarp::rosmsg::nav_msgs::GetPlanReply > rosStyle
Definition: GetPlanReply.h:108
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
Definition: Path.h:99
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
Definition: Path.h:147
The main, catch-all namespace for YARP.
Definition: dirs.h:16