catkin_create_pkg: error: argument --rosdistro is required错误解决

本文解决在使用catkin_create_pkg命令创建ROS包时遇到的错误,详细解释正确的命令格式及参数用法,确保包创建过程顺利。

不知道是不是版本问题,使用下列命令ros创建包的时候报了这个错。

catkin_create_pkg beginner_tutorials std_msgs rospy roscpp

报错:

usage: catkin_create_pkg [-h] [--meta] [-s [SYS_DEPS [SYS_DEPS ...]]]
                         [-b [BOOST_COMPS [BOOST_COMPS ...]]] [-V PKG_VERSION]
                         [-D DESCRIPTION] [-l LICENSE] [-a AUTHOR]
                         [-m MAINTAINER] --rosdistro ROSDISTRO
                         name [dependencies [dependencies ...]]
catkin_create_pkg: error: argument --rosdistro: expected one argument

改为

catkin_create_pkg --rosdistro melodic beginner_tutorials std_msgs rospy roscpp 

中间 molodic 根据具体情况。

bt@bt-Dell-G15-5520:~/catkin_ws$ catkin_make -j4 Base path: /home/bt/catkin_ws Source space: /home/bt/catkin_ws/src Build space: /home/bt/catkin_ws/build Devel space: /home/bt/catkin_ws/devel Install space: /home/bt/catkin_ws/install #### #### Running command: "cmake /home/bt/catkin_ws/src -DCATKIN_DEVEL_PREFIX=/home/bt/catkin_ws/devel -DCMAKE_INSTALL_PREFIX=/home/bt/catkin_ws/install -G Unix Makefiles" in "/home/bt/catkin_ws/build" #### CMake Deprecation Warning at CMakeLists.txt:4 (cmake_minimum_required): Compatibility with CMake < 3.10 will be removed from a future version of CMake. Update the VERSION argument <min> value or use a ...<max> suffix to tell CMake that the project does not need compatibility with older versions. -- The C compiler identification is GNU 7.5.0 -- The CXX compiler identification is GNU 7.5.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/bin/cc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Using CATKIN_DEVEL_PREFIX: /home/bt/catkin_ws/devel -- Using CMAKE_PREFIX_PATH: /home/bt/lio_sam_ws/devel;/opt/ros/melodic -- This workspace overlays: /home/bt/lio_sam_ws/devel;/opt/ros/melodic CMake Warning (dev) at /opt/ros/melodic/share/catkin/cmake/python.cmake:4 (find_package): Policy CMP0148 is not set: The FindPythonInterp and FindPythonLibs modules are removed. Run "cmake --help-policy CMP0148" for policy details. Use the cmake_policy command to set the policy and suppress this warning. Call Stack (most recent call first): /opt/ros/melodic/share/catkin/cmake/all.cmake:164 (include) /opt/ros/melodic/share/catkin/cmake/catkinConfig.cmake:20 (include) CMakeLists.txt:58 (find_package) This warning is for project developers. Use -Wno-dev to suppress it. -- Found PythonInterp: /usr/bin/python2 (found suitable version "2.7.17", minimum required is "2") -- Using PYTHON_EXECUTABLE: /usr/bin/python2 -- Using Debian Python package layout -- Using empy: /usr/bin/empy -- Using CATKIN_ENABLE_TESTING: ON -- Call enable_testing() -- Using CATKIN_TEST_RESULTS_DIR: /home/bt/catkin_ws/build/test_results -- Found gtest sources under '/usr/src/googletest': gtests will be built -- Found gmock sources under '/usr/src/googletest': gmock will be built CMake Deprecation Warning at /usr/src/googletest/CMakeLists.txt:1 (cmake_minimum_required): Compatibility with CMake < 3.10 will be removed from a future version of CMake. Update the VERSION argument <min> value or use a ...<max> suffix to tell CMake that the project does not need compatibility with older versions. CMake Deprecation Warning at /usr/src/googletest/googlemock/CMakeLists.txt:41 (cmake_minimum_required): Compatibility with CMake < 3.10 will be removed from a future version of CMake. Update the VERSION argument <min> value or use a ...<max> suffix to tell CMake that the project does not need compatibility with older versions. CMake Deprecation Warning at /usr/src/googletest/googletest/CMakeLists.txt:48 (cmake_minimum_required): Compatibility with CMake < 3.10 will be removed from a future version of CMake. Update the VERSION argument <min> value or use a ...<max> suffix to tell CMake that the project does not need compatibility with older versions. CMake Warning (dev) at /usr/src/googletest/googletest/cmake/internal_utils.cmake:209 (find_package): Policy CMP0148 is not set: The FindPythonInterp and FindPythonLibs modules are removed. Run "cmake --help-policy CMP0148" for policy details. Use the cmake_policy command to set the policy and suppress this warning. Call Stack (most recent call first): /usr/src/googletest/googletest/CMakeLists.txt:60 (include) This warning is for project developers. Use -Wno-dev to suppress it. -- Found PythonInterp: /usr/bin/python2 (found version "2.7.17") -- Performing Test CMAKE_HAVE_LIBC_PTHREAD -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed -- Looking for pthread_create in pthreads -- Looking for pthread_create in pthreads - not found -- Looking for pthread_create in pthread -- Looking for pthread_create in pthread - found -- Found Threads: TRUE -- Using Python nosetests: /usr/bin/nosetests-2.7 -- catkin 0.7.29 -- BUILD_SHARED_LIBS is on -- BUILD_SHARED_LIBS is on -- Configuring done (1.0s) -- Generating done (0.0s) -- Build files have been written to: /home/bt/catkin_ws/build #### #### Running command: "make -j4" in "/home/bt/catkin_ws/build" #### 为什么编译到一半就突然没有了
最新发布
09-19
-- stderr: diyiban CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required): Compatibility with CMake < 2.8.12 will be removed from a future version of CMake. Update the VERSION argument <min> value or use a ...<max> suffix to tell CMake that the project does not need compatibility with older versions. Traceback (most recent call last): File "/home/ros2/catkin_ws/install/catkin/share/catkin/cmake/parse_package_xml.py", line 115, in <module> main() File "/home/ros2/catkin_ws/install/catkin/share/catkin/cmake/parse_package_xml.py", line 101, in main package = parse_package(args.package_xml) File "/usr/local/lib/python3.10/dist-packages/catkin_pkg/package.py", line 584, in parse_package return parse_package_string(xml, filename, warnings=warnings) File "/usr/local/lib/python3.10/dist-packages/catkin_pkg/package.py", line 788, in parse_package_string pkg.validate(warnings=warnings) File "/usr/local/lib/python3.10/dist-packages/catkin_pkg/package.py", line 330, in validate raise InvalidPackage('\n'.join(errors), self.filename) catkin_pkg.package.InvalidPackage: Error(s) in package '/home/ros2/ros2_ws/src/diyiban/package.xml': Package name "diyiban.SLDASM" does not follow naming conventions CMake Error at /home/ros2/catkin_ws/install/catkin/share/catkin/cmake/safe_execute_process.cmake:11 (message): execute_process(/usr/bin/python3 "/home/ros2/catkin_ws/install/catkin/share/catkin/cmake/parse_package_xml.py" "/home/ros2/ros2_ws/src/diyiban/package.xml" "/home/ros2/ros2_ws/build/diyiban/catkin_generated/package.cmake") returned error code 1 Call Stack (most recent call first): /home/ros2/catkin_ws/install/catkin/share/catkin/cmake/catkin_package_xml.cmake:74 (safe_execute_process) /home/ros2/catkin_ws/install/catkin/share/catkin/cmake/catkin_package_xml.cmake:50 (_catkin_package_xml) /home/ros2/catkin_ws/install/catkin/share/catkin/cmake/catkin_package.cmake:99 (catkin_package_x
04-01
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值