Ubuntu下的机器人开发

Ubuntu下的机器人开发

flyfish

主要是ROS

1 执行python文件需要注意的地方
rosrun marm_planning moveit_fk_demo.py py文件需要权限可以右键选择文件

访问:读写
执行:勾选允许作为程序执行文件

2 拷贝文件需要权限时

sudo nautilus

在这里进行文件操作

3 编译时std没有某个函数时
C++11版本才有的函数
CMakeLists.txt需要增加
add_compile_options(-std=c++11)

4 需要编辑hosts文件时

sudo gedit /etc/hosts

5安装Qt需要权限运行run文件

终端输入命令修改文件权限: chmod u+x qt-opensource-linux-x64-5.9.6.run
双击安装

6 查看executable技巧
rosrun

按两次tab键自动展示executable 或者打开 cmakefile文件查看
例如add_executable(test_random_node src/test_random.cpp)
target_link_libraries(test_random_node ${catkin_LIBRARIES})

test_random_node 就是一个 executable

7 Qt的桌面快捷方式

sudo gedit /usr/share/applications/qtcreator.desktop

[Desktop Entry]
Type=Application
Exec=bash -i -c ~/Qt5.9.6/Tools/QtCreator/bin/qtcreator
Name=Qt Creator (Community)
GenericName=The IDE of choice for Qt development.
Icon=QtProject-qtcreator
Terminal=false
Categories=Development;IDE;Qt;
MimeType=text/x-c++src;text/x-c++hdr;text/x-xsrc;application/x-designer;application/vnd.qt.qmakeprofile;application/vnd.qt.xml.resource;text/x-qml;text/x-qt.qml;text/x-qt.qbs;

8 arbotix的安装

假设工作区是catkin_ws
下面有这些文件夹 build devel devel_isolated el el_isolated src
下载的文件全部放置 catkin_ws/src/arbotix/src 这个src文件夹中
然后进入工作区 catkin_ws 执行catkin_make编译

9 执行Tensorflow需要注意的
为了兼容暂时使用Python版本 2.7

10 安装QQ
第一步
git clone https://gitee.com/wszqkzqk/deepin-wine-for-ubuntu.git
在deepin-wine-for-ubuntu.文件夹中打开终端,输入sudo sh ./install.sh

第二步
下载
http://mirrors.aliyun.com/deepin/pool/non-free/d/deepin.com.qq.im/

sudo dpkg -i deepin.com.qq.im_8.9.19983deepin22_i386.deb
如果出现依赖问题
sudo apt-get install -f
自动解决依赖后再执行安装命令

11 防止有多个相同的节点名称

ros::init (argc, argv, “moveit_fk_demo”,ros::init_options::AnonymousName);

12不推荐使用的方式
In file included from marm_planning/src/Test.cpp:5:0:

/opt/ros/kinetic/include/moveit/move_group_interface/move_group.h:43:2: warning:

#warning “This header is deprecated and will go away in ROS lunar.” “Please use moveit/move_group_interface/move_group_interface.h” “and the class MoveGroupInterface instead of MoveGroup” [-Wcpp]

推荐使用 moveit/move_group_interface/move_group_interface.h

13 Qt格式化代码快捷键
Ctrl+A
Ctrl+i

14 问题提示
ROS_MASTER_URI is not defined in the environment. Either type the following or (preferrably) add this to your ~/.bashrc file in order set up your local machine as a ROS master:

暂时的解决方案
从终端打开Qtcreator
~/QtCreator/latest/bin$ ./qtcreator

15 关于Qt的配置
Project->Build
Build directory: qt_catkin_ws/build
Project->Run

Executable: qt_catkin_ws/devel/lib/marm_planning/Test
Test是个Executable 相当于
rosrun
rosrun marm_planning Test

16 Qt如何打开ROS工程
Qt打开 *.creator文件

猜你喜欢

转载自blog.csdn.net/flyfish1986/article/details/81141405