feat: configure FRI position smoothing
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user