需求:获取geometry_msgs::TwistStamped格式的速度信息(角速度+线速度)
方法1:从底盘获取线速度,imu获取偏航角速度数据,然后组合数据发布信息。
方法2:通过融合定位输出的位姿(x,y,yaw),通过前后帧计算线速度和偏航角速度,然后发布信息
方法1实现: 头文件:
#pragma once
#include <ros/ros.h>
#include <tf2/transform_datatypes.h>
#include <tf2_geometry_msgs/tf2_geometry_msgs.h>
#include <tf2_ros/transform_listener.h>
#include <std_msgs/Float32.h>
#include <geometry_msgs/TwistStamped.h>
#include <geometry_msgs/TwistWithCovarianceStamped.h>
#include <sensor_msgs/Imu.h><