#include <ros/ros.h>
#include <tf/transform_broadcaster.h>

int main(int argc, char* argv[]) {
  ros::init(argc, argv, "tf_pub");
  ros::NodeHandle nh;
    tf::TransformBroadcaster br;
    ros::Rate rate(20.0);


  while(ros::ok()) {
    tf::Transform transform;
    transform.setOrigin(tf::Vector3(0, 0, 0));  // 设置坐标变换的平移部分
    tf::Quaternion q;
    q.setRPY(0, 0, 0);  // 设置旋转部分（即绕 x、y、z 轴的旋转角度）
    transform.setRotation(q);
    br.sendTransform(tf::StampedTransform(transform, ros::Time::now(), "base_link", "laser"));   // 父坐标系   子坐标系
    br.sendTransform(tf::StampedTransform(transform, ros::Time::now(), "odom", "base_link"));
    rate.sleep();
    ros::spinOnce();
  }
  return 0;
}