本技术栈中的 ros2_control

FiveAges Sim 如何选择硬件插件 以及 如何加载控制器。这不是通用 ros2_control 教程。

权威来源

上游生命周期 / QoS /「Controller Manager 一般如何工作」见 ros2_control 文档。不要把那些页面当作本技术栈的话题或参数列表。

该 launch 参数做什么

build_xacro_mappings() 始终把 ros2_control_hardware_type 设为 launch 的 hardware 字符串。当 hardware:=gz 时还会把 gazebo 设为 true。Profile YAML 的 hardware:(串口、arm_ctrl_mode 等)仅在 hardware:=real 时注入。

已文档化的 launch 取值(robot_common_launch、Acone xacro、demo.launch.py):

hardware:= 参数

Acone xacro 插件

说明

mock_components(默认)

mock_components/GenericSystem

无 Gazebo / Isaac。此 xacro 没有 hardware:=mock 分支。

gz

gz_ros2_control/GazeboSimSystem

ocs2_arm README:安装 ros-jazzy-ros-gz 和 ros-jazzy-gz-ros2-control

Isaac

gz_ros2_control/GazeboSimSystem

Acone 参数:/isaac/joint_command、/isaac/joint_states。需构建 topic_based_ros2_control(arms_ros2_control README)

真机

厂商插件(Acone:arx_ros2_control/ArxX5Hardware)

其他品牌:使用该描述包 xacro/ros2_control/*.xacro 中的插件类。

launch_arg_utils.py 中的 REAL_HARDWARE 只有 real。

可选控制器 overlay:若存在 <robot>_description/config/ros2_control/<hardware>.yaml,load_robot_config 会合并它。common README 示例:arx_lift2s + hardware:=isaac 合并 isaac.yaml。没有文件则不 overlay。

控制器

摘自 arms_ros2_control 的 README / launch:

软件包

作用

Basic Joint Controller

HOME / HOLD / MOVEJ;分体控制中的身体/头部/灵巧手(basic_joint_controller)

OCS2 Arm Controller

机械臂 MPC;demo.launch.py / split_body.launch.py(ocs2_arm_controller)

OCS2 WBC Controller

通过 full_body.launch.py 做全身控制(ocs2_wbc_controller)

Adaptive Gripper Controller

夹爪(adaptive_gripper_controller)

分体 vs 全身:分体控制 vs 全身控制。操作指南:使用 Basic Joint Controller。

命令接口与状态接口

ocs2_arm_controller README — Interface Configuration:控制器根据机器人配置中存在的接口检测模式。

模式

命令

状态

位置(默认)

position

velocity

力控(自动)

position, velocity, effort, kp, kd

position, velocity, effort

上表是 OCS2 MIX / MIT 路径(Panthera HT / 方舟无限)。天玑 / 珞石 的控制器只发位置命令;关节阻抗是驱动层上的厂商 ctrl_mode(marvin-ros2-control 的 JOINT_IMPEDANCE)。VR 对比:VR 遥操作。

本技术栈没有统一的 /target_pose 或 /target_joint_positions(JointState)。basic_joint_controller 上的 MoveJ 是 /{controller}/target_joint_position(std_msgs/Float64MultiArray)。FSM:/fsm_command(std_msgs/Int32)。Action / Service 类型以及 WBC 身体/头部话题:FSM 与话题。