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