目录
3. Ubuntu断网,Windows和Ubuntu不能相互复制粘贴。
1. sudo: rosdep: command not found
2.cannot download default sources list from
1.cmake相关
1.C++11标准库
- 问题1.#error This file requires compiler and library support for the ISO C++ 2011 standard...
解决办法:在CMakeList.txt中添加:
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
2.cmake指定安装目录
- 方法一:运行指令中添加安装路径选项
cmake -DCMAKE_INSTALL_PREFIX=/usr ..
- 方法二:修改cmakelist文件
SET(CMAKE_INSTALL_PREFIX < install_path >)
2.eigen相关
1.查看eigen的版本号
解决办法:在eigen路径:/usr/local/include/eigen3/Eigen/src/Core/util 下查看Marcros.h文件
2.eigen在cmakelist中添加
由于Eigen库只有头文件,所以不需要再用target_link_libraries链接到库上,只需
include_directories("/usr/include/eigen3")
3.在eigen3.1和eigen3.3之间切换
时常需要在eigen3.1和3.xx版本之间切换,这时安装多个版本的eigen,指定cmake的安装目录,用第4条,安装好后如下图所示,然后需要使用什么版本就给哪个版本创建软链接,a 就是源文件,b是链接文件名,链接的文件名必须为eigen3,因为cmakelist中的find package(eigen)查找的就是这个,当然可以不用find_package直接在include_directories中添加对应的eigen 路径,因为eigen只有头文件,没有库文件:
ln -s a b
3.CLion相关
1.CLion的代码的回跳快捷键
在settings->keymap里面搜索navigate,然后就有蓝色字体的Back、Forward,其中Button4指的是左侧的两颗键
鼠标左键(button1)、右键bai(button2)、点击滚轮(button3)、返回(button4)、前进(button5)
- 鼠标示意图
2.CLion注释高亮插件
在setting->plugins(插件)中搜索Comments Highlighter,然后重启ide。
在editor->Comments中设置注释样式
注释高亮示意:
3. CLion运行launch文件
目前,clion官网说的是不能运行ros launch文件,只能通过终端运行,后面支不支持不知道,但是可以通过Run | Attach to Process,链接debug正在运行的节点
4.Clion添加启动项
- 在clion顶部的选项卡:tools-> create desktop entry -> ok,
- 重启CLion,再次右键CLion图标,选择:add to favorites选项(Ubuntu18.04),lock to launcher(Ubuntu16.04)
4.其他
1.usleep没有声明
- 问题1:..../src/System.cc:236:28: error: ‘usleep’ was not declared in this scope usleep(1000);
- 解决办法:在System.h添加:#include <unistd.h>之后重新运行./build.sh即可
5.VMware
1.VMware调整虚拟机内存
- 需要先关闭虚拟系统
- 工具栏中选择:虚拟机->设置->内存,然后就可调节了。
注意:千万不要虚拟系统运行的时候调节内存。
2. 在Vmware中Ubuntu的界面太小。
解决办法:安装vmware-tools
3. Ubuntu断网,Windows和Ubuntu不能相互复制粘贴。
- 在VMware中,选择“虚拟机”->“设置”->“选项”->"共享文件夹"->然后创建共享文件夹。
- 在Ubuntu中,用cd命令切换到/mnt/hgfs/xxx_共享文件夹下,然后cp拷贝需要的文件。
- 在Ubuntu中,安装如下包,然后重启
sudo apt-get autoremove open-vm-tools
sudo apt-get install open-vm-tools
sudo apt-get install open-vm-tools-desktop
4.Vmware中虚拟机Ubuntu扩容
参考:VMware 扩展Ubuntu虚拟机的磁盘空间 - ZHJ0125 - 博客园
5.Ubuntu 18.04不显示网络连接的解决方法
参考:Ubuntu 18.04不显示网络连接的解决方法_旧年不在的博客-优快云博客
6. Ros相关问题
1. sudo: rosdep: command not found
解决办法:
sudo apt install python-rosdep
2.cannot download default sources list from
- 问题描述:
ERROR: cannot download default sources list from:
https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/sources.list.d/20-default.list
Website may be down.
- 解决办法:
#打开hosts文件
sudo gedit /etc/hosts
#在文件末尾添加
151.101.76.133 raw.githubusercontent.com
#保存后退出再尝试
- 参考:
- rosdep init 或者rosdep update 连接错误的解决办法
- sudo rosdep init ERROR: cannot download default sources list from:【closed】
3. rosdep update问题
- 参考:
7.Pangolin
1.OpenEXR
- 问题:
/usr/include/OpenEXR/ImathVec.h:228:34: error: ISO C++1z does not allow dynamic exception specifications
- 解决办法:
修改 /xx/Pangolin/components/pango_image下的cmakelist