zoukankan      html  css  js  c++  java
  • ros-Qt代码环境的搭建

    1 建立package

    catkin_create_pkg beginner_tutorials roscpp
    

    2 导入Qt

    Qt中打开整个工作空间的src/CMakeLists.txt 在倒数第二行最后加入,最后一行include是为了写代码时候智能提示

    FILE(GLOB children ${CMAKE_SOURCE_DIR}/*)
    FOREACH(child ${children})
      IF(IS_DIRECTORY ${child})
        file(GLOB_RECURSE dir_files "${child}/*")
        LIST(APPEND extra_files ${dir_files})
      ENDIF()
    ENDFOREACH()
    add_custom_target(dummy_${PROJECT_NAME} SOURCES ${extra_files})
    
    include_directories(/home/xiaophuang/catkin_ws/devel/include)
    

    右键点击project,执行run cmake,输入的参数是-DCMAKE_BUILD_TYPE=Debug
    这样workspace下面的所有非空文件夹都会被导入

    3 添加文件,文件夹

    在package下新建一个srv文件夹(在Qt下面好像不能建文件夹,在外面建立文件夹)

    在Qt下新建一个AddTwoInts.srv文件放在srv文件夹下面,输入

    int64 a
    int64 b
    ----
    int64 sum
    

    修改package.xml,CMakeLists.txt

    测试一下

    rossrv  show beginner_tutorials/AddTwoInts
    

    4, Debug

    要是按F5提示(注意不要选错要调试的程序)

    This does not seem to be a "Debug" build.
    Setting breakpoints by file name and line number may fail.
    
    Section .debug_info: Not found.
    Section .debug_abbrev: Not found.
    Section .debug_line: Not found.
    Section .debug_str: Not found.
    Section .debug_loc: Not found.
    Section .debug_range: Not found.
    Section .gdb_index: Not found.
    Section .note.gnu.build-id: Found.
    Section .gnu.hash: Found.
    Section .gnu_debuglink: Not found.
    

    打开projects, run cmake 输入-DCMAKE_BUILD_TYPE=Debug

    设置断点,

  • 相关阅读:
    使用 PIVOT 和 UNPIVOT 行转列 列转行 报表统计 函数
    HAVING 子句 (SQL Server Compact)
    浅谈C#抽象类和C#接口
    大型高并发高负载网站的系统架构
    瞬时响应:网站的高性能架构
    Python之Subprocess模块
    Python之JSON序列
    Saltstack生产案例之系统初始化
    Saltstack配置管理
    CentOS6.5安装配置PPTP
  • 原文地址:https://www.cnblogs.com/shhu1993/p/5520224.html
Copyright © 2011-2022 走看看