YARP
Yet Another Robot Platform
PoseWithCovarianceStamped.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 "geometry_msgs/PoseWithCovarianceStamped" msg definition:
12 // # This expresses an estimated pose with a reference coordinate frame and timestamp
13 //
14 // Header header
15 // PoseWithCovariance pose
16 // Instances of this class can be read and written with YARP ports,
17 // using a ROS-compatible format.
18 
19 #ifndef YARP_ROSMSG_geometry_msgs_PoseWithCovarianceStamped_h
20 #define YARP_ROSMSG_geometry_msgs_PoseWithCovarianceStamped_h
21 
22 #include <yarp/os/Wire.h>
23 #include <yarp/os/Type.h>
25 #include <string>
26 #include <vector>
29 
30 namespace yarp {
31 namespace rosmsg {
32 namespace geometry_msgs {
33 
35 {
36 public:
39 
41  header(),
42  pose()
43  {
44  }
45 
46  void clear()
47  {
48  // *** header ***
49  header.clear();
50 
51  // *** pose ***
52  pose.clear();
53  }
54 
55  bool readBare(yarp::os::ConnectionReader& connection) override
56  {
57  // *** header ***
58  if (!header.read(connection)) {
59  return false;
60  }
61 
62  // *** pose ***
63  if (!pose.read(connection)) {
64  return false;
65  }
66 
67  return !connection.isError();
68  }
69 
70  bool readBottle(yarp::os::ConnectionReader& connection) override
71  {
72  connection.convertTextMode();
73  yarp::os::idl::WireReader reader(connection);
74  if (!reader.readListHeader(2)) {
75  return false;
76  }
77 
78  // *** header ***
79  if (!header.read(connection)) {
80  return false;
81  }
82 
83  // *** pose ***
84  if (!pose.read(connection)) {
85  return false;
86  }
87 
88  return !connection.isError();
89  }
90 
92  bool read(yarp::os::ConnectionReader& connection) override
93  {
94  return (connection.isBareMode() ? readBare(connection)
95  : readBottle(connection));
96  }
97 
98  bool writeBare(yarp::os::ConnectionWriter& connection) const override
99  {
100  // *** header ***
101  if (!header.write(connection)) {
102  return false;
103  }
104 
105  // *** pose ***
106  if (!pose.write(connection)) {
107  return false;
108  }
109 
110  return !connection.isError();
111  }
112 
113  bool writeBottle(yarp::os::ConnectionWriter& connection) const override
114  {
115  connection.appendInt32(BOTTLE_TAG_LIST);
116  connection.appendInt32(2);
117 
118  // *** header ***
119  if (!header.write(connection)) {
120  return false;
121  }
122 
123  // *** pose ***
124  if (!pose.write(connection)) {
125  return false;
126  }
127 
128  connection.convertTextMode();
129  return !connection.isError();
130  }
131 
133  bool write(yarp::os::ConnectionWriter& connection) const override
134  {
135  return (connection.isBareMode() ? writeBare(connection)
136  : writeBottle(connection));
137  }
138 
139  // This class will serialize ROS style or YARP style depending on protocol.
140  // If you need to force a serialization style, use one of these classes:
143 
144  // The name for this message, ROS will need this
145  static constexpr const char* typeName = "geometry_msgs/PoseWithCovarianceStamped";
146 
147  // The checksum for this message, ROS will need this
148  static constexpr const char* typeChecksum = "953b798c0f514ff060a53a3498ce6246";
149 
150  // The source text for this message, ROS will need this
151  static constexpr const char* typeText = "\
152 # This expresses an estimated pose with a reference coordinate frame and timestamp\n\
153 \n\
154 Header header\n\
155 PoseWithCovariance pose\n\
156 \n\
157 ================================================================================\n\
158 MSG: std_msgs/Header\n\
159 # Standard metadata for higher-level stamped data types.\n\
160 # This is generally used to communicate timestamped data \n\
161 # in a particular coordinate frame.\n\
162 # \n\
163 # sequence ID: consecutively increasing ID \n\
164 uint32 seq\n\
165 #Two-integer timestamp that is expressed as:\n\
166 # * stamp.sec: seconds (stamp_secs) since epoch (in Python the variable is called 'secs')\n\
167 # * stamp.nsec: nanoseconds since stamp_secs (in Python the variable is called 'nsecs')\n\
168 # time-handling sugar is provided by the client library\n\
169 time stamp\n\
170 #Frame this data is associated with\n\
171 # 0: no frame\n\
172 # 1: global frame\n\
173 string frame_id\n\
174 \n\
175 ================================================================================\n\
176 MSG: geometry_msgs/PoseWithCovariance\n\
177 # This represents a pose in free space with uncertainty.\n\
178 \n\
179 Pose pose\n\
180 \n\
181 # Row-major representation of the 6x6 covariance matrix\n\
182 # The orientation parameters use a fixed-axis representation.\n\
183 # In order, the parameters are:\n\
184 # (x, y, z, rotation about X axis, rotation about Y axis, rotation about Z axis)\n\
185 float64[36] covariance\n\
186 \n\
187 ================================================================================\n\
188 MSG: geometry_msgs/Pose\n\
189 # A representation of pose in free space, composed of position and orientation. \n\
190 Point position\n\
191 Quaternion orientation\n\
192 \n\
193 ================================================================================\n\
194 MSG: geometry_msgs/Point\n\
195 # This contains the position of a point in free space\n\
196 float64 x\n\
197 float64 y\n\
198 float64 z\n\
199 \n\
200 ================================================================================\n\
201 MSG: geometry_msgs/Quaternion\n\
202 # This represents an orientation in free space in quaternion form.\n\
203 \n\
204 float64 x\n\
205 float64 y\n\
206 float64 z\n\
207 float64 w\n\
208 ";
209 
210  yarp::os::Type getType() const override
211  {
213  typ.addProperty("md5sum", yarp::os::Value(typeChecksum));
214  typ.addProperty("message_definition", yarp::os::Value(typeText));
215  return typ;
216  }
217 };
218 
219 } // namespace geometry_msgs
220 } // namespace rosmsg
221 } // namespace yarp
222 
223 #endif // YARP_ROSMSG_geometry_msgs_PoseWithCovarianceStamped_h
yarp::rosmsg::std_msgs::Header::read
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
Definition: Header.h:115
yarp::rosmsg::geometry_msgs::PoseWithCovarianceStamped::typeChecksum
static constexpr const char * typeChecksum
Definition: PoseWithCovarianceStamped.h:148
yarp::rosmsg::geometry_msgs::PoseWithCovarianceStamped::read
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
Definition: PoseWithCovarianceStamped.h:92
yarp::rosmsg::geometry_msgs::PoseWithCovarianceStamped::getType
yarp::os::Type getType() const override
Definition: PoseWithCovarianceStamped.h:210
yarp::rosmsg::geometry_msgs::PoseWithCovarianceStamped::typeText
static constexpr const char * typeText
Definition: PoseWithCovarianceStamped.h:151
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
Header.h
yarp::os::ConnectionReader::isBareMode
virtual bool isBareMode() const =0
Check if the connection is bare mode.
yarp::rosmsg::std_msgs::Header::clear
void clear()
Definition: Header.h:58
Wire.h
geometry_msgs
Definition: Accel.h:22
yarp::rosmsg::geometry_msgs::PoseWithCovarianceStamped::bottleStyle
yarp::os::idl::BottleStyle< yarp::rosmsg::geometry_msgs::PoseWithCovarianceStamped > bottleStyle
Definition: PoseWithCovarianceStamped.h:142
yarp::rosmsg::geometry_msgs::PoseWithCovariance::write
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
Definition: PoseWithCovariance.h:148
yarp::rosmsg::geometry_msgs::PoseWithCovarianceStamped::readBottle
bool readBottle(yarp::os::ConnectionReader &connection) override
Definition: PoseWithCovarianceStamped.h:70
yarp::os::ConnectionWriter::isError
virtual bool isError() const =0
yarp::rosmsg::geometry_msgs::PoseWithCovarianceStamped::typeName
static constexpr const char * typeName
Definition: PoseWithCovarianceStamped.h:145
yarp::os::Type::byName
static Type byName(const char *name)
Definition: Type.cpp:174
yarp::rosmsg::geometry_msgs::PoseWithCovarianceStamped::pose
yarp::rosmsg::geometry_msgs::PoseWithCovariance pose
Definition: PoseWithCovarianceStamped.h:38
yarp::rosmsg::geometry_msgs::PoseWithCovarianceStamped
Definition: PoseWithCovarianceStamped.h:35
yarp::os::Type::addProperty
Type & addProperty(const char *key, const Value &val)
Definition: Type.cpp:137
Type.h
yarp::rosmsg::geometry_msgs::PoseWithCovariance::read
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
Definition: PoseWithCovariance.h:105
yarp::os::ConnectionWriter
An interface for writing to a network connection.
Definition: ConnectionWriter.h:40
yarp::rosmsg::geometry_msgs::PoseWithCovarianceStamped::header
yarp::rosmsg::std_msgs::Header header
Definition: PoseWithCovarianceStamped.h:37
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::geometry_msgs::PoseWithCovarianceStamped::readBare
bool readBare(yarp::os::ConnectionReader &connection) override
Definition: PoseWithCovarianceStamped.h:55
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::std_msgs::Header::write
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
Definition: Header.h:162
yarp::rosmsg::geometry_msgs::PoseWithCovarianceStamped::writeBottle
bool writeBottle(yarp::os::ConnectionWriter &connection) const override
Definition: PoseWithCovarianceStamped.h:113
yarp::rosmsg::geometry_msgs::PoseWithCovarianceStamped::rosStyle
yarp::os::idl::BareStyle< yarp::rosmsg::geometry_msgs::PoseWithCovarianceStamped > rosStyle
Definition: PoseWithCovarianceStamped.h:141
yarp::rosmsg::geometry_msgs::PoseWithCovarianceStamped::write
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
Definition: PoseWithCovarianceStamped.h:133
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.
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
yarp::os::idl::BareStyle
Definition: BareStyle.h:22
yarp::rosmsg::geometry_msgs::PoseWithCovarianceStamped::writeBare
bool writeBare(yarp::os::ConnectionWriter &connection) const override
Definition: PoseWithCovarianceStamped.h:98
yarp::rosmsg::geometry_msgs::PoseWithCovariance
Definition: PoseWithCovariance.h:39
yarp
The main, catch-all namespace for YARP.
Definition: environment.h:18
yarp::rosmsg::geometry_msgs::PoseWithCovarianceStamped::PoseWithCovarianceStamped
PoseWithCovarianceStamped()
Definition: PoseWithCovarianceStamped.h:40
yarp::rosmsg::geometry_msgs::PoseWithCovariance::clear
void clear()
Definition: PoseWithCovariance.h:51
yarp::os::Value
A single value (typically within a Bottle).
Definition: Value.h:47
PoseWithCovariance.h
yarp::rosmsg::std_msgs::Header
Definition: Header.h:45
yarp::rosmsg::geometry_msgs::PoseWithCovarianceStamped::clear
void clear()
Definition: PoseWithCovarianceStamped.h:46
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