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