使用rosmake构建c ++项目(ubuntu 16.04上的kinetic)

时间:2016-12-01 20:25:13

标签: c++ ubuntu ros

我正在尝试在ubuntu上构建一个小型的ROS c ++项目(http://wiki.ros.org/loam_continuous)。我似乎不完全理解ros / rosmake或catkin的原理。 首先,我不太了解主目录所指的内容。我现在根据一个初学者教程在我的主目录中创建了一个carkin_ws文件夹,并将4个cpp文件放在./src/loam_continuous/下 当我运行rosmake时,它给了我以下消息,我不明白。

`

~/catkin_ws/src/loam_continuous$ rosmake loam_continuous 
[ rosmake ] rosmake starting...                                                 
[ rosmake ] Packages requested are: ['loam_continuous']                         
[ rosmake ] Logging to directory /home/svens/.ros/rosmake/rosmake_output-20161201-205703
[ rosmake ] Expanded args ['loam_continuous'] to:
['loam_continuous']           
[rosmake-0] Starting >>> catkin [ make ]                                        
[rosmake-1] Starting >>> loam_continuous [ make ]                               
[rosmake-0] Finished <<< catkin ROS_NOBUILD in package catkin
 No Makefile in package catkin
[rosmake-0] Starting >>> genmsg [ make ]                                        
[rosmake-7] Starting >>> cpp_common [ make ]                                    
[rosmake-4] Starting >>> cmake_modules [ make ]                                 
[rosmake-3] Starting >>> rosgraph [ make ]                                      
[rosmake-5] Starting >>> rosclean [ make ]                                      
[rosmake-6] Starting >>> smclib [ make ]                                        
[rosmake-7] Finished <<< cpp_common ROS_NOBUILD in package cpp_common
 No Makefile in package cpp_common
[rosmake-2] Starting >>> angles [ make ]                                        
[rosmake-7] Starting >>> rostime [ make ]                                       
[rosmake-4] Finished <<< cmake_modules ROS_NOBUILD in package cmake_modules
 No Makefile in package cmake_modules
[rosmake-0] Finished <<< genmsg ROS_NOBUILD in package genmsg
 No Makefile in package genmsg
[rosmake-4] Starting >>> rospack [ make ]                                       
[rosmake-5] Finished <<< rosclean ROS_NOBUILD in package rosclean
 No Makefile in package rosclean
[rosmake-0] Starting >>> genlisp [ make ]                                       
[rosmake-3] Finished <<< rosgraph ROS_NOBUILD in package rosgraph
 No Makefile in package rosgraph
[rosmake-5] Starting >>> genpy [ make ]                                         
[rosmake-3] Starting >>> gencpp [ make ]                                        
[rosmake-6] Finished <<< smclib ROS_NOBUILD in package smclib
 No Makefile in package smclib
[rosmake-2] Finished <<< angles ROS_NOBUILD in package angles
 No Makefile in package angles
[rosmake-6] Starting >>> geneus [ make ]                                        
[rosmake-2] Starting >>> gennodejs [ make ]                                     
[rosmake-7] Finished <<< rostime ROS_NOBUILD in package rostime
 No Makefile in package rostime
[rosmake-7] Starting >>> roscpp_traits [ make ]                                 
[rosmake-0] Finished <<< genlisp ROS_NOBUILD in package genlispe 9/65 Complete ]
 No Makefile in package genlisp
[rosmake-0] Starting >>> roslang [ make ]                                       
[rosmake-3] Finished <<< gencpp ROS_NOBUILD in package gencpp
 No Makefile in package gencpp
[rosmake-3] Starting >>> xmlrpcpp [ make ]                                      
[rosmake-5] Finished <<< genpy ROS_NOBUILD in package genpy
 No Makefile in package genpy
[rosmake-5] Starting >>> rosparam [ make ]                                      
[rosmake-2] Finished <<< gennodejs ROS_NOBUILD in package gennodejs
 No Makefile in package gennodejs
[rosmake-2] Starting >>> rosmaster [ make ]                                     
[rosmake-6] Finished <<< geneus ROS_NOBUILD in package geneus
 No Makefile in package geneus
[rosmake-6] Starting >>> message_generation [ make ]                            
[rosmake-7] Finished <<< roscpp_traits ROS_NOBUILD in package roscpp_traits
 No Makefile in package roscpp_traits
[rosmake-7] Starting >>> roscpp_serialization [ make ]                          
[rosmake-0] Finished <<< roslang ROS_NOBUILD in package roslang
 No Makefile in package roslang
[rosmake-0] Starting >>> class_loader [ make ]                                  
[rosmake-4] Finished <<< rospack ROS_NOBUILD in package rospack
 No Makefile in package rospack
[rosmake-4] Starting >>> roslib [ make ]                                        
[rosmake-3] Finished <<< xmlrpcpp ROS_NOBUILD in package xmlrpcpp
 No Makefile in package xmlrpcpp
[ rosmake ] All 3 lines
{-------------------------------------------------------------------------------
  mkdir: cannot create directory ‘build’: Permission denied[rosmake-2] Finished <<< rosmaster ROS_NOBUILD in package rosmaster
 No Makefile in package rosmaster

[rosmake-5] Finished <<< rosparam ROS_NOBUILD in package rosparam
 No Makefile in package rosparam
  /opt/ros/kinetic/share/mk/cmake.mk:7: recipe for target 'all' failed
-------------------------------------------------------------------------------}
[rosmake-6] Finished <<< message_generation ROS_NOBUILD in package message_generation
 No Makefile in package message_generation
[ rosmake ] Output from build of package loam_continuous written to:
[ rosmake ]    /home/svens/.ros/rosmake/rosmake_output-20161201-205703/loam_continuous/build_output.log
[rosmake-7] Finished <<< roscpp_serialization ROS_NOBUILD in package roscpp_serialization
 No Makefile in package roscpp_serialization
[rosmake-7] Starting >>> message_runtime [ make ]                               
[rosmake-1] Finished <<< loam_continuous [FAIL] [ 0.05 seconds ]                
[ rosmake ] Halting due to failure in package loam_continuous. 
[ rosmake ] Waiting for other threads to complete.
[rosmake-4] Finished <<< roslib ROS_NOBUILD in package roslib
 No Makefile in package roslib
[rosmake-0] Finished <<< class_loader ROS_NOBUILD in package class_loader
 No Makefile in package class_loader
[rosmake-7] Finished <<< message_runtime ROS_NOBUILD in package message_runtime
 No Makefile in package message_runtime
[ rosmake ] Results:                                                            
[ rosmake ] Built 26 packages with 1 failures.                                  
[ rosmake ] Summary output to directory                                         
[ rosmake ] /home/svens/.ros/rosmake/rosmake_output-20161201-205703   `

当我查看日志文件时,它只包含这个:

 mkdir: cannot create directory ‘build’: Permission denied
/opt/ros/kinetic/share/mk/cmake.mk:7: recipe for target 'all' failed
make: *** [all] Error 1

我试图用sudo运行rosmake但是当我使用sudo时似乎没有识别命令。有人能指出我可能的解决方案吗?

1 个答案:

答案 0 :(得分:0)

rosmake用于旧版本的ROS,如ROS furtle。使用catkin_make从项目根文件夹构建任何ROS项目。