小鱼 ROS 2 新书上线!点击链接查看, 新书配套视频点击链接查看。
提问前必看的发帖注意事项—— 提问前必看!不符合要求的问题拒绝回答!!
社区使用指南—如何添加标签修改密码
ros2 humble 版本创建功能包是warning
-
Unknown license 'TODO: License declaration'. This has been set in the package.xml, but no LICENSE file has been created.
具体代码:
ning@ning-virtual-machine:~/chapt2/chapt2_ws/src$ ros2 pkg create example.py --build-type ament_python --dependencies rclpy
going to create a new package
package name: example.py
destination directory: /home/ning/chapt2/chapt2_ws/src
package format: 3
version: 0.0.0
description: TODO: Package description
maintainer: ['ning ning@todo.todo']
licenses: ['TODO: License declaration']
build type: ament_python
dependencies: ['rclpy']
creating folder ./example.py
creating ./example.py/package.xml
creating source folder
creating folder ./example.py/example.py
creating ./example.py/setup.py
creating ./example.py/setup.cfg
creating folder ./example.py/resource
creating ./example.py/resource/example.py
creating ./example.py/example.py/init.py
creating folder ./example.py/test
creating ./example.py/test/test_copyright.py
creating ./example.py/test/test_flake8.py
creating ./example.py/test/test_pep257.py[WARNING]: Unknown license 'TODO: License declaration'. This has been set in the package.xml, but no LICENSE file has been created.
It is recommended to use one of the ament license identitifers:
Apache-2.0
BSL-1.0
BSD-2.0
BSD-2-Clause
BSD-3-Clause
GPL-3.0-only
LGPL-3.0-only
MIT
MIT-0 -
功能包的名字应该是example,不是example.py吧
@JerryNing 在 ros2 humble 版本创建功能包是warning 中说:
ros2 pkg create example.py --build-type ament_python --dependencies rclpy
-
example 也不对
还是会报警 -
@JerryNing --license Apache-2.0
首先用 VS Code 打开主目录下的 chapt2 文件,并打开集成终端,输入如下命令:
ros2 pkg create demo_python_pkg --build-type ament_python --license Apache-2.0 --- going to create a new package package name: demo_python_pkg destination directory: /home/fishros/chapt2 package format: 3 version: 0.0.0 description: TODO: Package description maintainer: ['fishros <fishros@todo.todo>'] licenses: ['Apache-2.0'] build type: ament_python dependencies: [] creating folder ./demo_python_pkg creating ./demo_python_pkg/package.xml creating source folder creating folder ./demo_python_pkg/demo_python_pkg creating ./demo_python_pkg/setup.py creating ./demo_python_pkg/setup.cfg creating folder ./demo_python_pkg/resource creating ./demo_python_pkg/resource/demo_python_pkg creating ./demo_python_pkg/demo_python_pkg/__init__.py creating folder ./demo_python_pkg/test creating ./demo_python_pkg/test/test_copyright.py creating ./demo_python_pkg/test/test_flake8.py creating ./demo_python_pkg/test/test_pep257.py
上述命令中ros2 pkg create是 ROS 2 命令行工具 pkg 模块下,用于创建功能包的命令 demo_python_pkg是功能包的名字,后面--build-type ament_python用于指定功能包的构建类型为ament_python,最后的--license Apache-2.0用于声明功能包的开源协议。