官网已经更新了教程说明,在此特别说明:

https://github.com/ros-industrial/ros_qtc_plugin/wiki

This wiki explains the procedure for installing the ROS Qt Creator Plug-in.

Table of Contents

1.1 Installation Procedure for Ubuntu 14.04
1.2 Installation Procedure for Ubuntu 16.04
1.3 Installation Issues and Conflicts
1.4 Testing Plugin
1.5 Proceed to Next Step

1.1 Installation Procedure for Ubuntu 14.04

sudo add-apt-repository ppa:beineri/opt-qt57-trusty
sudo add-apt-repository ppa:levi-armstrong/ppa
sudo apt-get update && sudo apt-get install qt57creator-plugin-ros

1.2 Installation Procedure for Ubuntu 16.04

sudo add-apt-repository ppa:beineri/opt-qt57-xenial
sudo add-apt-repository ppa:levi-armstrong/ppa
sudo apt-get update && sudo apt-get install qt57creator-plugin-ros

1.3 Installation Issues and Conflicts

  • No known issues

1.4 Testing Plugin.

  1. Start Qt Creator

    • Option 1: Launch using the desktop icon.
    • Option 2: Launch from terminal. Before you can launch from the terminal perform one of the action below.
      • Add "source /opt/qt57/bin/qt57-env.sh" to the users .bashrc file.
      • Create a symbolic link file in you /usr/local/bin called qtcreator which points to /opt/qt57/bin/qtcreator-wrapper
  2. To verify that the plugin exist, goto File>New File or Project>Projects>Import Project>Import ROS Workspace. If the Import ROS Workspace is present then everything built correctly and is ready for development and testing.

Table of Contents

1.1 Setup
1.1.1 Download development packages
1.1.1.1 Installation Procedure for Ubuntu 14.04
1.1.1.2 Installation Procedure for Ubuntu 16.04
1.1.2 Configure system
1.1.3 Run ROS Qt Creator setup script.
1.1.4 Testing Plugin
1.1.5 Debug issues with Plugin

1.1 Setup

This section explains how to setup your system for development

1.1.1 Download development packages

1.1.1.1 Installation Procedure for Ubuntu 14.04

sudo add-apt-repository ppa:beineri/opt-qt57-trusty
sudo add-apt-repository ppa:levi-armstrong/ppa
sudo apt-get update && sudo apt-get install qt57creator-plugin-ros libqtermwidget57-0-dev

1.1.1.2 Installation Procedure for Ubuntu 16.04

sudo add-apt-repository ppa:beineri/opt-qt57-xenial
sudo add-apt-repository ppa:levi-armstrong/ppa
sudo apt-get update && sudo apt-get install qt57creator-plugin-ros libqtermwidget57-0-dev

1.1.2 Configure system to use the new version of Qt

After installation you need to tell qtchooser where to find this install. Replace the two lines in the file below with the location to the local version shown below. Make sure to change username and versionin the file path to match your system.

File:

sudo gedit /usr/lib/x86_64-linux-gnu/qt-default/qtchooser/default.conf

File content:

/opt/qt57/bin
/opt/qt57/lib

1.1.3 - Run ROS Qt Creator setup script.

  1. Clone your fork of the repository.
    $ git clone -b master https://github.com/<username>/ros_qtc_plugins.git
  2. Next in a terminal, navigate into the repository directory and execute the command below.
    $ bash setup.sh -d

    Note: Instruction 2 can can be repeated to get the latest updates for Qt Creator source. The developer must manually update there fork to get the latest version of ros_qtc_plugins.

1.1.4 Testing Plugin.

  1. Execute the command below or launch using the desktop launcher.
    $ qtcreator
  2. To verify that the plugin exist, goto File>New File or Project>Projects>Import Project>Import ROS Workspace. If the Import ROS Workspace is present then everything built correctly and is ready for development and testing.

