Homalozoa X b35dc141b9 | 2 years ago | |
---|---|---|
.. | ||
cyberdog_pycommon | 2 years ago | |
launch | 2 years ago | |
params | 2 years ago | |
CMakeLists.txt | 2 years ago | |
README.md | 2 years ago | |
package.xml | 2 years ago |
该模块是启动所有其他子模块的启动模块。
该模块用于启动所有ROS 2进程,并直接应用于系统服务中。
完整的启动流程是通过systemd service调用lc_bringup_launch.py启动其他所有的节点的启动脚本,并且lc_bringup_launch.py
会调用params
文件夹里的launch_nodes.yaml
,launch_groups.yaml
, default_param.yaml
和remappings.yaml
进行启动。在上述四个YAML
文件中会配置可以启动的节点
,分组启动的节点
,节点内需要使用的参数
和节点内需要重映射
的内容。
在launch_nodes.yaml
中会提供两种节点:base_nodes
和other_nodes
,前者是机器人运动和持续工作所必须的节点,如不存在
或启动失败
,则会上报错误,终止启动;后者是其他节点,不存在
或启动失败
只会上报警告,并继续启动。
在launch_groups.yaml
中可按需配置不同条件下所需要的节点。
在default_param.yaml
中会提供所有节点的外部参数,按照节点的名字进行分组。
在remappings.yaml
中会提供所有节点所需要的重映射内容,按照节点的名字进行分组。
基于上述描述,目前版本(210726)如需要添加或修改节点,不需要启动脚本lc_bringup_launch.py
,只需要维护launch_nodes.yaml
, launch_groups.yaml
,default_param.yaml
和remappings.yaml
这四个YAML
文件即可。下面会介绍如何使用这四个文件:
该文件用于配置需要启动的节点,主要结构如下:
launch_nodes:
debug_param: "lxterminal -e gdb -ex run --args"
# Must launch, if package or executable error, launcher will stop and throw error
base_nodes:
# - example_node_def_name:
# package: "example_pkg" (string)
# executable: "example_exe" (string)
# #[optional] output_screen: false (true/false)
# #[optional] name: 'example_name' (string)
# #[optional] load_nodes_param: false (true/false)
# #[optional] enable_debug: false (true/false)
# Try to launch, if package or executable error, launcher will notice but skip that node
other_nodes:
launch_nodes
内包含1个测试参数debug_param
, 2个启动节点配置类型(base_nodes
, other_nodes
)测试参数:
enable_debug == true
时,debug_param
参数将写入ros2 Node中prefix配置类型:
base_nodes
与other_nodes
base_nodes
为基础节点,是核心功能节点,当这些节点启动失败时将会报错并停止
所有其他节点启动other_nodes
为辅助节点,是其他功能节点,当这些节点启动失败时将会提醒并跳过
该出错节点继续启动在base_nodes
与other_nodes
中即可配置需要启动的节点
定义节点配置名称(任意名称):
# - example_node_def_name:
配置节点启动的包名(根据软件包):
# package: "example_pkg" (string)
配置节点启动的可执行文件名(根据软件包):
# executable: "example_exe" (string)
配置节点标准输出位置(可缺省):
# #[optional] output_screen: false (true/false)
配置节点名称(可缺省):
# #[optional] name: 'example_name' (string)
配置是否装载外部参数(从params/default_param.yaml
载入,可缺省):
# #[optional] load_nodes_param: false (true/false)
配置是否装载debug参数(可缺省)
# #[optional] enable_debug: false (true/false)
该文件用于配置启动组,主要结构如下:
launch_groups:
target_launch_group: default
groups:
# example_group_whitlist:
# launch: #only launch:
# - example_node_def_name1
# - example_node_def_name2
# example_group_blacklist:
# except: #dont launch:
# - example_node_def_name1
# - example_node_def_name2
default:
except:
- cyberdog_motion_test_cmd
- decision_test
target_launch_group
为当前启动组groups
中配置启动组在groups
中有两种配置方式,分别为launch
和except
,但一个启动组中只能有一种启动方式
launch
:只启动所列出的全部节点except
:启动除了列出的全部节点该文件用于参数设置,主要结构如下:
# 节点名
example_node_def_name:
# 固定的,表明为ROS参数
ros__parameters:
# 参数名 和 值
value_a: 1
具体细节可参考ROS2 YAML For Parameters
该文件用于重映射,主要结构如下:
remappings:
example_node_def_name:
- ['/topic_before1','/topic_after1']
- ['/topic_before2','/topic_after2']
其中example_node_def_name
根据launch_nodes.yaml
文件中定义的节点名填写
No Description
C++ Python C SVG Text other
Dear OpenI User
Thank you for your continuous support to the Openl Qizhi Community AI Collaboration Platform. In order to protect your usage rights and ensure network security, we updated the Openl Qizhi Community AI Collaboration Platform Usage Agreement in January 2024. The updated agreement specifies that users are prohibited from using intranet penetration tools. After you click "Agree and continue", you can continue to use our services. Thank you for your cooperation and understanding.
For more agreement content, please refer to the《Openl Qizhi Community AI Collaboration Platform Usage Agreement》