YARP
Yet Another Robot Platform
InteractiveMarkerPose.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 "visualization_msgs/InteractiveMarkerPose" msg definition:
12 // # Time/frame info.
13 // Header header
14 //
15 // # Initial pose. Also, defines the pivot point for rotations.
16 // geometry_msgs/Pose pose
17 //
18 // # Identifying string. Must be globally unique in
19 // # the topic that this message is sent through.
20 // string name
21 // Instances of this class can be read and written with YARP ports,
22 // using a ROS-compatible format.
23 
24 #ifndef YARP_ROSMSG_visualization_msgs_InteractiveMarkerPose_h
25 #define YARP_ROSMSG_visualization_msgs_InteractiveMarkerPose_h
26 
27 #include <yarp/os/Wire.h>
28 #include <yarp/os/Type.h>
29 #include <yarp/os/idl/WireTypes.h>
30 #include <string>
31 #include <vector>
34 
35 namespace yarp {
36 namespace rosmsg {
37 namespace visualization_msgs {
38 
40 {
41 public:
44  std::string name;
45 
47  header(),
48  pose(),
49  name("")
50  {
51  }
52 
53  void clear()
54  {
55  // *** header ***
56  header.clear();
57 
58  // *** pose ***
59  pose.clear();
60 
61  // *** name ***
62  name = "";
63  }
64 
65  bool readBare(yarp::os::ConnectionReader& connection) override
66  {
67  // *** header ***
68  if (!header.read(connection)) {
69  return false;
70  }
71 
72  // *** pose ***
73  if (!pose.read(connection)) {
74  return false;
75  }
76 
77  // *** name ***
78  int len = connection.expectInt32();
79  name.resize(len);
80  if (!connection.expectBlock((char*)name.c_str(), len)) {
81  return false;
82  }
83 
84  return !connection.isError();
85  }
86 
87  bool readBottle(yarp::os::ConnectionReader& connection) override
88  {
89  connection.convertTextMode();
90  yarp::os::idl::WireReader reader(connection);
91  if (!reader.readListHeader(3)) {
92  return false;
93  }
94 
95  // *** header ***
96  if (!header.read(connection)) {
97  return false;
98  }
99 
100  // *** pose ***
101  if (!pose.read(connection)) {
102  return false;
103  }
104 
105  // *** name ***
106  if (!reader.readString(name)) {
107  return false;
108  }
109 
110  return !connection.isError();
111  }
112 
114  bool read(yarp::os::ConnectionReader& connection) override
115  {
116  return (connection.isBareMode() ? readBare(connection)
117  : readBottle(connection));
118  }
119 
120  bool writeBare(yarp::os::ConnectionWriter& connection) const override
121  {
122  // *** header ***
123  if (!header.write(connection)) {
124  return false;
125  }
126 
127  // *** pose ***
128  if (!pose.write(connection)) {
129  return false;
130  }
131 
132  // *** name ***
133  connection.appendInt32(name.length());
134  connection.appendExternalBlock((char*)name.c_str(), name.length());
135 
136  return !connection.isError();
137  }
138 
139  bool writeBottle(yarp::os::ConnectionWriter& connection) const override
140  {
141  connection.appendInt32(BOTTLE_TAG_LIST);
142  connection.appendInt32(3);
143 
144  // *** header ***
145  if (!header.write(connection)) {
146  return false;
147  }
148 
149  // *** pose ***
150  if (!pose.write(connection)) {
151  return false;
152  }
153 
154  // *** name ***
155  connection.appendInt32(BOTTLE_TAG_STRING);
156  connection.appendInt32(name.length());
157  connection.appendExternalBlock((char*)name.c_str(), name.length());
158 
159  connection.convertTextMode();
160  return !connection.isError();
161  }
162 
164  bool write(yarp::os::ConnectionWriter& connection) const override
165  {
166  return (connection.isBareMode() ? writeBare(connection)
167  : writeBottle(connection));
168  }
169 
170  // This class will serialize ROS style or YARP style depending on protocol.
171  // If you need to force a serialization style, use one of these classes:
174 
175  // The name for this message, ROS will need this
176  static constexpr const char* typeName = "visualization_msgs/InteractiveMarkerPose";
177 
178  // The checksum for this message, ROS will need this
179  static constexpr const char* typeChecksum = "a6e6833209a196a38d798dadb02c81f8";
180 
181  // The source text for this message, ROS will need this
182  static constexpr const char* typeText = "\
183 # Time/frame info.\n\
184 Header header\n\
185 \n\
186 # Initial pose. Also, defines the pivot point for rotations.\n\
187 geometry_msgs/Pose pose\n\
188 \n\
189 # Identifying string. Must be globally unique in\n\
190 # the topic that this message is sent through.\n\
191 string name\n\
192 \n\
193 ================================================================================\n\
194 MSG: std_msgs/Header\n\
195 # Standard metadata for higher-level stamped data types.\n\
196 # This is generally used to communicate timestamped data \n\
197 # in a particular coordinate frame.\n\
198 # \n\
199 # sequence ID: consecutively increasing ID \n\
200 uint32 seq\n\
201 #Two-integer timestamp that is expressed as:\n\
202 # * stamp.sec: seconds (stamp_secs) since epoch (in Python the variable is called 'secs')\n\
203 # * stamp.nsec: nanoseconds since stamp_secs (in Python the variable is called 'nsecs')\n\
204 # time-handling sugar is provided by the client library\n\
205 time stamp\n\
206 #Frame this data is associated with\n\
207 # 0: no frame\n\
208 # 1: global frame\n\
209 string frame_id\n\
210 \n\
211 ================================================================================\n\
212 MSG: geometry_msgs/Pose\n\
213 # A representation of pose in free space, composed of position and orientation. \n\
214 Point position\n\
215 Quaternion orientation\n\
216 \n\
217 ================================================================================\n\
218 MSG: geometry_msgs/Point\n\
219 # This contains the position of a point in free space\n\
220 float64 x\n\
221 float64 y\n\
222 float64 z\n\
223 \n\
224 ================================================================================\n\
225 MSG: geometry_msgs/Quaternion\n\
226 # This represents an orientation in free space in quaternion form.\n\
227 \n\
228 float64 x\n\
229 float64 y\n\
230 float64 z\n\
231 float64 w\n\
232 ";
233 
234  yarp::os::Type getType() const override
235  {
237  typ.addProperty("md5sum", yarp::os::Value(typeChecksum));
238  typ.addProperty("message_definition", yarp::os::Value(typeText));
239  return typ;
240  }
241 };
242 
243 } // namespace visualization_msgs
244 } // namespace rosmsg
245 } // namespace yarp
246 
247 #endif // YARP_ROSMSG_visualization_msgs_InteractiveMarkerPose_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::os::idl::WireReader::readString
bool readString(std::string &str, bool *is_vocab=nullptr)
Definition: WireReader.cpp:339
yarp::rosmsg::visualization_msgs::InteractiveMarkerPose::typeText
static constexpr const char * typeText
Definition: InteractiveMarkerPose.h:182
yarp::rosmsg::visualization_msgs::InteractiveMarkerPose::writeBottle
bool writeBottle(yarp::os::ConnectionWriter &connection) const override
Definition: InteractiveMarkerPose.h:139
yarp::rosmsg::visualization_msgs::InteractiveMarkerPose::bottleStyle
yarp::os::idl::BottleStyle< yarp::rosmsg::visualization_msgs::InteractiveMarkerPose > bottleStyle
Definition: InteractiveMarkerPose.h:173
WireTypes.h
yarp::rosmsg::geometry_msgs::Pose
Definition: Pose.h:34
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::Pose::clear
void clear()
Definition: Pose.h:45
yarp::os::ConnectionReader::isBareMode
virtual bool isBareMode() const =0
Check if the connection is bare mode.
yarp::rosmsg::visualization_msgs::InteractiveMarkerPose::InteractiveMarkerPose
InteractiveMarkerPose()
Definition: InteractiveMarkerPose.h:46
yarp::rosmsg::std_msgs::Header::clear
void clear()
Definition: Header.h:58
BOTTLE_TAG_STRING
#define BOTTLE_TAG_STRING
Definition: Bottle.h:28
Wire.h
yarp::rosmsg::visualization_msgs::InteractiveMarkerPose::clear
void clear()
Definition: InteractiveMarkerPose.h:53
yarp::rosmsg::visualization_msgs::InteractiveMarkerPose
Definition: InteractiveMarkerPose.h:40
yarp::rosmsg::visualization_msgs::InteractiveMarkerPose::header
yarp::rosmsg::std_msgs::Header header
Definition: InteractiveMarkerPose.h:42
yarp::rosmsg::visualization_msgs::InteractiveMarkerPose::readBottle
bool readBottle(yarp::os::ConnectionReader &connection) override
Definition: InteractiveMarkerPose.h:87
yarp::rosmsg::visualization_msgs::InteractiveMarkerPose::typeChecksum
static constexpr const char * typeChecksum
Definition: InteractiveMarkerPose.h:179
yarp::rosmsg::visualization_msgs::InteractiveMarkerPose::getType
yarp::os::Type getType() const override
Definition: InteractiveMarkerPose.h:234
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::ConnectionReader::expectInt32
virtual std::int32_t expectInt32()=0
Read a 32-bit integer from the network connection.
yarp::rosmsg::visualization_msgs::InteractiveMarkerPose::writeBare
bool writeBare(yarp::os::ConnectionWriter &connection) const override
Definition: InteractiveMarkerPose.h:120
yarp::os::Type::addProperty
Type & addProperty(const char *key, const Value &val)
Definition: Type.cpp:137
Type.h
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::visualization_msgs::InteractiveMarkerPose::pose
yarp::rosmsg::geometry_msgs::Pose pose
Definition: InteractiveMarkerPose.h:43
yarp::rosmsg::visualization_msgs::InteractiveMarkerPose::name
std::string name
Definition: InteractiveMarkerPose.h:44
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::visualization_msgs::InteractiveMarkerPose::typeName
static constexpr const char * typeName
Definition: InteractiveMarkerPose.h:176
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::visualization_msgs::InteractiveMarkerPose::rosStyle
yarp::os::idl::BareStyle< yarp::rosmsg::visualization_msgs::InteractiveMarkerPose > rosStyle
Definition: InteractiveMarkerPose.h:172
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
Pose.h
yarp::rosmsg::visualization_msgs::InteractiveMarkerPose::readBare
bool readBare(yarp::os::ConnectionReader &connection) override
Definition: InteractiveMarkerPose.h:65
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
visualization_msgs
Definition: ImageMarker.h:22
yarp::os::idl::BareStyle
Definition: BareStyle.h:22
yarp::rosmsg::visualization_msgs::InteractiveMarkerPose::write
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
Definition: InteractiveMarkerPose.h:164
yarp::rosmsg::visualization_msgs::InteractiveMarkerPose::read
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
Definition: InteractiveMarkerPose.h:114
yarp
The main, catch-all namespace for YARP.
Definition: environment.h:18
yarp::rosmsg::geometry_msgs::Pose::read
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
Definition: Pose.h:91
yarp::os::ConnectionWriter::appendExternalBlock
virtual void appendExternalBlock(const char *data, size_t len)=0
Send a block of data to the network connection, without making a copy.
yarp::os::ConnectionReader::expectBlock
virtual bool expectBlock(char *data, size_t len)=0
Read a block of data from the network connection.
yarp::os::Value
A single value (typically within a Bottle).
Definition: Value.h:47
yarp::rosmsg::geometry_msgs::Pose::write
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
Definition: Pose.h:132
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