ros / 移除
name_drone.erase(std::remove(name_drone.begin(), name_drone.end(), '/'), name_drone.end());
计算耗时1
auto begin = std::chrono::steady_clock::now();
auto end_time = std::chrono::steady_clock::now();
auto diff = end_time - begin;
std::cout << "1st loop: " << std::chrono::duration_cast<std::chrono::milliseconds>(diff).count() << " ms "
<< std::endl;
计算耗时2
ros::WallTime start = ros::WallTime::now();
ros::WallDuration runtime = ros::WallTime::now() - start;
printf("runtime = %f ms\n", runtime.toSec() * 1000);
终端打印输出颜色控制
termcolor.h 头文件
点云地图保存
rosrun pcl_ros pointcloud_to_pcd input:=/laser_cloud_surround
地图格式转换
pcl_pcd2ply xxx.pcd xxxxxxx.ply
use default SIGINT handler so CTRL+C works
signal(SIGINT, SIG_DFL);
清屏 将光标位置移动到高度第一行和宽度第一行
cout << "\033[2J";
printf("\033[%d;%dH", 1, 1);