订阅话题输出TXT文本
/home/zero/catkin_ws/src/tang/src/save_point.cpp
rosrun tang save_point
#include "ros/ros.h"
#include <geometry_msgs/PointStamped.h>
#include <fstream>
#include <iostream>
#include <Eigen/Core>
#include <iomanip>
using namespace std;
void subCallback(const geometry_msgs::PointStamped &msg)
{
Eigen::Vector3d way_points;
way_points(0) = msg.point.x * 100 / 100;
way_points(1) = msg.point.y * 100 / 100;
way_points(2) = msg.point.z * 100 / 100;
// double x = msg.point.x * 100 / 100;
// double y = msg.point.y * 100 / 100;
// double z = msg.point.z * 100 / 100;
std::ofstream out("/home/zero/catkin_ws/src/tang/point.txt",std::ios::app);
//<<fixed<<setprecision(2)的作用就是将输出结果转化为小数点后两位
// out<<fixed<<setprecision(2)<<way_points(0)<<"\t"<<way_points(1)<<"\t"<<way_points(2)<<std::endl;
out<<fixed<<setprecision