ros学习问题(一)

问题1:rospack depends1 beginner_tutorials

I have the following error :

[rospack] Error: no such package beginner_tutorials

**解答1:**You might need to rebuild your workspace before your new package is findable:

cd ~/catkin_ws
catkin_make
. devel/setup.bash
rospack depends1 beginner_tutorials

问题2:rospack depends1 beginner_tutorials

[rospack] Error: the rosdep view is empty: call ‘sudo rosdep init’ and ‘rosdep update’
输入sudo rosdep init之后
[sudo] qinhaidong 的密码:
ERROR: cannot download default sources list from:
https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/sources.list.d/20-default.list
Website may be down.报错
**解答2:**这种网络问题,等等再次输入 sudo rosdep init即可,出现
ERROR: default sources list file already exists:
/etc/ros/rosdep/sources.list.d/20-default.list
Please delete if you wish to re-initialize
接着输入
sudo rm /etc/ros/rosdep/sources.list.d/20-default.list
重新sudo rosdep init
Wrote /etc/ros/rosdep/sources.list.d/20-default.list
Recommended: please run rosdep update
接着输入
rosdep update

问题3

在按照教程http://wiki.ros.org/cn/ROS/Tutorials/WritingPublisherSubscriber%28c%2B%2B%29进行时catkin_make报错

add_subdirectory(beginner_tutorials)
– Using these message generators: gencpp;geneus;genlisp;gennodejs;genpy
CMake Error at /opt/ros/kinetic/share/genmsg/cmake/genmsg-extras.cmake:94 (message):
add_message_files() directory not found:
/home/qinhaidong/catkin_ws/src/beginner_tutorials/msg
Call Stack (most recent call first):
beginner_tutorials/CMakeLists.txt:8 (add_message_files)

– Configuring incomplete, errors occurred!
See also “/home/qinhaidong/catkin_ws/build/CMakeFiles/CMakeOutput.log”.
See also “/home/qinhaidong/catkin_ws/build/CMakeFiles/CMakeError.log”.
Makefile:528: recipe for target ‘cmake_check_build_system’ failed
make: *** [cmake_check_build_system] Error 1
Invoking “make cmake_check_build_system” failed
解答3
ROS教程出错了,要把/home/qinhaidong/catkin_ws/src/beginner_tutorials路径下的cmakelists.txt中以下部分注释掉即可:
##Declare ROS messages and services
#add_message_files(FILES Num.msg)
#add_service_files(FILES AddTwoInts.srv)
##Generate added messages and services
#generate_messages(DEPENDENCIES std_msgs)

问题4

在按ROS入门教程(点击打开链接)行进过程中到了执行

rosmsg show beginner_tutorials/Num

命令时,出现提示

The manifest (with format version 2) must not contain the following tags: run_depend

的警告,这个的主要解决方法是使用catkin方式时在package.xml文件中将教程中添加的两行语句

<build_depend>message_generation</build_depend>
<run_depend>message_runtime</run_depend>

要改成

<build_depend> message_generation </build_depend>

<exec_depend> message_runtime </exec_depend>

问题5

在这一讲http://wiki.ros.org/cn/ROS/Tutorials/CreatingMsgAndSrv运行 catkin_make时报错
CMake Error at /opt/ros/kinetic/share/catkin/cmake/catkin_package.cmake:108 (message):
catkin_package() called with unused arguments: …

解答5
If the posted code is actually what you have in your CMake file:
catkin_package( … CATKIN_DEPENDS message_runtime … …)
then … is clearly not a valid argument. If … is mentioned in the tutorial it is meant as an example and the dots have to be replaced with whatever else you need to pass.
意思就是说…是额外路径,没用的话就去掉。
改为catkin_package( CATKIN_DEPENDS message_runtime )

猜你喜欢

转载自blog.csdn.net/qq_33591712/article/details/84190059