33 #ifndef MAGNETICFIELDPUBLISHER_H
34 #define MAGNETICFIELDPUBLISHER_H
37 #include <geometry_msgs/Vector3Stamped.h>
48 int pub_queue_size = 5;
50 pub = node.
advertise<geometry_msgs::Vector3Stamped>(
"imu/mag", pub_queue_size);
57 if (packet.containsCalibratedMagneticField())
61 geometry_msgs::Vector3Stamped
msg;
63 msg.header.stamp = timestamp;
66 XsVector mag = packet.calibratedMagneticField();
68 msg.vector.x = mag[0];
69 msg.vector.y = mag[1];
70 msg.vector.z = mag[2];