|
YARP
Yet Another Robot Platform
|
|
Go to the documentation of this file.
41 #ifndef YARP_ROSMSG_std_msgs_MultiArrayLayout_h
42 #define YARP_ROSMSG_std_msgs_MultiArrayLayout_h
58 std::vector<yarp::rosmsg::std_msgs::MultiArrayDimension>
dim;
81 for (
int i=0; i<len; i++) {
107 for (
int i=0; i<len; i++) {
108 if (!
dim[i].
read(connection)) {
130 for (
size_t i=0; i<
dim.size(); i++) {
150 for (
size_t i=0; i<
dim.size(); i++) {
177 static constexpr
const char*
typeName =
"std_msgs/MultiArrayLayout";
180 static constexpr
const char*
typeChecksum =
"0fed2a11c13e11c5571b4e2a995a91a3";
184 # The multiarray declares a generic multi-dimensional array of a\n\
185 # particular data type. Dimensions are ordered from outer most\n\
188 MultiArrayDimension[] dim # Array of dimension properties\n\
189 uint32 data_offset # padding elements at front of data\n\
191 # Accessors should ALWAYS be written in terms of dimension stride\n\
192 # and specified outer-most dimension first.\n\
194 # multiarray(i,j,k) = data[data_offset + dim_stride[1]*i + dim_stride[2]*j + k]\n\
196 # A standard, 3-channel 640x480 image with interleaved color channels\n\
197 # would be specified as:\n\
199 # dim[0].label = \"height\"\n\
200 # dim[0].size = 480\n\
201 # dim[0].stride = 3*640*480 = 921600 (note dim[0] stride is just size of image)\n\
202 # dim[1].label = \"width\"\n\
203 # dim[1].size = 640\n\
204 # dim[1].stride = 3*640 = 1920\n\
205 # dim[2].label = \"channel\"\n\
207 # dim[2].stride = 3\n\
209 # multiarray(i,j,k) refers to the ith row, jth column, and kth channel.\n\
211 ================================================================================\n\
212 MSG: std_msgs/MultiArrayDimension\n\
213 string label # label of given dimension\n\
214 uint32 size # size of given dimension (in type units)\n\
215 uint32 stride # stride of given dimension\n\
231 #endif // YARP_ROSMSG_std_msgs_MultiArrayLayout_h
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
bool readBottle(yarp::os::ConnectionReader &connection) override
virtual bool read(yarp::os::idl::WireReader &reader)
virtual bool isBareMode() const =0
Check if the connection is bare mode.
bool writeBottle(yarp::os::ConnectionWriter &connection) const override
yarp::os::idl::BottleStyle< yarp::rosmsg::std_msgs::MultiArrayLayout > bottleStyle
yarp::os::idl::BareStyle< yarp::rosmsg::std_msgs::MultiArrayLayout > rosStyle
std::vector< yarp::rosmsg::std_msgs::MultiArrayDimension > dim
virtual bool isError() const =0
static Type byName(const char *name)
virtual std::int32_t expectInt32()=0
Read a 32-bit integer from the network connection.
Type & addProperty(const char *key, const Value &val)
An interface for writing to a network connection.
static constexpr const char * typeName
virtual bool isError() const =0
virtual bool convertTextMode()=0
Reads in a standard description in text mode, and converts it to a standard description in binary.
A "tamed" Portable, that promises to serialize itself in an IDL-friendly way.
virtual bool isBareMode() const =0
Check if the connection is bare mode.
bool writeBare(yarp::os::ConnectionWriter &connection) const override
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.
IDL-friendly connection reader.
An interface for reading from a network connection.
std::int32_t expectInt32()
The main, catch-all namespace for YARP.
yarp::os::Type getType() const override
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
static constexpr const char * typeText
static constexpr const char * typeChecksum
A single value (typically within a Bottle).
std::uint32_t data_offset
bool readBare(yarp::os::ConnectionReader &connection) override
virtual bool write(const yarp::os::idl::WireWriter &writer) const