#include <string>
#include <ros/ros.h> // 包含ROS的头文件
#include <sensor_msgs/JointState.h>
#include <tf/transform_broadcaster.h>
#include <nav_msgs/Odometry.h>
#include <boost/asio.hpp> //包含boost库函数
#include <boost/bind.hpp>
#include <math.h>
#include "std_msgs/String.h" //ros定义的String数据类型
#include <std_msgs/Float32.h>
#include <sensor_msgs/Imu.h>
#include "packet.h"
#include "imu_data_decode.h"
using namespace std;
using namespace boost::asio; //定义一个命名空间,用于后面的读写操作
unsigned char buf[17]; //定义字符串长度,IMU返回的数据是17个字节一组,可用串口调试助手获得
std::string string_to_hex(const std::string& input)
{
static const char* const lut = "0123456789ABCDEF";
size_t len = input.length();
std::string output;
output.