【无标题】

2023-05-16

CMake Error at xxaipkg/CMakeLists.txt:50 (add_message_files):
Unknown CMake command “add_message_files”.

– Configuring incomplete, errors occurred!
See also “/home/zxxxx/02_GT/04_publisher/publisher/build/CMakeFiles/CMakeOutput.log”.
See also “/home/zxxxx/02_GT/04_publisher/publisher/build/CMakeFiles/CMakeError.log”.
Makefile:530: recipe for target ‘cmake_check_build_system’ failed
make: *** [cmake_check_build_system] Error 1
Invoking “make cmake_check_build_system” failed

ROS 自定义msg报错,因为cmakelist和package里没有添加
https://answers.ros.org/question/186986/cmake-error-unknown-cmake-command-add_message_files/

需要增加
genmsg

自定义msg到add_message_files(
FILES
Mrr.msg

)

再增加自定义msg到
generate_messages(
DEPENDENCIES
std_msgs
Mrr.msg
)

cmake_minimum_required(VERSION 3.0.2)
project(zuipkg)

Compile as C++11, supported in ROS Kinetic and newer

add_compile_options(-std=c++11)

Find catkin macros and libraries

if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)

is used, also find other catkin packages

find_package(catkin REQUIRED COMPONENTS
roscpp
rospy
std_msgs
genmsg
)

System dependencies are found with CMake’s conventions

find_package(Boost REQUIRED COMPONENTS system)

Uncomment this if the package has a setup.py. This macro ensures

modules and global scripts declared therein get installed

See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html

catkin_python_setup()

################################################

Declare ROS messages, services and actions

################################################

To declare and build messages, services or actions from within this

package, follow these steps:

* Let MSG_DEP_SET be the set of packages whose message types you use in

your messages/services/actions (e.g. std_msgs, actionlib_msgs, …).

* In the file package.xml:

* add a build_depend tag for “message_generation”

* add a build_depend and a exec_depend tag for each package in MSG_DEP_SET

* If MSG_DEP_SET isn’t empty the following dependency has been pulled in

but can be declared for certainty nonetheless:

* add a exec_depend tag for “message_runtime”

* In this file (CMakeLists.txt):

* add “message_generation” and every package in MSG_DEP_SET to

find_package(catkin REQUIRED COMPONENTS …)

* add “message_runtime” and every package in MSG_DEP_SET to

catkin_package(CATKIN_DEPENDS …)

* uncomment the add_*_files sections below as needed

and list every .msg/.srv/.action file to be processed

* uncomment the generate_messages entry below

* add every package in MSG_DEP_SET to generate_messages(DEPENDENCIES …)

Generate messages in the ‘msg’ folder

add_message_files(
FILES
Mrr.msg

)

Generate services in the ‘srv’ folder

add_service_files(

FILES

Service1.srv

Service2.srv

)

Generate actions in the ‘action’ folder

add_action_files(

FILES

Action1.action

Action2.action

)

Generate added messages and services with any dependencies listed here

generate_messages(
DEPENDENCIES
std_msgs
Mrr.msg
)

################################################

Declare ROS dynamic reconfigure parameters

################################################

To declare and build dynamic reconfigure parameters within this

package, follow these steps:

* In the file package.xml:

* add a build_depend and a exec_depend tag for “dynamic_reconfigure”

* In this file (CMakeLists.txt):

* add “dynamic_reconfigure” to

find_package(catkin REQUIRED COMPONENTS …)

* uncomment the “generate_dynamic_reconfigure_options” section below

and list every .cfg file to be processed

Generate dynamic reconfigure parameters in the ‘cfg’ folder

generate_dynamic_reconfigure_options(

cfg/DynReconf1.cfg

cfg/DynReconf2.cfg

)

###################################

catkin specific configuration

###################################

The catkin_package macro generates cmake config files for your package

Declare things to be passed to dependent projects

INCLUDE_DIRS: uncomment this if your package contains header files

LIBRARIES: libraries you create in this project that dependent projects also need

CATKIN_DEPENDS: catkin_packages dependent projects also need

DEPENDS: system dependencies of this project that dependent projects also need

catkin_package(

INCLUDE_DIRS include

LIBRARIES zuosaisaipkg

CATKIN_DEPENDS roscpp rospy std_msgs
DEPENDS system_lib
)

