ROS 节点无法通过启动文件执行工作
ROS node not working through launch-file execution
在 hello node and output roslaunch 之前的这两个问题中已经解决了类似的问题。但是我无法让我的节点通过启动文件工作。如果我 运行 这样的节点:
./image_listener_test_node
一切正常,打印正确,并且能够订阅正确的主题。但是通过启动文件:
<launch>
<node name="image_listener_test" type="image_listener_test_node" pkg="image_listener_test" output="screen"/>
</launch>
不打印任何内容,也不写入任何错误消息,例如该节点未正确注册。但是我看不到任何输出,并且它没有注册到该主题。还有什么我想念的吗?
额外
最初创建的包名为image_listener_test
,src中使用的cpp文件为image_converter.cpp
。启动文件位于包的 src 内,即 catkin_ws/src/image_listener_test/src/
.
当我 运行 像 ./image_listener_test_node
这样的包时,它就完成了 catkin_ws/src/devel/lib/image_listener_test/
。
路径有问题吗?
CMakeList
cmake_minimum_required(VERSION 2.8.3)
project(image_listener_test)
find_package(catkin REQUIRED COMPONENTS
compressed_image_transport
cv_bridge
image_transport
roscpp
rospy
sensor_msgs
std_msgs
)
catkin_package(
)
find_package(OpenCV REQUIRED)
find_package(catkin REQUIRED)
message("this is my message " ${OpenCV_LIBRARIES} )
message("this is my message " ${OpenCV_INCLUDE_DIRS} )
message("this is my message " ${OpenCV_INSTALL_PATH} )
include_directories(
${OpenCV_INCLUDE_DIRS} ${catkin_INCLUDE_DIRS}
)
add_library(image_listener_test src/image_converter.cpp)
add_executable(image_listener_test_node src/image_converter.cpp)
target_link_libraries(image_listener_test_node ${OpenCV_LIBRARIES} ${catkin_LIBRARIES} )
PackageXml
<?xml version="1.0"?>
<package>
<name>image_listener_test</name>
<version>0.0.0</version>
<description>The image_listener_test package</description>
<maintainer email="johann@todo.todo">johann</maintainer>
<license>TODO</license>
<buildtool_depend>catkin</buildtool_depend>
<build_depend>compressed_image_transport</build_depend>
<build_depend>cv_bridge</build_depend>
<build_depend>image_transport</build_depend>
<build_depend>roscpp</build_depend>
<build_depend>rospy</build_depend>
<build_depend>sensor_msgs</build_depend>
<build_depend>std_msgs</build_depend>
<run_depend>compressed_image_transport</run_depend>
<run_depend>cv_bridge</run_depend>
<run_depend>image_transport</run_depend>
<run_depend>roscpp</run_depend>
<run_depend>rospy</run_depend>
<run_depend>sensor_msgs</run_depend>
<run_depend>std_msgs</run_depend>
<export>
</export>
</package>
Roslaunch 日志
[roslaunch][INFO] 2016-08-01 08:55:13,364: Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
[roslaunch][INFO] 2016-08-01 08:55:13,377: Done checking log file disk usage. Usage is <1GB.
[roslaunch][INFO] 2016-08-01 08:55:13,378: roslaunch starting with args ['/home/johann/ros_catkin_ws/install_isolated/bin/roslaunch', 'image_listener_test', 'imageTesttemp.launch']
[roslaunch][INFO] 2016-08-01 08:55:13,378: roslaunch env is {'MANDATORY_PATH': '/usr/share/gconf/ubuntu.mandatory.path', 'ROS_DISTRO': 'indigo', 'ROS_LOG_FILENAME': '/home/johann/.ros/log/d1133240-57b4-11e6-a258-0024d77a7ec8/roslaunch-johann-HP-EliteBook-8540w-18648.log', 'XDG_GREETER_DATA_DIR': '/var/lib/lightdm-data/johann', 'GNOME_DESKTOP_SESSION_ID': 'this-is-deprecated', 'UPSTART_EVENTS': 'started starting', 'LESSOPEN': '| /usr/bin/lesspipe %s', 'PKG_CONFIG_PATH': '/home/johann/catkin_ws/devel/lib/pkgconfig:/home/johann/ros_catkin_ws/install_isolated/lib/pkgconfig', 'ROSLISP_PACKAGE_DIRECTORIES': '/home/johann/catkin_ws/devel/share/common-lisp', 'CPATH': '/home/johann/ros_catkin_ws/install_isolated/include', 'LOGNAME': 'johann', 'USER': 'johann', 'PATH': '/home/johann/ros_catkin_ws/install_isolated/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games', 'XDG_VTNR': '7', 'GNOME_KEYRING_CONTROL': '/run/user/1000/keyring-IYCFMF', 'CMAKE_PREFIX_PATH': '/home/johann/catkin_ws/devel:/home/johann/ros_catkin_ws/install_isolated', 'LD_LIBRARY_PATH': '/home/johann/catkin_ws/devel/lib:/home/johann/ros_catkin_ws/install_isolated/lib', 'LANG': 'en_US.UTF-8', 'TERM': 'xterm', 'SHELL': '/bin/bash', 'XDG_SESSION_PATH': '/org/freedesktop/DisplayManager/Session0', 'XAUTHORITY': '/home/johann/.Xauthority', 'LANGUAGE': 'en_US:en', 'COMPIZ_CONFIG_PROFILE': 'ubuntu', 'SHLVL': '1', 'LESSCLOSE': '/usr/bin/lesspipe %s %s', 'QT_QPA_PLATFORMTHEME': 'appmenu-qt5', 'JOB': 'gnome-session', 'TEXTDOMAIN': 'im-config', 'UPSTART_INSTANCE': '', 'CLUTTER_IM_MODULE': 'xim', 'WINDOWID': '65141554', 'SESSIONTYPE': 'gnome-session', 'XMODIFIERS': '@im=ibus', 'ROS_ETC_DIR': '/home/johann/ros_catkin_ws/install_isolated/etc/ros', 'GPG_AGENT_INFO': '/run/user/1000/keyring-IYCFMF/gpg:0:1', 'HOME': '/home/johann', 'QT4_IM_MODULE': 'xim', 'SELINUX_INIT': 'YES', 'XDG_RUNTIME_DIR': '/run/user/1000', 'INSTANCE': 'Unity', 'PYTHONPATH': '/home/johann/ros_catkin_ws/install_isolated/lib/python2.7/dist-packages', 'SSH_AUTH_SOCK': '/run/user/1000/keyring-IYCFMF/ssh', 'VTE_VERSION': '3409', 'ROS_ROOT': '/home/johann/ros_catkin_ws/install_isolated/share/ros', 'GDMSESSION': 'ubuntu', 'IM_CONFIG_PHASE': '1', 'UPSTART_JOB': 'unity-settings-daemon', 'TEXTDOMAINDIR': '/usr/share/locale/', 'GNOME_KEYRING_PID': '2344', 'XDG_SEAT_PATH': '/org/freedesktop/DisplayManager/Seat0', 'ROS_PACKAGE_PATH': '/home/johann/catkin_ws/src:/home/johann/ros_catkin_ws/install_isolated/share:/home/johann/ros_catkin_ws/install_isolated/stacks', 'XDG_CURRENT_DESKTOP': 'Unity', 'XDG_SESSION_ID': 'c2', 'DBUS_SESSION_BUS_ADDRESS': 'unix:abstract=/tmp/dbus-kdzRYX2v0c', '_': '/home/johann/ros_catkin_ws/install_isolated/bin/roslaunch', 'DEFAULTS_PATH': '/usr/share/gconf/ubuntu.default.path', 'GTK_IM_MODULE': 'ibus', 'DESKTOP_SESSION': 'ubuntu', 'UPSTART_SESSION': 'unix:abstract=/com/ubuntu/upstart-session/1000/2347', 'XDG_CONFIG_DIRS': '/etc/xdg/xdg-ubuntu:/usr/share/upstart/xdg:/etc/xdg', 'GTK_MODULES': 'overlay-scrollbar:unity-gtk-module', 'OLDPWD': '/home/johann/catkin_ws/src', 'GDM_LANG': 'en_US', 'XDG_DATA_DIRS': '/usr/share/ubuntu:/usr/share/gnome:/usr/local/share/:/usr/share/', 'PWD': '/home/johann/catkin_ws/src/devel/lib/image_listener_test', 'QT_IM_MODULE': 'ibus', 'ROS_MASTER_URI': 'http://localhost:11311', 'COLORTERM': 'gnome-terminal', 'DISPLAY': ':0', 'LS_COLORS': 'rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:', 'XDG_SEAT': 'seat0'}
[roslaunch][INFO] 2016-08-01 08:55:13,378: starting in server mode
[roslaunch.parent][INFO] 2016-08-01 08:55:13,378: starting roslaunch parent run
[roslaunch][INFO] 2016-08-01 08:55:13,378: loading roscore config file /home/johann/ros_catkin_ws/install_isolated/etc/ros/roscore.xml
[roslaunch][INFO] 2016-08-01 08:55:13,623: Added core node of type [rosout/rosout] in namespace [/]
[roslaunch.config][INFO] 2016-08-01 08:55:13,623: loading config file /home/johann/catkin_ws/src/image_listener_test/launch/imageTesttemp.launch
[roslaunch][INFO] 2016-08-01 08:55:13,626: Added node of type [image_listener_test/image_listener_test_node] in namespace [/]
[roslaunch][INFO] 2016-08-01 08:55:13,627: ... selected machine [] for node of type [image_listener_test/image_listener_test_node]
[roslaunch.pmon][INFO] 2016-08-01 08:55:13,656: start_process_monitor: creating ProcessMonitor
[roslaunch.pmon][INFO] 2016-08-01 08:55:13,656: created process monitor <ProcessMonitor(ProcessMonitor-1, initial daemon)>
[roslaunch.pmon][INFO] 2016-08-01 08:55:13,657: start_process_monitor: ProcessMonitor started
[roslaunch.parent][INFO] 2016-08-01 08:55:13,657: starting parent XML-RPC server
[roslaunch.server][INFO] 2016-08-01 08:55:13,657: starting roslaunch XML-RPC server
[roslaunch.server][INFO] 2016-08-01 08:55:13,657: waiting for roslaunch XML-RPC server to initialize
[xmlrpc][INFO] 2016-08-01 08:55:13,657: XML-RPC server binding to 0.0.0.0:0
[xmlrpc][INFO] 2016-08-01 08:55:13,658: Started XML-RPC server [http://johann-HP-EliteBook-8540w:39263/]
[xmlrpc][INFO] 2016-08-01 08:55:13,658: xml rpc node: starting XML-RPC server
[roslaunch][INFO] 2016-08-01 08:55:13,669: started roslaunch server http://johann-HP-EliteBook-8540w:39263/
[roslaunch.parent][INFO] 2016-08-01 08:55:13,670: ... parent XML-RPC server started
[roslaunch][INFO] 2016-08-01 08:55:13,670: master.is_running[http://localhost:11311]
[roslaunch][INFO] 2016-08-01 08:55:13,671: master.is_running[http://localhost:11311]
[roslaunch][INFO] 2016-08-01 08:55:13,673: ROS_MASTER_URI=http://localhost:11311
[roslaunch][INFO] 2016-08-01 08:55:13,676: setting /roslaunch/uris/host_johann_hp_elitebook_8540w__39263' to http://johann-HP-EliteBook-8540w:39263/
[roslaunch][INFO] 2016-08-01 08:55:13,680: load_parameters starting ...
[roslaunch][INFO] 2016-08-01 08:55:13,686: ... load_parameters complete
[roslaunch][INFO] 2016-08-01 08:55:13,686: launch_nodes: launching local nodes ...
[roslaunch][INFO] 2016-08-01 08:55:13,686: ... preparing to launch node of type [image_listener_test/image_listener_test_node]
[roslaunch][INFO] 2016-08-01 08:55:13,686: create_node_process: package[image_listener_test] type[image_listener_test_node] machine[Machine(name[] env_loader[None] address[localhost] ssh_port[22] user[None] assignable[True] timeout[10.0])] master_uri[http://localhost:11311]
[roslaunch][INFO] 2016-08-01 08:55:13,686: process[image_listener_test-1]: env[{'WINDOWID': '65141554', 'QT_QPA_PLATFORMTHEME': 'appmenu-qt5', 'ROS_DISTRO': 'indigo', 'XDG_GREETER_DATA_DIR': '/var/lib/lightdm-data/johann', 'GNOME_DESKTOP_SESSION_ID': 'this-is-deprecated', 'UPSTART_EVENTS': 'started starting', 'LESSOPEN': '| /usr/bin/lesspipe %s', 'XDG_SEAT_PATH': '/org/freedesktop/DisplayManager/Seat0', 'ROSLISP_PACKAGE_DIRECTORIES': '/home/johann/catkin_ws/devel/share/common-lisp', 'CPATH': '/home/johann/ros_catkin_ws/install_isolated/include', 'LOGNAME': 'johann', 'USER': 'johann', 'PATH': '/home/johann/ros_catkin_ws/install_isolated/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games', 'XDG_VTNR': '7', 'GNOME_KEYRING_CONTROL': '/run/user/1000/keyring-IYCFMF', 'CMAKE_PREFIX_PATH': '/home/johann/catkin_ws/devel:/home/johann/ros_catkin_ws/install_isolated', 'LD_LIBRARY_PATH': '/home/johann/catkin_ws/devel/lib:/home/johann/ros_catkin_ws/install_isolated/lib', 'LANG': 'en_US.UTF-8', 'TERM': 'xterm', 'SHELL': '/bin/bash', 'XDG_SESSION_PATH': '/org/freedesktop/DisplayManager/Session0', 'XAUTHORITY': '/home/johann/.Xauthority', 'LANGUAGE': 'en_US:en', 'SHLVL': '1', 'MANDATORY_PATH': '/usr/share/gconf/ubuntu.mandatory.path', 'JOB': 'gnome-session', 'ROS_LOG_FILENAME': '/home/johann/.ros/log/d1133240-57b4-11e6-a258-0024d77a7ec8/roslaunch-johann-HP-EliteBook-8540w-18648.log', 'UPSTART_INSTANCE': '', 'COMPIZ_CONFIG_PROFILE': 'ubuntu', 'TEXTDOMAIN': 'im-config', 'CLUTTER_IM_MODULE': 'xim', 'XMODIFIERS': '@im=ibus', 'ROS_MASTER_URI': 'http://localhost:11311', 'GPG_AGENT_INFO': '/run/user/1000/keyring-IYCFMF/gpg:0:1', 'HOME': '/home/johann', 'QT4_IM_MODULE': 'xim', 'SELINUX_INIT': 'YES', 'SSH_AUTH_SOCK': '/run/user/1000/keyring-IYCFMF/ssh', 'XDG_RUNTIME_DIR': '/run/user/1000', 'PYTHONPATH': '/home/johann/ros_catkin_ws/install_isolated/lib/python2.7/dist-packages', 'SESSIONTYPE': 'gnome-session', 'VTE_VERSION': '3409', 'ROS_ROOT': '/home/johann/ros_catkin_ws/install_isolated/share/ros', 'GDMSESSION': 'ubuntu', 'IM_CONFIG_PHASE': '1', 'UPSTART_JOB': 'unity-settings-daemon', 'TEXTDOMAINDIR': '/usr/share/locale/', 'XDG_DATA_DIRS': '/usr/share/ubuntu:/usr/share/gnome:/usr/local/share/:/usr/share/', 'PKG_CONFIG_PATH': '/home/johann/catkin_ws/devel/lib/pkgconfig:/home/johann/ros_catkin_ws/install_isolated/lib/pkgconfig', 'ROS_PACKAGE_PATH': '/home/johann/catkin_ws/src:/home/johann/ros_catkin_ws/install_isolated/share:/home/johann/ros_catkin_ws/install_isolated/stacks', 'XDG_CURRENT_DESKTOP': 'Unity', 'XDG_SESSION_ID': 'c2', 'DBUS_SESSION_BUS_ADDRESS': 'unix:abstract=/tmp/dbus-kdzRYX2v0c', '_': '/home/johann/ros_catkin_ws/install_isolated/bin/roslaunch', 'DEFAULTS_PATH': '/usr/share/gconf/ubuntu.default.path', 'GTK_IM_MODULE': 'ibus', 'DESKTOP_SESSION': 'ubuntu', 'UPSTART_SESSION': 'unix:abstract=/com/ubuntu/upstart-session/1000/2347', 'LESSCLOSE': '/usr/bin/lesspipe %s %s', 'GNOME_KEYRING_PID': '2344', 'OLDPWD': '/home/johann/catkin_ws/src', 'LS_COLORS': 'rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:', 'GDM_LANG': 'en_US', 'GTK_MODULES': 'overlay-scrollbar:unity-gtk-module', 'INSTANCE': 'Unity', 'PWD': '/home/johann/catkin_ws/src/devel/lib/image_listener_test', 'QT_IM_MODULE': 'ibus', 'ROS_ETC_DIR': '/home/johann/ros_catkin_ws/install_isolated/etc/ros', 'COLORTERM': 'gnome-terminal', 'DISPLAY': ':0', 'XDG_CONFIG_DIRS': '/etc/xdg/xdg-ubuntu:/usr/share/upstart/xdg:/etc/xdg', 'XDG_SEAT': 'seat0'}]
[roslaunch][INFO] 2016-08-01 08:55:13,728: process[image_listener_test-1]: args[[u'/home/johann/catkin_ws/devel/lib/image_listener_test/image_listener_test_node', u'__name:=image_listener_test']]
[roslaunch][INFO] 2016-08-01 08:55:13,729: ... created process [image_listener_test-1]
[roslaunch.pmon][INFO] 2016-08-01 08:55:13,729: ProcessMonitor.register[image_listener_test-1]
[roslaunch.pmon][INFO] 2016-08-01 08:55:13,729: ProcessMonitor.register[image_listener_test-1] complete
[roslaunch][INFO] 2016-08-01 08:55:13,729: ... registered process [image_listener_test-1]
[roslaunch][INFO] 2016-08-01 08:55:13,729: process[image_listener_test-1]: starting os process
[roslaunch][INFO] 2016-08-01 08:55:13,729: process[image_listener_test-1]: start w/ args [[u'/home/johann/catkin_ws/devel/lib/image_listener_test/image_listener_test_node', u'__name:=image_listener_test', u'__log:=/home/johann/.ros/log/d1133240-57b4-11e6-a258-0024d77a7ec8/image_listener_test-1.log']]
[roslaunch][INFO] 2016-08-01 08:55:13,729: process[image_listener_test-1]: cwd will be [/home/johann/.ros]
[roslaunch][INFO] 2016-08-01 08:55:13,738: process[image_listener_test-1]: started with pid [18666]
[roslaunch][INFO] 2016-08-01 08:55:13,738: ... successfully launched [image_listener_test-1]
[roslaunch][INFO] 2016-08-01 08:55:13,738: ... launch_nodes complete
[roslaunch.pmon][INFO] 2016-08-01 08:55:13,738: registrations completed <ProcessMonitor(ProcessMonitor-1, started daemon 139968554469120)>
[roslaunch.parent][INFO] 2016-08-01 08:55:13,739: ... roslaunch parent running, waiting for process exit
[roslaunch][INFO] 2016-08-01 08:55:13,739: spin
尝试将您的启动文件放在一个名为 launch 的文件夹中,您将在您拥有 src 的同一文件夹中创建该文件夹。
运行 source deve/setup.bash
重新编译后。确保 roscd image_listener_test
有效!
对于未来不打算通过 chat 挖掘什么的读者:
这个问题是一个不知何故搞砸了的构建。这种情况下的解决方案是完全删除 build/ 和 devel/ 目录并使用 catkin_make
重建所有内容。这通常总是我做的第一件事,如果有一些可疑的事情发生并且它解决了很多问题。
正如@cassinaj 指出的那样:重建后您必须再次获取 devel/setup.bash
来源。
在 hello node and output roslaunch 之前的这两个问题中已经解决了类似的问题。但是我无法让我的节点通过启动文件工作。如果我 运行 这样的节点:
./image_listener_test_node
一切正常,打印正确,并且能够订阅正确的主题。但是通过启动文件:
<launch>
<node name="image_listener_test" type="image_listener_test_node" pkg="image_listener_test" output="screen"/>
</launch>
不打印任何内容,也不写入任何错误消息,例如该节点未正确注册。但是我看不到任何输出,并且它没有注册到该主题。还有什么我想念的吗?
额外
最初创建的包名为image_listener_test
,src中使用的cpp文件为image_converter.cpp
。启动文件位于包的 src 内,即 catkin_ws/src/image_listener_test/src/
.
当我 运行 像 ./image_listener_test_node
这样的包时,它就完成了 catkin_ws/src/devel/lib/image_listener_test/
。
路径有问题吗?
CMakeList
cmake_minimum_required(VERSION 2.8.3)
project(image_listener_test)
find_package(catkin REQUIRED COMPONENTS
compressed_image_transport
cv_bridge
image_transport
roscpp
rospy
sensor_msgs
std_msgs
)
catkin_package(
)
find_package(OpenCV REQUIRED)
find_package(catkin REQUIRED)
message("this is my message " ${OpenCV_LIBRARIES} )
message("this is my message " ${OpenCV_INCLUDE_DIRS} )
message("this is my message " ${OpenCV_INSTALL_PATH} )
include_directories(
${OpenCV_INCLUDE_DIRS} ${catkin_INCLUDE_DIRS}
)
add_library(image_listener_test src/image_converter.cpp)
add_executable(image_listener_test_node src/image_converter.cpp)
target_link_libraries(image_listener_test_node ${OpenCV_LIBRARIES} ${catkin_LIBRARIES} )
PackageXml
<?xml version="1.0"?>
<package>
<name>image_listener_test</name>
<version>0.0.0</version>
<description>The image_listener_test package</description>
<maintainer email="johann@todo.todo">johann</maintainer>
<license>TODO</license>
<buildtool_depend>catkin</buildtool_depend>
<build_depend>compressed_image_transport</build_depend>
<build_depend>cv_bridge</build_depend>
<build_depend>image_transport</build_depend>
<build_depend>roscpp</build_depend>
<build_depend>rospy</build_depend>
<build_depend>sensor_msgs</build_depend>
<build_depend>std_msgs</build_depend>
<run_depend>compressed_image_transport</run_depend>
<run_depend>cv_bridge</run_depend>
<run_depend>image_transport</run_depend>
<run_depend>roscpp</run_depend>
<run_depend>rospy</run_depend>
<run_depend>sensor_msgs</run_depend>
<run_depend>std_msgs</run_depend>
<export>
</export>
</package>
Roslaunch 日志
[roslaunch][INFO] 2016-08-01 08:55:13,364: Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
[roslaunch][INFO] 2016-08-01 08:55:13,377: Done checking log file disk usage. Usage is <1GB.
[roslaunch][INFO] 2016-08-01 08:55:13,378: roslaunch starting with args ['/home/johann/ros_catkin_ws/install_isolated/bin/roslaunch', 'image_listener_test', 'imageTesttemp.launch']
[roslaunch][INFO] 2016-08-01 08:55:13,378: roslaunch env is {'MANDATORY_PATH': '/usr/share/gconf/ubuntu.mandatory.path', 'ROS_DISTRO': 'indigo', 'ROS_LOG_FILENAME': '/home/johann/.ros/log/d1133240-57b4-11e6-a258-0024d77a7ec8/roslaunch-johann-HP-EliteBook-8540w-18648.log', 'XDG_GREETER_DATA_DIR': '/var/lib/lightdm-data/johann', 'GNOME_DESKTOP_SESSION_ID': 'this-is-deprecated', 'UPSTART_EVENTS': 'started starting', 'LESSOPEN': '| /usr/bin/lesspipe %s', 'PKG_CONFIG_PATH': '/home/johann/catkin_ws/devel/lib/pkgconfig:/home/johann/ros_catkin_ws/install_isolated/lib/pkgconfig', 'ROSLISP_PACKAGE_DIRECTORIES': '/home/johann/catkin_ws/devel/share/common-lisp', 'CPATH': '/home/johann/ros_catkin_ws/install_isolated/include', 'LOGNAME': 'johann', 'USER': 'johann', 'PATH': '/home/johann/ros_catkin_ws/install_isolated/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games', 'XDG_VTNR': '7', 'GNOME_KEYRING_CONTROL': '/run/user/1000/keyring-IYCFMF', 'CMAKE_PREFIX_PATH': '/home/johann/catkin_ws/devel:/home/johann/ros_catkin_ws/install_isolated', 'LD_LIBRARY_PATH': '/home/johann/catkin_ws/devel/lib:/home/johann/ros_catkin_ws/install_isolated/lib', 'LANG': 'en_US.UTF-8', 'TERM': 'xterm', 'SHELL': '/bin/bash', 'XDG_SESSION_PATH': '/org/freedesktop/DisplayManager/Session0', 'XAUTHORITY': '/home/johann/.Xauthority', 'LANGUAGE': 'en_US:en', 'COMPIZ_CONFIG_PROFILE': 'ubuntu', 'SHLVL': '1', 'LESSCLOSE': '/usr/bin/lesspipe %s %s', 'QT_QPA_PLATFORMTHEME': 'appmenu-qt5', 'JOB': 'gnome-session', 'TEXTDOMAIN': 'im-config', 'UPSTART_INSTANCE': '', 'CLUTTER_IM_MODULE': 'xim', 'WINDOWID': '65141554', 'SESSIONTYPE': 'gnome-session', 'XMODIFIERS': '@im=ibus', 'ROS_ETC_DIR': '/home/johann/ros_catkin_ws/install_isolated/etc/ros', 'GPG_AGENT_INFO': '/run/user/1000/keyring-IYCFMF/gpg:0:1', 'HOME': '/home/johann', 'QT4_IM_MODULE': 'xim', 'SELINUX_INIT': 'YES', 'XDG_RUNTIME_DIR': '/run/user/1000', 'INSTANCE': 'Unity', 'PYTHONPATH': '/home/johann/ros_catkin_ws/install_isolated/lib/python2.7/dist-packages', 'SSH_AUTH_SOCK': '/run/user/1000/keyring-IYCFMF/ssh', 'VTE_VERSION': '3409', 'ROS_ROOT': '/home/johann/ros_catkin_ws/install_isolated/share/ros', 'GDMSESSION': 'ubuntu', 'IM_CONFIG_PHASE': '1', 'UPSTART_JOB': 'unity-settings-daemon', 'TEXTDOMAINDIR': '/usr/share/locale/', 'GNOME_KEYRING_PID': '2344', 'XDG_SEAT_PATH': '/org/freedesktop/DisplayManager/Seat0', 'ROS_PACKAGE_PATH': '/home/johann/catkin_ws/src:/home/johann/ros_catkin_ws/install_isolated/share:/home/johann/ros_catkin_ws/install_isolated/stacks', 'XDG_CURRENT_DESKTOP': 'Unity', 'XDG_SESSION_ID': 'c2', 'DBUS_SESSION_BUS_ADDRESS': 'unix:abstract=/tmp/dbus-kdzRYX2v0c', '_': '/home/johann/ros_catkin_ws/install_isolated/bin/roslaunch', 'DEFAULTS_PATH': '/usr/share/gconf/ubuntu.default.path', 'GTK_IM_MODULE': 'ibus', 'DESKTOP_SESSION': 'ubuntu', 'UPSTART_SESSION': 'unix:abstract=/com/ubuntu/upstart-session/1000/2347', 'XDG_CONFIG_DIRS': '/etc/xdg/xdg-ubuntu:/usr/share/upstart/xdg:/etc/xdg', 'GTK_MODULES': 'overlay-scrollbar:unity-gtk-module', 'OLDPWD': '/home/johann/catkin_ws/src', 'GDM_LANG': 'en_US', 'XDG_DATA_DIRS': '/usr/share/ubuntu:/usr/share/gnome:/usr/local/share/:/usr/share/', 'PWD': '/home/johann/catkin_ws/src/devel/lib/image_listener_test', 'QT_IM_MODULE': 'ibus', 'ROS_MASTER_URI': 'http://localhost:11311', 'COLORTERM': 'gnome-terminal', 'DISPLAY': ':0', 'LS_COLORS': 'rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:', 'XDG_SEAT': 'seat0'}
[roslaunch][INFO] 2016-08-01 08:55:13,378: starting in server mode
[roslaunch.parent][INFO] 2016-08-01 08:55:13,378: starting roslaunch parent run
[roslaunch][INFO] 2016-08-01 08:55:13,378: loading roscore config file /home/johann/ros_catkin_ws/install_isolated/etc/ros/roscore.xml
[roslaunch][INFO] 2016-08-01 08:55:13,623: Added core node of type [rosout/rosout] in namespace [/]
[roslaunch.config][INFO] 2016-08-01 08:55:13,623: loading config file /home/johann/catkin_ws/src/image_listener_test/launch/imageTesttemp.launch
[roslaunch][INFO] 2016-08-01 08:55:13,626: Added node of type [image_listener_test/image_listener_test_node] in namespace [/]
[roslaunch][INFO] 2016-08-01 08:55:13,627: ... selected machine [] for node of type [image_listener_test/image_listener_test_node]
[roslaunch.pmon][INFO] 2016-08-01 08:55:13,656: start_process_monitor: creating ProcessMonitor
[roslaunch.pmon][INFO] 2016-08-01 08:55:13,656: created process monitor <ProcessMonitor(ProcessMonitor-1, initial daemon)>
[roslaunch.pmon][INFO] 2016-08-01 08:55:13,657: start_process_monitor: ProcessMonitor started
[roslaunch.parent][INFO] 2016-08-01 08:55:13,657: starting parent XML-RPC server
[roslaunch.server][INFO] 2016-08-01 08:55:13,657: starting roslaunch XML-RPC server
[roslaunch.server][INFO] 2016-08-01 08:55:13,657: waiting for roslaunch XML-RPC server to initialize
[xmlrpc][INFO] 2016-08-01 08:55:13,657: XML-RPC server binding to 0.0.0.0:0
[xmlrpc][INFO] 2016-08-01 08:55:13,658: Started XML-RPC server [http://johann-HP-EliteBook-8540w:39263/]
[xmlrpc][INFO] 2016-08-01 08:55:13,658: xml rpc node: starting XML-RPC server
[roslaunch][INFO] 2016-08-01 08:55:13,669: started roslaunch server http://johann-HP-EliteBook-8540w:39263/
[roslaunch.parent][INFO] 2016-08-01 08:55:13,670: ... parent XML-RPC server started
[roslaunch][INFO] 2016-08-01 08:55:13,670: master.is_running[http://localhost:11311]
[roslaunch][INFO] 2016-08-01 08:55:13,671: master.is_running[http://localhost:11311]
[roslaunch][INFO] 2016-08-01 08:55:13,673: ROS_MASTER_URI=http://localhost:11311
[roslaunch][INFO] 2016-08-01 08:55:13,676: setting /roslaunch/uris/host_johann_hp_elitebook_8540w__39263' to http://johann-HP-EliteBook-8540w:39263/
[roslaunch][INFO] 2016-08-01 08:55:13,680: load_parameters starting ...
[roslaunch][INFO] 2016-08-01 08:55:13,686: ... load_parameters complete
[roslaunch][INFO] 2016-08-01 08:55:13,686: launch_nodes: launching local nodes ...
[roslaunch][INFO] 2016-08-01 08:55:13,686: ... preparing to launch node of type [image_listener_test/image_listener_test_node]
[roslaunch][INFO] 2016-08-01 08:55:13,686: create_node_process: package[image_listener_test] type[image_listener_test_node] machine[Machine(name[] env_loader[None] address[localhost] ssh_port[22] user[None] assignable[True] timeout[10.0])] master_uri[http://localhost:11311]
[roslaunch][INFO] 2016-08-01 08:55:13,686: process[image_listener_test-1]: env[{'WINDOWID': '65141554', 'QT_QPA_PLATFORMTHEME': 'appmenu-qt5', 'ROS_DISTRO': 'indigo', 'XDG_GREETER_DATA_DIR': '/var/lib/lightdm-data/johann', 'GNOME_DESKTOP_SESSION_ID': 'this-is-deprecated', 'UPSTART_EVENTS': 'started starting', 'LESSOPEN': '| /usr/bin/lesspipe %s', 'XDG_SEAT_PATH': '/org/freedesktop/DisplayManager/Seat0', 'ROSLISP_PACKAGE_DIRECTORIES': '/home/johann/catkin_ws/devel/share/common-lisp', 'CPATH': '/home/johann/ros_catkin_ws/install_isolated/include', 'LOGNAME': 'johann', 'USER': 'johann', 'PATH': '/home/johann/ros_catkin_ws/install_isolated/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games', 'XDG_VTNR': '7', 'GNOME_KEYRING_CONTROL': '/run/user/1000/keyring-IYCFMF', 'CMAKE_PREFIX_PATH': '/home/johann/catkin_ws/devel:/home/johann/ros_catkin_ws/install_isolated', 'LD_LIBRARY_PATH': '/home/johann/catkin_ws/devel/lib:/home/johann/ros_catkin_ws/install_isolated/lib', 'LANG': 'en_US.UTF-8', 'TERM': 'xterm', 'SHELL': '/bin/bash', 'XDG_SESSION_PATH': '/org/freedesktop/DisplayManager/Session0', 'XAUTHORITY': '/home/johann/.Xauthority', 'LANGUAGE': 'en_US:en', 'SHLVL': '1', 'MANDATORY_PATH': '/usr/share/gconf/ubuntu.mandatory.path', 'JOB': 'gnome-session', 'ROS_LOG_FILENAME': '/home/johann/.ros/log/d1133240-57b4-11e6-a258-0024d77a7ec8/roslaunch-johann-HP-EliteBook-8540w-18648.log', 'UPSTART_INSTANCE': '', 'COMPIZ_CONFIG_PROFILE': 'ubuntu', 'TEXTDOMAIN': 'im-config', 'CLUTTER_IM_MODULE': 'xim', 'XMODIFIERS': '@im=ibus', 'ROS_MASTER_URI': 'http://localhost:11311', 'GPG_AGENT_INFO': '/run/user/1000/keyring-IYCFMF/gpg:0:1', 'HOME': '/home/johann', 'QT4_IM_MODULE': 'xim', 'SELINUX_INIT': 'YES', 'SSH_AUTH_SOCK': '/run/user/1000/keyring-IYCFMF/ssh', 'XDG_RUNTIME_DIR': '/run/user/1000', 'PYTHONPATH': '/home/johann/ros_catkin_ws/install_isolated/lib/python2.7/dist-packages', 'SESSIONTYPE': 'gnome-session', 'VTE_VERSION': '3409', 'ROS_ROOT': '/home/johann/ros_catkin_ws/install_isolated/share/ros', 'GDMSESSION': 'ubuntu', 'IM_CONFIG_PHASE': '1', 'UPSTART_JOB': 'unity-settings-daemon', 'TEXTDOMAINDIR': '/usr/share/locale/', 'XDG_DATA_DIRS': '/usr/share/ubuntu:/usr/share/gnome:/usr/local/share/:/usr/share/', 'PKG_CONFIG_PATH': '/home/johann/catkin_ws/devel/lib/pkgconfig:/home/johann/ros_catkin_ws/install_isolated/lib/pkgconfig', 'ROS_PACKAGE_PATH': '/home/johann/catkin_ws/src:/home/johann/ros_catkin_ws/install_isolated/share:/home/johann/ros_catkin_ws/install_isolated/stacks', 'XDG_CURRENT_DESKTOP': 'Unity', 'XDG_SESSION_ID': 'c2', 'DBUS_SESSION_BUS_ADDRESS': 'unix:abstract=/tmp/dbus-kdzRYX2v0c', '_': '/home/johann/ros_catkin_ws/install_isolated/bin/roslaunch', 'DEFAULTS_PATH': '/usr/share/gconf/ubuntu.default.path', 'GTK_IM_MODULE': 'ibus', 'DESKTOP_SESSION': 'ubuntu', 'UPSTART_SESSION': 'unix:abstract=/com/ubuntu/upstart-session/1000/2347', 'LESSCLOSE': '/usr/bin/lesspipe %s %s', 'GNOME_KEYRING_PID': '2344', 'OLDPWD': '/home/johann/catkin_ws/src', 'LS_COLORS': 'rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:', 'GDM_LANG': 'en_US', 'GTK_MODULES': 'overlay-scrollbar:unity-gtk-module', 'INSTANCE': 'Unity', 'PWD': '/home/johann/catkin_ws/src/devel/lib/image_listener_test', 'QT_IM_MODULE': 'ibus', 'ROS_ETC_DIR': '/home/johann/ros_catkin_ws/install_isolated/etc/ros', 'COLORTERM': 'gnome-terminal', 'DISPLAY': ':0', 'XDG_CONFIG_DIRS': '/etc/xdg/xdg-ubuntu:/usr/share/upstart/xdg:/etc/xdg', 'XDG_SEAT': 'seat0'}]
[roslaunch][INFO] 2016-08-01 08:55:13,728: process[image_listener_test-1]: args[[u'/home/johann/catkin_ws/devel/lib/image_listener_test/image_listener_test_node', u'__name:=image_listener_test']]
[roslaunch][INFO] 2016-08-01 08:55:13,729: ... created process [image_listener_test-1]
[roslaunch.pmon][INFO] 2016-08-01 08:55:13,729: ProcessMonitor.register[image_listener_test-1]
[roslaunch.pmon][INFO] 2016-08-01 08:55:13,729: ProcessMonitor.register[image_listener_test-1] complete
[roslaunch][INFO] 2016-08-01 08:55:13,729: ... registered process [image_listener_test-1]
[roslaunch][INFO] 2016-08-01 08:55:13,729: process[image_listener_test-1]: starting os process
[roslaunch][INFO] 2016-08-01 08:55:13,729: process[image_listener_test-1]: start w/ args [[u'/home/johann/catkin_ws/devel/lib/image_listener_test/image_listener_test_node', u'__name:=image_listener_test', u'__log:=/home/johann/.ros/log/d1133240-57b4-11e6-a258-0024d77a7ec8/image_listener_test-1.log']]
[roslaunch][INFO] 2016-08-01 08:55:13,729: process[image_listener_test-1]: cwd will be [/home/johann/.ros]
[roslaunch][INFO] 2016-08-01 08:55:13,738: process[image_listener_test-1]: started with pid [18666]
[roslaunch][INFO] 2016-08-01 08:55:13,738: ... successfully launched [image_listener_test-1]
[roslaunch][INFO] 2016-08-01 08:55:13,738: ... launch_nodes complete
[roslaunch.pmon][INFO] 2016-08-01 08:55:13,738: registrations completed <ProcessMonitor(ProcessMonitor-1, started daemon 139968554469120)>
[roslaunch.parent][INFO] 2016-08-01 08:55:13,739: ... roslaunch parent running, waiting for process exit
[roslaunch][INFO] 2016-08-01 08:55:13,739: spin
尝试将您的启动文件放在一个名为 launch 的文件夹中,您将在您拥有 src 的同一文件夹中创建该文件夹。
运行 source deve/setup.bash
重新编译后。确保 roscd image_listener_test
有效!
对于未来不打算通过 chat 挖掘什么的读者:
这个问题是一个不知何故搞砸了的构建。这种情况下的解决方案是完全删除 build/ 和 devel/ 目录并使用 catkin_make
重建所有内容。这通常总是我做的第一件事,如果有一些可疑的事情发生并且它解决了很多问题。
正如@cassinaj 指出的那样:重建后您必须再次获取 devel/setup.bash
来源。