33#ifndef YARP_ROSMSG_sensor_msgs_MagneticField_h
34#define YARP_ROSMSG_sensor_msgs_MagneticField_h
53 std::vector<yarp::conf::float64_t> magnetic_field_covariance;
58 magnetic_field_covariance()
60 magnetic_field_covariance.resize(9, 0.0);
69 magnetic_field.
clear();
72 magnetic_field_covariance.clear();
73 magnetic_field_covariance.resize(9, 0.0);
79 if (!header.
read(connection)) {
84 if (!magnetic_field.
read(connection)) {
90 magnetic_field_covariance.resize(len);
107 if (!header.
read(connection)) {
112 if (!magnetic_field.
read(connection)) {
121 magnetic_field_covariance.resize(len);
122 for (
int i=0; i<len; i++) {
132 return (connection.
isBareMode() ? readBare(connection)
133 : readBottle(connection));
139 if (!header.
write(connection)) {
144 if (!magnetic_field.
write(connection)) {
149 if (magnetic_field_covariance.size()>0) {
162 if (!header.
write(connection)) {
167 if (!magnetic_field.
write(connection)) {
173 connection.
appendInt32(magnetic_field_covariance.size());
174 for (
size_t i=0; i<magnetic_field_covariance.size(); i++) {
185 return (connection.
isBareMode() ? writeBare(connection)
186 : writeBottle(connection));
195 static constexpr const char* typeName =
"sensor_msgs/MagneticField";
198 static constexpr const char* typeChecksum =
"2f3b0b43eed0c9501de0fa3ff89a45aa";
201 static constexpr const char* typeText =
"\
202 # Measurement of the Magnetic Field vector at a specific location.\n\
204 # If the covariance of the measurement is known, it should be filled in\n\
205 # (if all you know is the variance of each measurement, e.g. from the datasheet,\n\
206 #just put those along the diagonal)\n\
207 # A covariance matrix of all zeros will be interpreted as \"covariance unknown\",\n\
208 # and to use the data a covariance will have to be assumed or gotten from some\n\
212 Header header # timestamp is the time the\n\
213 # field was measured\n\
214 # frame_id is the location and orientation\n\
215 # of the field measurement\n\
217 geometry_msgs/Vector3 magnetic_field # x, y, and z components of the\n\
218 # field vector in Tesla\n\
219 # If your sensor does not output 3 axes,\n\
220 # put NaNs in the components not reported.\n\
222 float64[9] magnetic_field_covariance # Row major about x, y, z axes\n\
223 # 0 is interpreted as variance unknown\n\
224================================================================================\n\
225MSG: std_msgs/Header\n\
226# Standard metadata for higher-level stamped data types.\n\
227# This is generally used to communicate timestamped data \n\
228# in a particular coordinate frame.\n\
230# sequence ID: consecutively increasing ID \n\
232#Two-integer timestamp that is expressed as:\n\
233# * stamp.sec: seconds (stamp_secs) since epoch (in Python the variable is called 'secs')\n\
234# * stamp.nsec: nanoseconds since stamp_secs (in Python the variable is called 'nsecs')\n\
235# time-handling sugar is provided by the client library\n\
237#Frame this data is associated with\n\
242================================================================================\n\
243MSG: geometry_msgs/Vector3\n\
244# This represents a vector in free space. \n\
245# It is only meant to represent a direction. Therefore, it does not\n\
246# make sense to apply a translation to it (e.g., when applying a \n\
247# generic rigid transformation to a Vector3, tf2 will only apply the\n\
248# rotation). If you want your data to be translatable too, use the\n\
249# geometry_msgs/Point message instead.\n\
#define BOTTLE_TAG_FLOAT64
An interface for reading from a network connection.
virtual bool expectBlock(char *data, size_t len)=0
Read a block of data from the network connection.
virtual bool isBareMode() const =0
Check if the connection is bare mode.
virtual std::int32_t expectInt32()=0
Read a 32-bit integer from the network connection.
virtual bool convertTextMode()=0
Reads in a standard description in text mode, and converts it to a standard description in binary.
virtual bool isError() const =0
virtual yarp::conf::float64_t expectFloat64()=0
Read a 64-bit floating point number from the network connection.
An interface for writing to a network connection.
virtual bool isError() const =0
virtual bool isBareMode() const =0
Check if the connection is bare mode.
virtual void appendExternalBlock(const char *data, size_t len)=0
Send a block of data to the network connection, without making a copy.
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.
virtual void appendFloat64(yarp::conf::float64_t data)=0
Send a representation of a 64-bit floating point number to the network connection.
static Type byName(const char *name)
Type & addProperty(const char *key, const Value &val)
A single value (typically within a Bottle).
A "tamed" Portable, that promises to serialize itself in an IDL-friendly way.
virtual bool read(yarp::os::idl::WireReader &reader)
virtual bool write(const yarp::os::idl::WireWriter &writer) const
IDL-friendly connection reader.
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
bool write(yarp::os::ConnectionWriter &connection) const override
Write this object to a network connection.
yarp::rosmsg::sensor_msgs::MagneticField MagneticField
bool read(ImageOf< PixelRgb > &dest, const std::string &src, image_fileformat format=FORMAT_ANY)
bool write(const ImageOf< PixelRgb > &src, const std::string &dest, image_fileformat format=FORMAT_PPM)
The main, catch-all namespace for YARP.