控制器 ROS 2 参数

arms_ros2_control 公开控制器的 ROS 2 参数。代码钉在 9a1da3ba。仅启动 / 运行时 措辞与 pull request #120(e1b7a147)的 README 一致。如何加载与查看:配置 ROS 2 控制器参数。话题与 FSM 整数见各控制器页面(此处不重复)。

权威来源

名称、类型和默认值来自链接的 README(README 有说明时,则以该代码钉上的 auto_declare / declare_parameter 为准)。何时生效 标记与 #120 相同:运行时 / 仅启动 / 未核实。框架共性键(joints、update_rate、command_interfaces、state_interfaces,以及可选的 command_prefix)只写在操作指南。

如何读这些表

三列:参数、类型 / 默认值、含义(何时生效写在含义的最后一句)。

标记

依据(#120)

运行时

下次进入 HOME、进入 MOVEJ / 关节命令、腰部位置规划、插值 MoveL,或 MOVEJ cartesian_defaults 时 get_parameter

仅启动

在 on_init / 构造函数 / 首次创建腰部规划器时写入成员;或 README 所说的「重新加载 / 重启」

未核实

#120 中这些表里已文档化的键都不是未核实

config/ocs2/*.info 不是 ROS 2 参数服务器。robot_name 选择 {robot_name}_description;任务文件是 {pkg}/config/ocs2/task.info,除非 launch YAML 设置了 info_file_name。

Basic Joint Controller

插件 basic_joint_controller/BasicJointController。同时声明框架共性键。Home 键:共用 Home。README #120 / README_zh。话题:Basic Joint Controller。操作:使用 Basic Joint Controller。

这是 MoveJ 参数主表。灵巧手的 target_command_* 也在本控制器上(不是 Adaptive Gripper Controller)。

MoveJ

以下为 README 默认值。OCS2 Arm Controller 上共用的 C++ auto_declare 使用 movej_interpolation_type "linear" 和 movej_trajectory_blend_ratio 0.2 — 见该页差值,不要再复制一张 MoveJ 表。

参数

类型 / 默认值

含义

movej_duration

double / 3.0

target_joint_position 的时长下限(tanh / linear / doubles)

movej_interpolation_type

string / "tanh"(README YAML)

"tanh" | "linear" | "doubles" | "none"(README_zh 还有 "servo")

movej_tanh_scale

double / 3.0

tanh 尺度

movej_trajectory_duration

double / 3.0

多路点时长

movej_trajectory_blend_ratio

double / 0.0

路点融合

movej_max_velocity

double / 2.0

关节峰值速度;可能拉长 duration

movej_max_acceleration

double / 4.0

仅 doubles

movej_max_jerk

double / 20.0

仅 doubles

movej_auto_extend_duration

bool / true

false 保持固定时长

none 不会按 duration 拉长。路点省略这些数组时,joint_trajectory_with_para 仍用同一套 vel/acc/jerk。

MOVEJ 的 cartesian_defaults.*(有 lina_planning 时的 IK MoveL)在下一条 MOVEJ 命令时 运行时生效 — #120 中的 arms_target_manager README。

灵巧手(target_command)

参数

类型 / 默认值

含义

target_command_enabled

bool / false

开关/比例话题

target_command_close_config

int / 1

Home 构型中的闭合位索引(从 0 计)

target_command_open_config

int / 0

张开位索引

腰部

只有 waist_lifting_duration 是 运行时。类型、速度三元组、运动学和 TF 坐标系都是 仅启动(首次创建规划器或 on_init)。

参数

类型 / 默认值

含义

waist_lifting_enabled

bool / false

声明腰部参数和话题

waist_lifting_type

string / "three_joint"

"three_joint" | "single_joint"

waist_lifting_duration

double / 3.0

下次腰部位置规划时重读

waist_lifting_default_parameter

double[3] / [0.25, 1.0, 5.0]

[max_speed, accel, decel]

waist_turning_default_parameter

double[3] / [0.25, 1.0, 5.0]

[max_speed, accel, decel]

waist_absolute_source_frame

string / "base_footprint"

绝对 (x, z)(W2 默认)

waist_absolute_target_frame

string / "body_base"

phi / 相对规划

waist_l1 / waist_l2

double / 0.322 / 0.355

three_joint

waist_rotation_direction

double[3] / [1, 1, 1]

three_joint

waist_angle_offset

double[3] / [0, 0, 0]

three_joint

waist_single_joint_direction

double / 1.0

single_joint(ARX Lift / Lift 2S)

waist_single_joint_offset

double / 0.0

single_joint

waist_single_joint_pitch_joint

string / "_no_pitch_"(README)

名称不在 joints 中则禁用 pitch。源码 auto_declare 默认是 "body_joint2"

waist_single_joint_pitch_direction

double / 1.0

single_joint

waist_single_joint_pitch_offset

double / 0.0

single_joint

Lift 2S 示例(body_joint_controller):waist_lifting_enabled: true,waist_lifting_type: single_joint,waist_absolute_source_frame: base_link,waist_absolute_target_frame: lift_link。Overlay:arx_lift2s_description/.../ros2_controllers.yaml。

Adaptive Gripper Controller

夹爪。插件 adaptive_gripper_controller/AdaptiveGripperController。README 配置参数。命令通道:Adaptive Gripper Controller。开合限位来自 /robot_description。

使用单数 joint,不是 joints。update_rate 以及 ControllerInterface 的命令/状态列表在加载时 仅启动。没有 on_set_parameters 回调,update() 里也不重读。

参数

类型 / 默认值

含义

joint

string / "gripper_joint"

被控关节

use_effort_interface

bool / true

绑定 effort 状态以做力反馈

force_threshold

double / 0.1

触发反馈的 effort 幅值

force_feedback_ratio

double / 0.5

触发后:0.0 停在当前位置,1.0 继续到原目标

OCS2 Arm Controller

插件 ocs2_arm_controller/Ocs2ArmController。同时声明框架共性键和共用 Home 名称。README #120。FSM / launch:OCS2 Arm Controller。公开 YAML:cr5_description/.../ros2_controllers.yaml。可选双臂 overlay 仅在 robot_descriptions 的 feature/agilex:taku_description/.../ros2_controllers.yaml。

README 的 FSM 是 HOME / HOLD / OCS2(3 = OCS2)。源码还会为规范 /fsm_command 4 构造 StateMoveJ(有 lina_planning 时还有 IK MoveL)。MoveJ 参数以 Basic Joint 页为准,此处不重复整表。 相对 Basic Joint 的声明期差值:movej_interpolation_type 默认 "linear",movej_trajectory_blend_ratio 为 0.2。启用 waist_lifting_enabled 时腰部键沿用 Basic Joint 腰部表(只有 waist_lifting_duration 是运行时)。

旧 README 名称在此提交不是参数:zero_pos(改用 rest_pos)、robot_pkg(改用 robot_name)、force_gains(改用 default_gains / pd_gains)。

参数

类型 / 默认值

含义

home_pos

double[]

没有 home_1… 时的遗留单组 Home

rest_pos

double[]

已有 home_1 时的额外 Home 槽

robot_name

string / "cr5"

选择 {robot_name}_description 和 OCS2 文件

default_gains

double[]

存在 MIX 接口时,HOME / HOLD 阻抗 [kp, kd]

pd_gains

double[]

OCS2 状态阻抗 [kp, kd]

base_frame

task.info baseFrame

模型 / 参考基座

left_ee_frame

task.info eeFrame

左末端(YAML 可写成 left_tcp)

right_ee_frame

task.info eeFrame1

右末端

movel_duration

2.0 (CR5 YAML 0.5)

MoveL 时长(秒)。运行时(下一条插值 / 带时间戳命令)。

movel_trajectory_duration

2.0

MoveL 轨迹时长

movel_sample_interval

0.04

采样间隔

movel_max_linear_velocity

0.3

线速度上限

movel_max_linear_acceleration

1.0

线加速度上限

movel_max_linear_jerk

2.0

线 jerk 上限

movel_max_angular_velocity

1.0

角速度上限

movel_max_angular_acceleration

2.0

角加速度上限

movel_max_angular_jerk

4.0

角 jerk 上限

movel_auto_extend_duration

true

限幅需要时拉长 MoveL duration

YAML 坐标系覆盖在 Interface 构造时注入内存。

arms_target_manager

这是命令节点,不是 ros2_control 控制器。README:#120。笛卡尔话题:FSM 与话题、Adaptive Gripper Controller。

YAML:包内 config/default.yaml,或机型 config/ocs2/target_manager.yaml。

main 里 declare_parameter 后把值送进构造函数。没有 on_set_parameters 回调,之后也不再 get_parameter。下表每一行都是 仅启动。控制器坐标系(base_frame、left_ee_frame、right_ee_frame、WBC 的 body_frame)属于控制器节点——那边也是

参数

默认值

含义

dual_arm_mode

launch / task.info;C++ 为 false

双臂标记

control_base_frame

launch / task.info;C++ 为 "world"

控制基座

hand_controllers

launch / task.info;C++ 为 []

手部控制器名称

marker_fixed_frame

"base_link"

RViz 标记的固定坐标系

enable_movej_cartesian_markers

有 lina_planning 则为 true,否则 false;full_body.launch.py 在 WBC 下设为 false

MOVEJ 机械臂标记 → 带时间戳的 IK MoveL

enable_head_control

false

遗留的头部 RPY 转关节标记(/head_joint_controller/target_joint_position)

enable_wbc_head_tracking_marker

false

WBC 头部 6D 标记;仍需 FSM=OCS2 且 HEAD_TRACKING

linear_scale

0.1

满杆线速度 twist(m/s)

angular_scale

0.25

满杆角速度 twist(rad/s)

control_input_rate

50.0

典型 control_input Hz(手感,无硬实时保证)

vr_thumbstick_linear_scale

0.005

VR 摇杆线位移步进(m/step)

vr_thumbstick_angular_scale

0.05

VR 摇杆角位移步进(rad/step)

enable_vr

default.yaml 为 false;C++ declare 为 true

是否启用 VR 处理。Launch YAML 会覆盖 C++ 默认值

OCS2 WBC Controller

controller/ocs2_wbc_controller 是私有子模块。开通后的参数名见该包 README。公开启动:ros2 launch ocs2_arm_controller full_body.launch.py — OCS2 WBC Controller。额外坐标系 body_frame 按 #120 的 target-manager 说明为

公开 YAML 仍可能有 ocs2_wbc_controller: 块(Lift 2S 的 home_3 / home_4;feature/agilex 上的 Taku)。把这些键当作机型 overlay;参数清单以私有 README 为准。