0%

CMake中设置编译选项

1
2
3
4
5
6
7
8
9
10
11
option(BUILD_VISUALIZATIONS "Build visualization, default OFF" OFF)
message("BUILD_VISUALIZATIONS is ${BUILD_VISUALIZATIONS}")


# 可以跟build type关联
# if(CMAKE_BUILD_TYPE MATCHES Debug OR CMAKE_BUILD_TYPE MATCHES DEBUG)

if(BUILD_VISUALIZATIONS)
add_definitions(-DBUILD_VISUALIZATIONS)
# target_compile_definitions(${project_name} PRIVATE BUILD_VISUALIZATIONS)
endif()
阅读全文 »

下载rar软件安装包

  1. 直接从 rarlab 下载安装包

  2. 通过命令行下载

    1
    2
    wget https://www.rarlab.com/rar/rarlinux-x64-6.0.1.tar.gz  # 64位
    wget https://www.rarlab.com/rar/rarlinux-3.8.0.tar.gz # 32位

安装

1
2
3
4
tar zxvf rarlinux-x64-6.0.1.tar.gz
cd rar
sudo make
sudo make install

解压缩

1
2
rar x xxx.rar  # Extract files with full path
rar e xxx.rar # Extract files without archived paths
阅读全文 »

使用clang对C++进行格式化

  • 安装clang-format

    1
    sudo apt-get install -y clang-format
  • 简单使用

    1
    2
    clang-format -i <file_to_format>
    # clang-format -i test.cc
  • 指定 style

    1
    2
    clang-format -i --stlye="{key: value, ...}"
    # clang-format -i --stlye="{BasedOnStyle: Google, IndentWidth: 2}"
  • 指定 style 文件

    1
    2
    clang-format -i --stlye=file:<style_file>
    # clang-format -i --style=file:.clang-format
  • 编写脚本 clang_format.bash 对文件夹下所有c++代码格式化

    1
    2
    3
    4
    find . -regextype egrep -regex ".*\.(c|cc|h|hh)$" | xargs clang-format -i

    # skip some paths
    # find . -regextype egrep -regex ".*\.(c|cc|h|hh)$" -not -path '*/install/*' -not -path '*/build/*' -not -path '*/log/*' -not -path '*/deps/*'| xargs clang-format -i
  • 在需要格式化的路径下运行脚本

    1
    ./clang_format.bash
阅读全文 »

安装ftp和vsftpd

1
2
sudo apt-get install ftp
sudo apt-get install vsftpd

启动服务

1
2
3
4
5
6
7
8
9
10
# 使用vsftpd软件,主要包括如下几个命令:

# 启动ftp
service vsftpd start

# 停止ftp
service vsftpd stop

# 重启ftp
service vsftpd restart
阅读全文 »

PCL相关类型 对象与指针互换

  1. pcl::PointIndices -> pcl::PointIndices::Ptr
1
2
pcl::PointIndices inliers;
pcl::PointIndices::Ptr inliers_ptr(new pcl::PointIndices(inliers));
阅读全文 »

安装tweak和dconf

1
2
3
sudo apt install gnome-tweak-tool
sudo apt install dconf-editor
dconf-editor

进入路径: org/gnome/desktop/wm/preferences/button-layout

取消选项 Use default value

阅读全文 »