###########

Build

###########

Specify additional locations of header files

Your package locations should be listed before other locations

include_directories(

include

${catkin_INCLUDE_DIRS}
)

Declare a C++ library

add_library(${PROJECT_NAME}

src/${PROJECT_NAME}/zuosaisaipkg.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(${PROJECT_NAME} KaTeX parse error: Expected '}', got 'EOF' at end of input: {{PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})

Declare a C++ executable

With catkin_make all packages are built within a single CMake context

The recommended prefix ensures that target names across packages don’t collide

add_executable(${PROJECT_NAME}_node src/zuosaisaipkg_node.cpp)

Rename C++ executable without prefix

The above recommended prefix causes long target names, the following renames the

target back to the shorter version for ease of user use

e.g. “rosrun someones_pkg node” instead of “rosrun someones_pkg someones_pkg_node”

set_target_properties(${PROJECT_NAME}_node PROPERTIES OUTPUT_NAME node PREFIX “”)

Add cmake target dependencies of the executable

same as for the library above

add_dependencies(${PROJECT_NAME}_node KaTeX parse error: Expected '}', got 'EOF' at end of input: {{PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})

Specify libraries to link a library or executable target against

target_link_libraries(${PROJECT_NAME}_node

${catkin_LIBRARIES}

)

#############

Install

#############

all install targets should use catkin DESTINATION variables

See http://ros.org/doc/api/catkin/html/adv_user_guide/variables.html

Mark executable scripts (Python etc.) for installation

in contrast to setup.py, you can choose the destination

catkin_install_python(PROGRAMS

scripts/my_python_script

DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}

)

Mark executables for installation

See http://docs.ros.org/melodic/api/catkin/html/howto/format1/building_executables.html

install(TARGETS ${PROJECT_NAME}_node

RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}

)

Mark libraries for installation

See http://docs.ros.org/melodic/api/catkin/html/howto/format1/building_libraries.html

install(TARGETS ${PROJECT_NAME}

ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}

LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}

RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION}

)

Mark cpp header files for installation

install(DIRECTORY include/${PROJECT_NAME}/

DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}

FILES_MATCHING PATTERN “*.h”

PATTERN “.svn” EXCLUDE

)

Mark other files for installation (e.g. launch and bag files, etc.)

install(FILES

# myfile1

# myfile2

DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}

)

#############

Testing

#############

Add gtest based cpp test target and link libraries

catkin_add_gtest(${PROJECT_NAME}-test test/test_zuosaisaipkg.cpp)

if(TARGET ${PROJECT_NAME}-test)

target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME})

endif()

Add folders to be run by python nosetests

catkin_add_nosetests(test)

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

【无标题】 的相关文章

