Fork me on GitHub
摘要: 代码 #include <iostream> int main(int argc, char** argv) { std::string file = "/home/download/test.png"; int pos = file.find_last_of('/'); std::string p 阅读全文
posted @ 2021-06-29 13:46 chrislzy 阅读(659) 评论(0) 推荐(0) 编辑
摘要: 简介 Qt官方有页面专门说明Linux X11的deployment, 主要是两个: 官方的QT Installer Framework 第三方的AppImage 前者,可以制作online installer, 就像Qt本身一样, 但是稍微麻烦一些, 后者对于简单的程序打包比较容易很方便. 参考 阅读全文
posted @ 2021-06-28 18:22 chrislzy 阅读(86) 评论(0) 推荐(0) 编辑
摘要: 基础用法 #include <iostream> int main(int argc, char** argv) { std::cout << "\033[0;30m This is black color text ! \033[0m" << std::endl; std::cout << "\0 阅读全文
posted @ 2021-06-28 18:20 chrislzy 阅读(1122) 评论(0) 推荐(0) 编辑
摘要: 前言 C++虚函数是多态性实现的重要方式,当某个虚函数通过指针或者引用调用时,编译器产生的代码直到运行时才能确定到底调用哪个版本的函数。被调用的函数是与绑定到指针或者引用上的对象的动态类型相匹配的那个。因此,借助虚函数,我们可以实现多态性。这也是OOP的核心思想之一。 虚函数 考虑下面一个继承的例子 阅读全文
posted @ 2021-06-28 18:18 chrislzy 阅读(2301) 评论(0) 推荐(0) 编辑
摘要: 前言 内存管理是C++中的一个常见的错误和bug来源。在大部分情形中,这些bug来自动态分配内存和指针的使用: 当多次释放动态分配的内存时,可能会导致内存损坏或者致命的运行时错误; 当忘记释放动态分配的内存时,会导致内存泄露。 所以,我们需要智能指针来帮助我们管理动态分配的内存。其来源于一个事实:栈 阅读全文
posted @ 2021-06-28 18:13 chrislzy 阅读(125) 评论(0) 推荐(0) 编辑
摘要: 在C++中使用stdifstream来读取文件, 使用stdofstream来写入文件,比如txt, yaml等文件。 读取文件 方法一: #include <string> #include <fstream> // 片段 std::string in_file_name; std::ifstre 阅读全文
posted @ 2021-06-28 18:11 chrislzy 阅读(1864) 评论(0) 推荐(0) 编辑
摘要: 前言 做对应于播放rosbag包的离线版本, 读取文件夹中image和pcd来处理, 因此需要读取文件夹下的图像文件, 然后根据图像的名称来读取pcd. 代码 #include <iostream> #include <string> #include <vector> #include <fstr 阅读全文
posted @ 2021-06-28 14:55 chrislzy 阅读(503) 评论(0) 推荐(0) 编辑
摘要: 概述 名称 优缺点 vector 可变大小数组。 支持快速随机访问。在尾部之外的位置插入或删除元素可能会很慢。 deque 双端队列。支持快速随机访问。在头尾位置插入或删除很快 string 与vector类似,但是专门用于保存字符。随机访问快,在尾部插入或删除很快 arrary 固定大小数组。支持 阅读全文
posted @ 2021-06-28 11:58 chrislzy 阅读(68) 评论(0) 推荐(0) 编辑
摘要: 背景 setMouseCallback()函数 void setMouseCallback(const string& winname, //图像视窗名称 MouseCallback onMouse, //鼠标响应函数,监视到鼠标操作后调用并处理相应动作 void* userdata = 0 //鼠 阅读全文
posted @ 2021-06-28 09:07 chrislzy 阅读(180) 评论(0) 推荐(0) 编辑
摘要: available point types in PCL PointXYZ - Members: float x, y, z; PointXYZI - Members: float x, y, z, intensity; PointXYZRGBA - Members: float x, y, z; 阅读全文
posted @ 2021-06-28 09:06 chrislzy 阅读(468) 评论(0) 推荐(0) 编辑