feat: configure FRI position smoothing

This commit is contained in:
Даниил Грабарь
2026-09-16 15:06:17 +10:00
parent 29a1601061
commit 1780532f51
14 changed files with 67 additions and 11 deletions
@@ -1,3 +1,4 @@
import math
import os
from dataclasses import dataclass, fields, is_dataclass
from typing import Any, Dict, List, Optional, Type, TypeVar
@@ -15,6 +16,7 @@ class RobotCfg:
port: int
description: str
fri_cycle_ms: int
joint_position_tau: float
@dataclass(frozen=True)
@@ -282,12 +284,16 @@ def build_settings(settings_path: str, check_files: bool = True) -> Settings:
# robot
robot_raw = require(raw, "robot")
joint_position_tau = float(robot_raw.get("joint_position_tau", 0.04))
if not math.isfinite(joint_position_tau) or joint_position_tau < 0.0:
raise ValueError("robot.joint_position_tau must be a finite value >= 0")
robot = RobotCfg(
name=str(require(robot_raw, "name")),
ip=str(require(robot_raw, "ip")),
port=int(require(robot_raw, "port")),
description=resolve_path(str(require(robot_raw, "description")), settings_dir),
fri_cycle_ms=int(robot_raw.get("fri_cycle_ms", 5)),
joint_position_tau=joint_position_tau,
)
# digital_twin