机器人编程趣味实践18-他山之石(功能包)
Posted zhangrelay
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了机器人编程趣味实践18-他山之石(功能包)相关的知识,希望对你有一定的参考价值。
机器人操作系统功能包可以使用如下两种方式使用:
- sudo apt install xxx
- colcon build xxx
第一种是打包的安装文件,第二种是源代码编译。
如何自己编写功能包后续细说,本节介绍如何使用github下载的功能包源码编译使用。
先上一个思考题:
模型之简
模型之细
代码也是类似,有极简风,也有全家福。
现在很多APP界面很精美,但其内核其实并不复杂,大量的工作放在了如何吸引用户的眼球上。
github下载速度?
- git clone https://github.com/ros-planning/moveit2_tutorials.git
- git clone https://github.com.cnpmjs.org/ros-planning/moveit2_tutorials.git
编译工具
colcon
zhangrelay@ros2fun:~$ colcon -h
usage: colcon [-h] [--log-base LOG_BASE] [--log-level LOG_LEVEL]
{build,extension-points,extensions,graph,info,list,metadata,test,test-result,version-check} ...
optional arguments:
-h, --help show this help message and exit
--log-base LOG_BASE The base path for all log directories (default: ./log, to disable: /dev/null)
--log-level LOG_LEVEL
Set log level for the console output, either by numeric or string value (default: warning)
colcon verbs:
build Build a set of packages
extension-points List extension points
extensions List extensions
graph Generate a visual representation of the dependency graph
info Package information
list List packages, optionally in topological ordering
metadata Manage metadata of packages
test Test a set of packages
test-result Show the test results generated when testing a set of
packages
version-check Compare local package versions with PyPI
{build,extension-points,extensions,graph,info,list,metadata,test,test-result,version-check}
call `colcon VERB -h` for specific help
Environment variables:
CMAKE_COMMAND The full path to the CMake executable
COLCON_ALL_SHELLS Flag to enable all shell extensions
COLCON_COMPLETION_LOGFILE
Set the logfile for completion time
COLCON_DEFAULTS_FILE Set path to the yaml file containing the default values
for the command line arguments (default:
$COLCON_HOME/defaults.yaml)
COLCON_DEFAULT_EXECUTOR
Select the default executor extension
COLCON_EXTENSION_BLOCKLIST
Block extensions which should not be used
COLCON_HOME Set the configuration directory (default: ~/.colcon)
COLCON_LOG_LEVEL Set the log level (debug|10, info|20, warn|30,
error|40, critical|50, or any other positive numeric
value)
COLCON_WARNINGS Set the warnings filter similar to PYTHONWARNINGS
except that the module entry is implicitly set to
'colcon.*'
CTEST_COMMAND The full path to the CTest executable
POWERSHELL_COMMAND The full path to the PowerShell executable
For more help and usage tips, see https://colcon.readthedocs.io
colcon build
完成后显示:
如果要使用自编译功能包中的程序,需要:
. install/local_setup.bash
运行
ros2 launch nav2_bringup tb3_simulation_launch.py slam:=True
好不好用呢?
非常稀烂!
特别容易挂
为何呢?是算法不行,还是参数不合适?换个地图试一试?
调参也是一门学问呢^_^
-End-
以上是关于机器人编程趣味实践18-他山之石(功能包)的主要内容,如果未能解决你的问题,请参考以下文章
机器人编程趣味实践15-遥控到自动(AutoAvoidObstacles)