1.1.5 - Debug issues with Plugin

  1. Next in a terminal, navigate to the repository ros_qtc_plugin and execute the command below.
    $ bash setup.sh -di
  2. Now launch qtcreator using gdb as shown below and after the plugin segfaults post the trace back in the active/new issue.

    $ gdb <local>/qt-creator-build/bin/qtcreator
    
    (gdb) run

    After error:

    (gdb) bt

参考链接:1. http://blog.csdn.net/u013453604/article/details/52186375

2.http://blog.csdn.net/zhangrelay/article/details/52068865

之前,帖子写得太过简略,这里学习和参考了张京林的博客

如果使用的是ubuntu 14.04和ROS(indigo),参考他的博客,教程非常详细。

这里测试的是ubuntu 16.04和ROS(kinetic)。但是过程和细节几乎一致。

开启终端,输入:

~$ qtcreator

使用Ctrl+N,可以看到如下界面:

分为项目与文件和类。

新建catkin工作空间,并在其中创建功能包,实现Hi ROS!!!!

1 新建工作空间

单击下图Choose...

Name:catkin_HiROS

Path:/home/xxx/catkin_HiROS

弹出对话框,点击Yes,初始化工作空间如下:

之后,点击Generate Project File,完成后点击下一步(N)

在这个选项卡中,可以配置版本控制系统等,如不需要,点击完成(F)

这样就建好了一个空的工作空间,下面新建功能包,添加节点等。

2 创建功能包

在src上单击右键,添加新文件...

点击Choose...

然后填入一些功能包的细节信息,如下:

点击下一步(N),然后点击完成(F)

到此,功能包创建完成。

3 添加一个节点

在HiROS下的src上单击右键,添加新文件...

4 调试编译

需要修改CMakeList.txt,在Build中,进行如下修改:

###########
## Build ##
########### ## Specify additional locations of header files
## Your package locations should be listed before other locations
# include_directories(include)
include_directories(
${catkin_INCLUDE_DIRS}
) ## Declare a C++ library
# add_library(HiROS
# src/${PROJECT_NAME}/HiROS.cpp
# ) ## Add cmake target dependencies of the library
## as an example, code may need to be generated before libraries
## either from message generation or dynamic reconfigure
# add_dependencies(HiROS ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS}) ## Declare a C++ executable
add_executable(HiROS_node src/HiROS.cpp) ## Add cmake target dependencies of the executable
## same as for the library above
# add_dependencies(HiROS_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS}) ## Specify libraries to link a library or executable target against
target_link_libraries(HiROS_node
${catkin_LIBRARIES}
)

注意:

add_executable(HiROS_node src/HiROS.cpp)
target_link_libraries(HiROS_node
${catkin_LIBRARIES}
)

这样编译成功,就会生成可执行文件。

点击构建,进行编译。这里出现警告。功能包命名不规范,应当使用小写字母。

5 运行节点

点击右侧项目,配置桌面->运行:

点击运行,可以在底栏8 ROS Terminals,查看输入结果:

-End-

