C++编程
文章平均质量分 59
dbdxnuliba
这个作者很懒,什么都没留下…
展开
-
字符坐标提取方法
字体坐标提取方法,基于fontForge软件读取Time-Roman.ttf字符导出pdf进行提取原创 2021-12-31 16:39:15 · 483 阅读 · 0 评论 -
解决C++ unordered_map“nvalid use of incomplete type ‘struct std::hash“ 问题
转自https://blog.csdn.net/li459461891/article/details/104910925#commentBox解决C++ unordered_map“nvalid use of incomplete type ‘struct std::hash“ 问题Leon- 2020-03-16 23:00:31 842 已收藏 1分类专栏: C++版权C++专栏收录该内容5 篇文章0 订阅订阅专栏问题G++使用unordered_map时候,编译报错:i..转载 2021-08-31 11:25:46 · 428 阅读 · 0 评论 -
libevent和libcurl实现http和https服务器 cJSON使用
https://www.cnblogs.com/liudw-0215/p/9927470.html转载 2021-05-28 19:59:59 · 463 阅读 · 0 评论 -
double free ERR一种常见形式
double free ERR:容易发生在含有指针的类等于“=”操作之后(几个类的指针成员这是其实指向了同一个地址),当每个类析构函数delete指针的时候其实对同一个地址进行了free,那么就导致double free的错误。所以类中含有指针成员的时候尽量不要进行类的等于操作。/*double free ERR test ,when class operate = ,add by ygx ,2021.05.21*/class Tool{private : int a{0};}原创 2021-05-21 17:46:38 · 193 阅读 · 0 评论 -
libfranka的架构设计
libfranka的架构设计1)1.关节位置轨迹生成器回调函数std::function2.关节速度轨迹生成器回调函数3.笛卡尔位置轨迹生成器回调函数4.笛卡尔速度轨迹生成器回调函数5.单独关节力矩控制器回调函数6.关节力矩控制器回调函数 +关节位置轨迹生成器回调函数7.关节力矩控制器回调函数 +关节速度轨迹生成器回调函数8.关节力矩控制器 回调函数+.笛卡尔位置轨迹生成器回调函数9.关节力矩控制器回调函数 +笛卡尔速度轨迹生成器回调函数2)最外层是多态...原创 2021-04-29 09:28:09 · 372 阅读 · 0 评论 -
EIGEN中文件重定义解决办法error: redefinition of template<class MatrixType, class RealScalar, class Index> 解决办法
转:EIGEN中文件重定义解决办法https://blog.csdn.net/weixin_44401286/article/details/112445309Error: redefinition of template<class MatrixType, class RealScalar, class Index> 解决办法复古蓝 2021-01-10 21:56:57 74 已收藏 2分类专栏: Ubuntu SLAM 文章标签: redefinition of template E..转载 2021-04-13 21:33:52 · 2166 阅读 · 0 评论 -
Eigen内存分配器aligned_allocator
Eigen内存分配器aligned_allocator在使用Eigen的时候,如果STL容器中的元素是Eigen数据库结构,比如下面用vector容器存储Eigen::Matrix4f类型或用map存储Eigen::Vector4f数据类型时: 1 2 vector<Eigen::Matrix4d>; std::map<int, Eigen::Vector4f> 这么使用编译能通过,当运行时会报段错误。对eigen中转载 2021-01-22 10:20:50 · 450 阅读 · 2 评论 -
自动输入密码使用root权限开启shell脚本
不管用那种方法sudo 后买年都有用到参数-S,这个参数是让sudo从标准输入流读取而不是终端设备.1.使用echo和管道命令#!/bin/bashecho password | sudo -S service runtime* status#!/usr/bin/env python#-*- coding: utf-8 -*-from Tkinter import *import subprocessimport sysdef start_shell():subproce原创 2020-12-03 22:42:45 · 1682 阅读 · 0 评论 -
解决libresource_retriever.so:对‘curl_easy_init@CURL_OPENSSL_3’未定义的引用 ,undefined reference to `uuid_gene
解决libresource_retriever.so:对‘curl_easy_init@CURL_OPENSSL_3’未定义的引用以下方法并不能解决我的问题,我的解决方法:安装curl-7.53.0 然后修改 .bashrc 添加export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/x86_64-linux-gnu export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib1 2 3问题描述转载 2020-12-03 22:22:18 · 2039 阅读 · 2 评论 -
C++ Boost signal2信号/槽函数
C++ Boost signal2信号/槽函数signals2 基于Boost里的另一个库signals,实现了线程安全的观察者模式。它是一种函数回调机制,当一个信号关联了多个槽时,信号发出,这些槽将会被调用,当然,也可以仅仅关联一个槽函数。其实Qt也提供了它自己的信号和槽机制,那个是非常的灵活和好用的,但是它依赖于Qt的框架,所以退而求其次,选择了Boost提供了signals2;signals2库位于命名空间boost::signals2中,为了使用它,需要包含头文件<boost/si转载 2020-12-01 23:01:59 · 472 阅读 · 0 评论 -
catkin build 编译工作空间链接功能包的时候链接错误处理方法
catkin build 编译工作空间的时候如果含有多个功能包假设功能包A 需要引用功能包B则需要在功能包A的cmakelist中加入工作空间编译好的B的库的路径否则会出现找不到功能包B中的库的链接错误功能包A中除了正常的findpackage和catkinpackage之外还需要LINK_DIRECTORIES(/home/xxx/ws_catkin_build/devel/lib ##功能包B中库编译的.so所在的路径)target_link_libraries.原创 2020-11-25 17:02:49 · 292 阅读 · 0 评论 -
使用move_group时在自定义的节点对应的launch文件中不要使用group 否则会构造不成功move_group
<launch> <!-- By default, we are not in debug mode --> <arg name="debug" default="false" /> <!-- GDB Debug Option --> <arg unless="$(arg debug)" name="launch_prefix" value="" /> <arg if="$(arg debug)" name=".原创 2020-10-19 14:28:36 · 544 阅读 · 0 评论 -
symbol lookup error:XXX.so: undefined symbol: 解决办法
通过 ldd -rxxx.so命令查看so库链接状态和错误信息ldd命令,可以查看对应的可执行文件或库文件依赖哪些库,但可执行文件或库文件要求与操作系统的编译器类型相同,即电脑是X86的GCC编译器,那么无法通过ldd命令查看ARM交叉编译器编译出来的可执行文件或库文件。如果想在Ubuntu等Linux宿主机上查看ARM交叉编译好的可执行程序和库文件的相关依赖关系,可以通过以下命令:readelf -d xxx.so | grep NEEDED # lichunhong @ lichun..转载 2020-10-16 18:42:42 · 13373 阅读 · 2 评论 -
指针作为函数的形参,并作为返回参数时遇到的坑
当指针作为函数的实参数时,就需要将函数形参声明为指针的指针才行否则就相当于void fun(int temp)//该函数其实没有起到修改temp的效果{temp = temp +1;}int main(){int a = 0;fun(a);}同样的,对于指针来说:RobotCmd*_pThisCmd=nullptr;if(command_handler->parseCmd(command,_pThisCmd)){...原创 2020-10-10 17:33:15 · 222 阅读 · 0 评论 -
解决Poco exception = /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5: version `Qt_5‘ not found
PLUGINLIB_EXPORT_CLASS macro in the library code, and that names are consistent between this macro and your XML. Error string: Could not load library (Poco exception = /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5: version `Qt_5' not found ())sudo gedit ~/.bas原创 2020-09-15 18:38:42 · 802 阅读 · 0 评论 -
网卡ethercat等配置
查看网卡型号ethtool -i ethxx"指的是网卡号,查看ifconfig比如dell@dell-G3-3590:~$ ethtool -i enp3s0driver: r8169version: 2.3LK-NAPIfirmware-version: rtl8168h-2_0.0.2 02/26/15expansion-rom-version:bus-info: 0000:03:00.0supports-statistics: yessupports-test:.原创 2020-09-11 13:38:53 · 970 阅读 · 0 评论 -
基于xenomai的ethercat实时线程运行掉线 解决办法
基于xenomai的ethercat实时线程运行掉线解决办法:在movej运动的最后发现经常出现ethecat运行掉线的现象:发现look_ahead有打印finish rough interp的语句发现vel_interp有打印get invalid data的语句,都是在movej粗插补和精插补完成时打印的,屏蔽之后发现,ethecat掉线次数明显减少ethercat线程以及vel_interp线程,look_ahead线程不能家加logger 或者std::cout语句...原创 2020-09-08 22:31:45 · 1646 阅读 · 0 评论 -
C++ 友元函数
C++友元函数https://www.runoob.com/cplusplus/cpp-friend-functions.html原创 2020-09-08 13:15:53 · 71 阅读 · 0 评论 -
orocos Ports三种不同模式
原创 2020-09-07 10:11:12 · 121 阅读 · 0 评论 -
rtt script
原创 2020-09-03 07:40:04 · 87 阅读 · 0 评论 -
使用ros编译的库的包,编译的时候就必须用catkin_make而不能使用catkin build 否则会包找不到库的链接的错误
如果写的库用ros编译那么其余使用库的包编译的时候就必须用catkin_make而如果用catkin build的话则会一直提示找不到库的链接,原创 2020-08-29 23:05:17 · 885 阅读 · 0 评论 -
rtt deployment
rtt deployment原创 2020-08-28 22:14:07 · 89 阅读 · 0 评论 -
orocos部署
orocos部署https://orocos.github.io/ocl/toolchain-2.9/xml/orocos-deployment.html原创 2020-08-28 17:36:59 · 164 阅读 · 0 评论 -
基于orocos的项目
基于orocos的项目https://www.rock-robotics.org/documentation/tutorials/100_basics_create_library.htmlhttps://github.com/rock-core/tools-orocosrb原创 2020-08-28 17:25:14 · 194 阅读 · 0 评论 -
rttaction编译运行
rttactionhttps://github.com/jhu-lcsr/rtt_ros_examplesrtt_ros_examples例程中有rtt_actionlib_examples文件夹运行的时候需要修改下package和test_server.cpp其中test_server.cpp修改部分:1.添加初始化2.添加deployer.import("rtt_rosnode");int ORO_main(int argc, char** argv){ // .原创 2020-08-28 17:18:10 · 154 阅读 · 0 评论 -
rttlua:部署
rttlua:部署https://www.orocos.org/wiki/orocos/toolchain/luacookbookhttps://github.com/guihomework/orocos_tutorials/wiki#spoiler1(重点推荐)https://github.com/jhu-lcsr/rtt_ros_examples(需要改写)其中example.launch<launch> <arg name="LUA" default="tr原创 2020-08-28 16:44:27 · 233 阅读 · 0 评论 -
realsenseD435i 标定及建立3d彩图
catkin_make -DCATKIN_ENABLE_TESTING=False -DCMAKE_BUILD_TYPE=Release否则会imu频率发布不稳定。原创 2020-07-06 16:44:54 · 1163 阅读 · 0 评论 -
odeint的runge_kutta4与Matlab的ode45的比较
odeint的runge_kutta4与Matlab的ode45的比较转自:https://www.it1352.com/1602155.htmlI would like to use runge_kutta4 method in theodeint C++ library. I've solved the problem in Matlab. My following code in Matlab to solve x'' = -x - g*x', with initial values x1 .转载 2020-06-24 10:48:50 · 905 阅读 · 0 评论 -
定轴旋转
定轴旋转固定轴旋转顺序 x-y-z左乘rotz*roty*rotxlistener.lookupTransform("shoulder_link","upper_arm_link",ros::Time(0),transform_stamped[1]);//(0willgetthelat...原创 2019-10-30 15:09:25 · 723 阅读 · 0 评论 -
命名空间与前向声明的正确使用reference to 'CSon' is ambiguous(模糊的)
1.CDinPlanResult::CDinPlanResult(CDinCmdPtr Ptr)^comm.husing namespace{class CSon;struct sonCmdPlanResult{CSon *ptrSon;}}father.h#include "comm.h"class CCmdLookAh...原创 2019-05-14 10:00:33 · 682 阅读 · 0 评论 -
智能指针与普通指针的混用注意事项
1. 如果想省事建议将所有的数据类型都声明一个智能指针,让系统帮你去释放内存;2.如果想人为的管理内存,则需要非常注意:如上所示,struct STPSon { ptrInt m_pIntNorm; ptrInt m_pIntSmart; int* _pInt; };结构体中既含有智能指针,又含有普通指针如果不...原创 2019-05-13 17:52:04 · 1258 阅读 · 0 评论 -
c++中vector的赋值方法
c++中vector的赋值方法转载自: https://blog.csdn.net/zhixiting5325/article/details/80715877常用的两种赋值方式:1. 给定vector大小: #include <iostream> #include <vector> int main() {...转载 2019-03-20 18:31:55 · 7765 阅读 · 0 评论 -
C++ shared_ptr作为函数参数用来做返回值时一定要加引用&
CCmdLookAheadPlannerResultPtr ptrCmdLookAheadPlannerResult;//声明智能指针,但是先不分配内存和地址 demo_singleMovelPlan(ptrCmdLookAheadPlannerResult); //作为函数参数,用来输出int demo_singleMovelPlan(CCmdLookAheadPlanner...原创 2019-03-07 14:06:47 · 7588 阅读 · 2 评论 -
通信协议
struct prefix_comm{ int id; int magic; int type; int sub_type; int controller_err_code; int true_data_length;} struct true_data_type1{float robot_position[robot_axi...原创 2019-02-13 18:52:32 · 132 阅读 · 0 评论 -
Eigen子矩阵操作
Eigen子矩阵操作来源:https://www.cnblogs.com/yabin/p/6473654.html?utm_source=itdadao&utm_medium=referral1 子矩阵操作简介子矩阵操作又称块操作,在矩阵运算中,子矩阵的提取和操作应用也十分广泛。因此Eigen中也提供了相关操作的方法。提取的子矩阵在操作过程中既可以用作左值也可以用作右值。...转载 2019-01-25 17:48:12 · 440 阅读 · 0 评论 -
函数指针用于错误处理举例分析及以太网接收不同消息的结构体的解决方案
一 、函数指针映射的应用举例应用在错误函数处理1)声明错误处理函数 int processError1(int id,void *arg);int processError2(int id,void *arg); 2) 声明函数指针 typedef int (*func_t)(int id,void *);//定义函数指针,形参:错误id,和指针void *arg 3)...原创 2018-12-25 15:03:27 · 162 阅读 · 0 评论 -
一级指针,二级指针作为函数输出形参的正确使用方法
/*data:20181218/* * 一级指针函数输出形参的正确使用方法:*1)用于将函数内部的地址拷贝到函数外部已经分配的地址,有两种做法,参照test_demo_has_no_ininer_static()和test_demo_has_local_var(),经过代码对比可以发现test_demo_has_no_ininer_static()更合适 * 二级指针函数输出形参的正...原创 2018-12-18 13:28:50 · 628 阅读 · 0 评论 -
【转载】值得推荐的C/C++框架和库,包含很多开源项目
值得推荐的C/C++框架和库,包含很多开源项目 (真的很强大)2016年09月08日 17:44:07 JassionJohn 阅读数:12346值得学习的C语言开源项目-1. WebbenchWebbench是一个在linux下使用的非常简单的网站压测工具。它使用fork()模拟多个客户端同时访问我们设定的URL,测试网站在压力下工作的性能,最多可以模拟3万个并发连接去测试网站的...转载 2018-12-09 20:50:41 · 187 阅读 · 0 评论 -
VS内存泄漏检测方法
1.DEBUG模式原创 2019-05-16 13:47:57 · 122 阅读 · 0 评论 -
智能指针的使用注意事项
因为智能指针是通过引用计数的方式来进行判断何时进行析构的,1)所以不要对含有智能指针的结构体进行memcpy,因为memcpy不会增加引用计数,从而导致错误;2)不要对智能指针本身进行memcpy,同样因为memcpy不会增加引用计数,从而导致错误;3)如果结构体中放有智能指针,则注意不要使用memecpy等防止进行内存拷贝,如果要发生内存拷贝,就应该放普通指针;结构体设计时就要考...原创 2019-05-17 09:21:56 · 818 阅读 · 0 评论