update
This commit is contained in:
parent
891529a095
commit
d18ccb33f2
@ -338,22 +338,22 @@ def test_dexhand():
|
||||
valid_dof_ids = set(dof_id_to_name.keys())
|
||||
|
||||
# 1. 获取初始状态
|
||||
# print("\n--- 获取初始状态 ---")
|
||||
# error_code, state = dexhand.get_status()
|
||||
# if error_code == CMVRErrorCode.CMVR_SUCCESS:
|
||||
# print(f"初始化状态: 已初始化={state.is_initialized}")
|
||||
# print("各自由度状态:")
|
||||
# for hand in state.hands:
|
||||
# # 匹配字符串ID对应的手指名称,未知ID显示原始值
|
||||
# finger_name = dof_id_to_name.get(hand.dof_id, f"未知自由度({hand.dof_id})")
|
||||
# print(f" {finger_name} (ID:{hand.dof_id}): 角度={hand.angle}, 速度={hand.speed}, "
|
||||
# f"受力={hand.force}, 位置={hand.position}, 温度={hand.temperature}°C")
|
||||
# if hand.error != 0:
|
||||
# print(f" 警告: {finger_name} 存在故障: {hand.error_message}")
|
||||
# else:
|
||||
# print(f"获取初始状态失败,错误码: {error_code}")
|
||||
# client.close()
|
||||
# return
|
||||
print("\n--- 获取初始状态 ---")
|
||||
error_code, state = dexhand.get_status()
|
||||
if error_code == CMVRErrorCode.CMVR_SUCCESS:
|
||||
print(f"初始化状态: 已初始化={state.is_initialized}")
|
||||
print("各自由度状态:")
|
||||
for hand in state.hands:
|
||||
# 匹配字符串ID对应的手指名称,未知ID显示原始值
|
||||
finger_name = dof_id_to_name.get(hand.dof_id, f"未知自由度({hand.dof_id})")
|
||||
print(f" {finger_name} (ID:{hand.dof_id}): 角度={hand.angle}, 速度={hand.speed}, "
|
||||
f"受力={hand.force}, 位置={hand.position}, 温度={hand.temperature}°C")
|
||||
if hand.error != 0:
|
||||
print(f" 警告: {finger_name} 存在故障: {hand.error_message}")
|
||||
else:
|
||||
print(f"获取初始状态失败,错误码: {error_code}")
|
||||
client.close()
|
||||
return
|
||||
|
||||
# 1.1 获取初始传感器数据
|
||||
print("\n--- 获取初始传感器数据 ---")
|
||||
|
||||
Loading…
Reference in New Issue
Block a user