ROS_Kinetic_22 使用ROS的qt插件即ros_qtc_plugin实现Hi ROS!!!!的更多相关文章

  1. QT插件+ROS 1 安装配置

    测试环境: 系统版本:Ubuntu14.04 ROS版本:indigo QT版本:5.8.0 QtCreator安装 1 安装前准备,安装相应的GNU开发工具集和OpenGL开发库, 请注意安装软件都 ...

  2. VS2010,Qt插件安装使用

    用了几次的QtCreateor,不习惯. 果断换回VS 基本步骤: 1.安装VS2010 2.安装Qt Creator5 3.安装Qt插件 qt-vs-addin-1.2.2-opensource 就 ...

  3. ROS_Kinetic_15 ROS使用Qt

    ROS_Kinetic_15 ROS使用Qt 在网页http://www.qt.io/download-open-source/#section-2 下载并安装Qt ~/下载$ chmod +x qt ...

  4. VS2017上在线和离线安装Qt插件(在线安装)

    版权声明:如需转载,请告知博主并声明出处 https://blog.csdn.net/CLinuxF/article/details/88816436文章目录前言在线安装离线安装(推荐)前言很多朋友喜 ...

  5. VS2013平台安装Qt插件过程

    1.下载所需安装包: Qt5.3.Qt插件下载地址:http://qt-project.org/downloads. qt-vs-addin-1.1.11-opensource.exe 下载地址:ht ...

  6. 【Win10+eclipse+MinGW+QT安装教程】已有eclipse环境下配置QT插件出错详解

    (纪念一下装了一整天濒临绝望的自己[/doge]) (以下所有下载项一律使用32位) step1:下载安装eclipse.适配的jdk.MinGW和QT 1.下载32位eclipse for c++以 ...

  7. Qt 插件综合编程-基于插件的OpenStreetMap瓦片查看器client(1)-墨卡托投影与坐标控制

    (相关的代码能够从https://github.com/goldenhawking/mercator.qtviewer.git直接克隆) 我们如今是准备做一个C/S架构的地图显示控件.就必定牵扯到坐标 ...

  8. Qt5的插件机制(6)--开发Qt插件时几个重要的宏

    怎样开发Qt插件,能够在Qt Assistant 中搜索"Qt Plugins"或"How to Create Qt Plugins",看看那篇manual中的 ...

  9. Eclipse添加Qt插件

    此文件仅为步骤操作作一个记录,以便以后方便查阅. 1.操作大体参考这个网站:http://blog.csdn.net/defonds/article/details/5013412 2.我的运行环境: ...

随机推荐

  1. poj 3384 半平面交

    Feng Shui Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 5183   Accepted: 1548   Speci ...

  2. 例10-10 uva10491(简单概率)

    题意: 在a+b扇门,a扇后面是牛,b扇后面是车.在你选择一扇门后,主持人为你打开另外c扇门,然后你再选一扇, 求是车的概率 ①先选牛:a/(a+b),然后还剩a+b-c-1扇门,其中b扇为车,所以a ...

  3. [BZOJ]1018 堵塞的交通(SHOI2008)

    一道有点神的线段树. Description 有一天,由于某种穿越现象作用,你来到了传说中的小人国.小人国的布局非常奇特,整个国家的交通系统可以被看成是一个2行C列的矩形网格,网格上的每个点代表一个城 ...

  4. ES6(数值)

    数值处理新增特性: 1.新增方法 2.方法调整 1.二进制和八进制 二进制以 0b 开头,其中B和b都可以:八进制以 0o 开头,其中O和o都可以. 2.判断数值是否有效(有限) NaN为非数字,故为 ...

  5. electron应用以管理员权限启动

    最近在用electron开发PC桌面应用,其中有个需求就是整个应用以管理员权限启动.很头痛,各种google,baidu. 最后终于解决了,可以分为三个步骤,做个总结分享. 一.如果没有manifes ...

  6. PHP XML SimpleXML

    PHP 可以基于 SimpleXML 生成和解析 xml 的方法,通过本节的实例,你将了解 PHP 是如何使用 SimpleXML 生成及解析 xml 格式数据的. PHP SimpleXML 处理最 ...

  7. 这是一个测试,测试markdown语法

    [TOC] 1. chpt1 这是一段话,前面没有空格 前面有4个空格,且在编辑状态下上面没有空行 前面有4个空格,且在编辑状态下上面有一个空行. 前面按了一下tab 1.1 1.1 2 段落1 前面 ...

  8. 记一个万金油开源框架JHipster

    本文地址:http://blog.csdn.net/sushengmiyan/article/details/53190236 百搭代码生成框架 体验新技术汇总: Spring Boot Spring ...

  9. Swift基础之如何使用iOS 9的Core Spotlight框架

    本文由CocoaChina译者KingOfOnePiece(博客)翻译 作者:GABRIEL THEODOROPOULOS?校对:hyhSuper 原文:How To Use Core Spotlig ...

  10. MFC误报内存泄露的修复

    在debug状态退出程序的时候,VS会在输出窗口列出可能的内存泄露的地方. MFC中使用DEBUG_NEW能够更方便的定位泄露的地点.但假如MFC的dll释放""过早"& ...