原创 c++11 std::threads創建多線程的三種方式

c++11  std::threads創建多線程的三種方式 在C++11 標準中,添加了很多的新特性,當用戶在創建多線程程序時,可以有更多的選擇。 創建線程的三種方式: 1.) 函數指針 2.) 函數類型 3.) Lambda 函數 1

原创 Cmake編譯pthreads報錯:undefined reference to pthread_create

當使用Cmake編譯多線程程序時,需要手動添加pthread庫,如果手動添加,就會報錯: undefined reference to `pthread_create' 出現這個問題的原因是在鏈接階段,函數對應的庫文件搜索不到,找

原创 ubuntu16.04觸摸板無效解決辦法

僅適用於我的筆記本 不保證所有的都有效     臨時方法 執行 /sbin/rmmod psmouse /sbin/modprobe psmouse   如果有效果,將上述代碼添加到 /etc/rc.local 文件中,注意不要添加到

原创 PCL+QT+VTK完整開發環境搭建以及開發- QT安裝

背景 ubuntu 16.04通過ros-kinetic-desktop-full安裝的PCL庫開發有很多bug,所以改用穩定的QT5.7+VTK8.1+PCL1.8.1的組合。 總覽 qt: 5.7.0 qmake: 3.0 based

原创 Ros編程-tf::getYaw返回-nan的解決辦法

首先看一下函數的使用方式: static inline double getYaw(const geometry_msgs::Quaternion& msg_q){ Quaternion bt_q; quaternionMsgToTF(

原创 從零開始Ros編程-創建自己的包(packagge)

背景 官網的教程鏈接:鏈接 一個package最主要有三點: 一個catkin可以使用的package.xml文件。這個文件主要提供包所需要的文件的信息。 一個CmakeList.txt文件,並且這個文件使用catkin。 每一個pack

原创 從零開始Ros編程-ros工作目錄

在上文中提到的,Ros目錄配置完成之後便可以正式進行Ros編程了。在開始正式編程之前先簡單介紹一下ros工作目錄下各個目錄的作用。 首先,ros下的目錄文件如下: build和devel目錄都是編譯程序時系統自動生成的目錄,其中編譯好的

原创 從零開始Ros編程-安裝Ros系統

首先安裝Ros系統環境,根據官網提示來: Ros安裝教程官網鏈接:鏈接 Kinetic版本地址:          鏈接 注意: ROS Kinetic ONLY supports Wily (Ubuntu 15.10), Xenial

原创 Ros編程-undefined reference to `octomath::Pose6D::Pose6D解決辦法

背景:  報錯信息如下: CMakeFiles/odompcl.dir/src/odompcl_node.cpp.o: In function `main': /home/allen/catkin_ws/src/odompcl/src/

原创 從零開始Ros編程-環境配置

一:安裝完成Ros操作系統之後,需要配置環境,如果Shell是系統默認的Shell,則在/etc/bashrc中添加: source  /opt/kinetic/setup.bash 這一步執行之後,就可以直接在命令行中使用catki

原创 Linux C多線程編程以及函數介紹

Introduction 首先介紹線程的概念,在網上有這麼一段介紹 Thread is an execution unit which consists of its own program counter, a stack, and

原创 pcl::octree::OctreePointCloudSearch:pcl點雲圖臨近點搜索 使用以及報錯處理

  Octree pointcloud search class More... #include <pcl/octree/octree_search.h> Inheritance diagram for pcl::octree::Oct

原创 c++高斯分佈函數normal_distribution介紹以及不隨機問題解決辦法

官方介紹:    示例代碼: // normal_distribution #include <iostream> #include <string> #include <random> int main() { const i

原创 Ros tf2_ros::Buffer.lookupTransform 運行報錯lookupTransform base2laser error,"base_footprint" passed to

 示例代碼: tf2_ros::Buffer tfBuffer; tf2_ros::TransformListener tfListener(tfBuffer); geometry_msgs::TransformStam

原创 Eigen::Matrix矩陣轉換

將Matrix3d轉換至Matrix4d的幾種方法: 1: Eigen::Matrix3d R; // Find your Rotation Matrix Eigen::Vector3d T; // Find your translat