启用机器人关节上下限检查

This commit is contained in:
zhangshun
2026-06-16 12:41:36 +08:00
parent c2d79a74b9
commit e26b04e915
3 changed files with 177 additions and 6 deletions

View File

@@ -187,6 +187,14 @@ async function runRenamedUrdfChainCase(module) {
};
}
// 发送超过 URDF 关节上下限的 FK 请求,确认底层会拒绝计算。
async function runJointLimitCase(module) {
const response = callBusinessApi(module, buildForwardRequest("abb_irb120_3_58", [7, 0, 0, 0, 0, 0]));
ensure(response.success === false, "joint limit case should fail at response level");
ensure(String(getByPath(response, "res_data.error")).includes("Forward kinematics calculation failed"), "joint limit error is missing");
return response;
}
function assertStaticCase(response, assertions) {
for (const assertion of assertions) {
const actual = getByPath(response, assertion.path);
@@ -402,6 +410,10 @@ const suite = [
id: "kinematics_renamed_urdf_chain",
type: "renamed_urdf_chain",
},
{
id: "kinematics_joint_limit_rejects_fk",
type: "joint_limit",
},
{
id: "spc_basic_5x30",
type: "static",
@@ -573,6 +585,8 @@ async function runCase(module, testCase) {
return runRoundtripPathCase(module, testCase);
case "renamed_urdf_chain":
return runRenamedUrdfChainCase(module, testCase);
case "joint_limit":
return runJointLimitCase(module, testCase);
default:
throw new Error(`Unknown test type: ${testCase.type}`);
}