add estop function

This commit is contained in:
NuoDaJia
2026-03-03 17:03:37 +08:00
parent b38c071d85
commit 4f02323091
4 changed files with 27 additions and 0 deletions

View File

@@ -32,6 +32,7 @@ set(msg_files
msg/ArmMotionParams.msg
msg/ArmError.msg
msg/GripperStatus.msg
msg/EStopState.msg
)
set(action_files
action/MoveToPosition.action
@@ -61,6 +62,7 @@ set(srv_files
srv/ClearArmError.srv
srv/InverseKinematics.srv
srv/SetArmEnable.srv
srv/ResetEStop.srv
)
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/include")

12
src/msg/EStopState.msg Normal file
View File

@@ -0,0 +1,12 @@
# EStopState.msg
# 急停状态广播消息由HAL/驱动层向上游发布)
#
# 语义:
# - latched=true 表示急停已触发并处于锁存态
# - generation 每次“新触发事件”递增,便于上层检测边沿
builtin_interfaces/Time stamp # 状态时间戳
bool latched # 急停锁存状态
uint8 source # 触发源0=unknown,1=io,2=plc,3=driver_fault,4=software
string reason # 触发原因文本
uint32 generation # 触发代次(单调递增)

View File

@@ -3,5 +3,7 @@ string[] joint_names
float64[] joint_positions
bool[] joint_enabled
int32[] joint_error_codes
bool estop_latched
uint32 estop_generation
geometry_msgs/Pose left_arm_pose
geometry_msgs/Pose right_arm_pose

11
src/srv/ResetEStop.srv Normal file
View File

@@ -0,0 +1,11 @@
# ResetEStop.srv
# 急停复位服务(用于清除上层软件锁存态)
#
# 注意:
# - 该服务仅表达“复位请求”,是否允许复位由安全链路策略决定
# - 硬件安全回路未恢复时,应返回 success=false
bool reset # true=请求复位false=无效请求
---
bool success # true=复位成功false=复位失败
string message # 结果描述(失败原因/诊断信息)