c++ - 使用指定路径从目录加载 PCD 文件(路径包含作为文件名的字符串)
问题描述
我正在尝试从目录加载 pcd 文件,因此我正在获取文件名,然后将此文件名添加到路径中。
我知道文件名可以直接在路径中指定,但我这样做是因为文件名会有所不同。
//getting the filename
string ls = "3989440000.pcd"
chdir("/home");
path="/home/usr/pcd/" + ls;
// Fill in the cloud data
if (pcl::io::loadPCDFile<pcl::PointXYZ> (path.c_str(), *cloud) == -1)
{
PCL_ERROR ("Couldn't read file test_pcd.pcd \n");
return (-1);
}
这是我面临的错误。
[pcl::PCDReader::readHeader] 找不到文件'/home/usr/pcd/3989440000.pcd'。无法读取文件 test_pcd.pcd
解决方案
推荐阅读
- php - React:重定向到子域时保留 cookie
- azure - 如何向 IOTCentral 报告遥测数据?
- php - 如何使用 HTML 表单将动态选项发布到 php 脚本?
- javascript - 有没有可能使用 .reduce()、.map()、.filter() 方法对该数组进行排序?
- python - 逻辑错误?Python 错误捕获和变量
- javascript - React Drag and Drop - react-dnd - 使组件同时可拖放(应用两个角色 - 拖放)
- android - Cordova webview 上不显示 Adsense 广告
- java - 如何在张海的 MaterialRatingBar 库中更改星星的颜色我找不到方法?
- flutter - 如何在 Flutter 中为 PopupMenu 添加圆角边框?
- c++11 - std::chrono 时间点、持续时间转换和小数值