服务 Services
以下 service 使用默认 /lebai 命名空间。每个响应都包含
lebai_interfaces/msg/Result:
bool success
int32 code
string message
success 为 true 表示调用成功。调用失败时,message 会包含错误信息。
启动停止 start_stop
Service |
类型 |
用途 |
|---|---|---|
|
|
启动系统。 |
|
|
停止系统。 |
|
|
关机。 |
|
|
停止机器人。 |
|
|
急停。 |
|
|
进入示教模式。 |
|
|
退出示教模式。 |
|
|
暂停运动。 |
|
|
恢复运动。 |
|
|
重启控制器。 |
示例:
ros2 service call /lebai/start_stop/start_sys lebai_interfaces/srv/Command
运动 motion
Service |
类型 |
用途 |
|---|---|---|
|
|
关节运动。 |
|
|
直线运动。 |
|
|
圆弧运动。 |
|
|
关节速度控制。 |
|
|
TCP 速度控制。 |
|
|
PVAT 运动。 |
|
|
等待指定运动完成。 |
|
|
停止当前运动。 |
|
|
跳过当前运动。 |
|
|
获取当前运动 ID。 |
|
|
获取指定运动状态。 |
关节运动示例:
ros2 service call /lebai/motion/movej lebai_interfaces/srv/MoveJoint "{
target: {
is_joint_pose: true,
joint_positions: [0.0, -0.5, 0.5, 0.0, 0.5, 0.0]
},
params: {
acceleration: 0.5,
velocity: 0.5,
time: 0.0,
blend_radius: 0.0
}
}"
查询当前运动:
ros2 service call /lebai/motion/get_running_motion lebai_interfaces/srv/GetRunningMotion
IO
Service |
类型 |
用途 |
|---|---|---|
|
|
设置数字输出。 |
|
|
读取数字输入。 |
|
|
读取数字输出。 |
|
|
设置模拟输出。 |
|
|
读取模拟输入。 |
|
|
读取模拟输出。 |
|
|
设置 DIO 模式。 |
|
|
读取 DIO 模式。 |
示例:
ros2 service call /lebai/io/set_do lebai_interfaces/srv/SetDigitalOutput "{device: robot, pin: 0, value: true}"
ros2 service call /lebai/io/get_di lebai_interfaces/srv/GetDigitalInput "{device: robot, pin: 0}"
内置夹爪 claw
Service |
类型 |
用途 |
|---|---|---|
|
|
初始化内置 claw。 |
|
|
设置 claw 力和开合幅度。 |
|
|
读取 claw 状态。 |
示例:
ros2 service call /lebai/claw/init_claw lebai_interfaces/srv/Command
ros2 service call /lebai/claw/set_claw lebai_interfaces/srv/SetClaw "{amplitude: 40.0, force: 50.0}"
ros2 service call /lebai/claw/get_claw lebai_interfaces/srv/GetClaw
发现 discovery
Service |
类型 |
用途 |
|---|---|---|
|
|
发现局域网中的 Lebai 控制器。 |
示例:
ros2 service call /lebai/discovery/resolve lebai_interfaces/srv/ResolveControllers
独立夹爪 gripper
Service |
类型 |
用途 |
|---|---|---|
|
|
设置 gripper 位置。 |
|
|
设置 gripper 力。 |
|
|
设置 gripper 速度。 |
|
|
执行标定。 |
|
|
开启自动标定。 |
|
|
关闭自动标定。 |
示例:
ros2 service call /lebai/gripper/set_position lebai_interfaces/srv/SetGripperPosition "{position: 50}"
ros2 service call /lebai/gripper/set_force lebai_interfaces/srv/SetGripperForce "{force: 50}"
ros2 service call /lebai/gripper/set_velocity lebai_interfaces/srv/SetGripperVelocity "{velocity: 50, persistent: false}"