随机推荐

  • ONOS简介

    一 与ODL区别 ONOS与OpenDayLight 两个控制器之间的较量 ODL 立场 xff1a 设备厂商 xff1a Cisco Citrix Systems Red Hat Brocade Ericsson ClearPath HP
  • centos7中mysql的安装配置

    1 在命令行输入以下命令下载 rpm的安装包 执行以下命令下载rpm的安装包 cd usr local src wget https dev mysql com get mysql80 community release el7 1 noa
  • onos1.10安装 Ubuntu18 java1.8

    版本1 10 tar包安装 xff0c java8 onos2 2以上需要jdk11 1 10是apache karaf 3 0 8 xff0c karaf直接进入ONOS xff0c 2 0以上版本启动均产生ERROR不知为何 xff08
  • prometheus数据持久化 docker部署

    https segmentfault com a 1190000015710814 prometheus修改配置不需要停掉 xff0c 只要修改yml之后用docker restart重启 prometheus存储方式 prometheus
  • 什么是私有云?私有云有哪些优势和劣势?

    私有云也是云计算的一种 xff0c 它具有云计算的通用优势 xff0c 主要包括超强的扩展性和自助服务 我们通常讲的云服务器和云主机 xff0c 一般指的公有云 xff0c 私有云相比公有云价格较高 xff0c 一般大中型企业的首选 xff
  • BigDecimal类型 比较大小的方法

    1 转成int BigDecimal b1 61 new BigDecimal 34 121454125453 145 34 if b1 intValue lt 0 System out println 34 金额为负数 xff01 34
  • Git报错解决:OpenSSL SSL_read: Connection was reset, errno 10054 错误解决

    首先 xff0c 造成这个错误很有可能是网络不稳定 xff0c 连接超时导致的 xff0c 如果再次尝试后依然报错 xff0c 可以执行下面的命令 打开Git命令页面 xff0c 执行git命令脚本 xff1a 修改设置 xff0c 解除s
  • java小知识:http请求传输文件流

    前文 xff1a 项目里要给第三方传输图片 xff0c 对方接口要求传文件流 xff0c 而不是常用的base64编码 xff0c 在此记录一下 xff5e 直接贴代码吧 xff1a import com alibaba fastjson
  • SSH无法启动错误解决:Failed to start OpenSSH server daemon.

    一 错误信息如下 xff1a sshd service OpenSSH server daemon Loaded loaded usr lib systemd system sshd service enabled vendor prese
  • linux小知识:修改/etc/profile全局变量文件出错,导致服务命令全部失效解决方案

    现象 xff1a 由于修改profile文件时改错了 xff0c 导致所有的命令都失效了 赶紧解决赶紧解决 1 在当前窗口执行以下命令 export PATH 61 usr local sbin usr local bin sbin bin
  • docker容器如何迁移

    docker容器如何迁移 xff1f 前言 xff1a 迁移容器涉及到备份和恢复 xff0c 可以将任何一个docker容器从一台机器迁移到另一台机器 在迁移过程中 xff0c 首先将把容器备份为Docker镜像快照 然后 xff0c 该D
  • 缓存IO和直接IO的区别

    1 缓存IO 缓存I O又被称作标准I O xff0c 大多数文件系统的默认I O操作都是缓存I O 在Linux的缓存I O机制中 xff0c 数据先从磁盘复制到内核空间的缓冲区 xff0c 然后从内核空间缓冲区复制到应用程序的地址空间
  • 修改svn的配置文件并对密码加密

    svn管理 公司项目进出新人 xff0c 需要对代码管理工具进行增删 由于对linux不是很了解 对svn的配置有没有进行过交接 所有的操作都是自己在centos服务器上进行尝试 对于普通的svn的账号密码管理有了基本了解 但是在服务器上看
  • deepin安装微信qq

    在网页上下载最新微信或者qq env WINEPREFIX 61 deepinwine Deepin WeChat deepin wine WeChatSetup exe 该命令运行在WeChatSetup exe所在文件夹 xff0c 最
  • 在Java中,执行SQL查询到数据后,存储在哪里了?

    前言 xff1a 我们项目运行过程中 xff0c 肯定会有查询数据库这步操作 xff0c 无论你是MySQL还是Oracle 那么这种情况就必须搞清楚 xff0c 从数据库里查询得到的数据默认存储到哪了 xff0c 为什么一次查询过多的数据
  • Java小知识:摆脱BeanUtil.copyProperties!! 最优的替代方案 -Bean Converter插件使用方式来了~

    前言 xff1a 开发中为什么不推荐使用BeanUtil copyProperties xff1f 使用BeanUtil copyProperties会有哪些严重后果 xff1f 这些就不在这里眼神了哈 xff0c 大家可以自行查阅一下即可
  • Vue小知识: $ is not defined错误解决

    错误原因 xff1a 该错误是未安装JQuery依赖包导致 解决方案 xff1a 安装依赖包 1 执行安装jquery依赖包命令 cnpm install jquery save 2 webpack配置 xff08 1 xff09 在项目根
  • JVM小知识:linux 命令查看jvm堆内存信息

    1 查看当前java进程的pid pgrep lf java 2 查看java堆的详细信息 jmap heap PID 3 查看java堆中对象的相关信息 xff0c 包含数量以及占用的空间大小 jmap histo PID 4 查看监控
  • IDEA小知识:查看内存使用情况的步骤

    1 展示idea自带的内存指标 xff0c 如图 1 图 2 点击File gt 选择Setting gt 进入APPearance gt 勾选Show memory indicator 图 xff08 1 xff09 图 xff08 2
  • 【无标题】

    CMake Error at xxaipkg CMakeLists txt 50 add message files Unknown CMake command add message files Configuring incomplet