rebot_control.config¶
Configuration objects: the arm (hardware, gains, safety) and the tool (TCP + payload).
Both are plain dataclasses loaded from YAML. Angles are stored in radians in memory (YAML files use degrees,
see the *_deg keys); see docs/developer/conventions.md for every unit and frame convention.
Module Contents¶
Classes¶
Per-joint friction model |
|
Torque ripple that repeats with the joint angle: |
|
An end effector: TCP pose and payload, both expressed in |
|
Results of the self-calibration tools for one physical arm (see |
Data¶
API¶
- rebot_control.config.PACKAGE_DIR = None¶
- rebot_control.config.ASSET_DIR = None¶
- rebot_control.config.CONFIG_DIR = None¶
- class rebot_control.config.MotorConfig¶
- can_id: int = None¶
- model: str = None¶
- feedback_id: int = 253¶
- direction: float = 1.0¶
- offset: float = 0.0¶
- class rebot_control.config.BusConfig¶
- type: str = 'robstride'¶
- channel: str = 'can0'¶
- feedback_wait_s: float = 0.003¶
- class rebot_control.config.GainConfig¶
- kp: numpy.ndarray = None¶
- kd: numpy.ndarray = None¶
- gravity_mode_kd: numpy.ndarray = None¶
- ramp_s: float = 0.5¶
- class rebot_control.config.FeedforwardConfig¶
- gravity: bool = True¶
- gravity_scale: float = 1.0¶
- friction_scale: float = 0.0¶
- ripple_scale: float = 1.0¶
- tau_max: numpy.ndarray = 'field(...)'¶
- class rebot_control.config.SafetyConfig¶
- soft_limits: numpy.ndarray = None¶
- max_jump: float = 'radians(...)'¶
- max_joint_speed: float = 'radians(...)'¶
- filter_tau_s: float = 0.1¶
- max_error: float = 'radians(...)'¶
- lag: float = 'radians(...)'¶
- stall_time_s: float = 1.0¶
- stall_progress: float = 'radians(...)'¶
- on_stall: str = 'hold'¶
- on_overtemp: str = 'disable'¶
- slow_lag: float = 'radians(...)'¶
- temp_warn_c: float = 115.0¶
- temp_stop_c: float = 125.0¶
- class rebot_control.config.PoseConfig¶
- zero: numpy.ndarray = None¶
- unfold_first: list[int] = 'field(...)'¶
- fold_stages: list[list[int]] = 'field(...)'¶
- move_speed: float = 'radians(...)'¶
- class rebot_control.config.SimConfig¶
- physics_hz: float = 1050.0¶
- damping: numpy.ndarray = 'field(...)'¶
- frictionloss: numpy.ndarray = 'field(...)'¶
- torque_noise: float = 0.0¶
- class rebot_control.config.FrictionParams¶
Per-joint friction model
tau = fc * tanh(v / vs) + fv * v + bias(fc may differ by direction).- fc_pos: numpy.ndarray = None¶
- fc_neg: numpy.ndarray = None¶
- fv: numpy.ndarray = None¶
- vs: numpy.ndarray = None¶
- bias: numpy.ndarray = None¶
- classmethod zeros(n: int) rebot_control.config.FrictionParams¶
- torque(v: numpy.ndarray) numpy.ndarray¶
- to_dict() dict¶
- classmethod from_dict(d: dict, n: int) rebot_control.config.FrictionParams¶
- class rebot_control.config.RippleParams¶
Torque ripple that repeats with the joint angle:
tau = a1 sin(N q) + b1 cos(N q) + a2 sin(2 N q) + b2 cos(2 N q).cycles(N) is the number of periods per turn of the joint, e.g. pole pairs x gear ratio. The model is the extra torque the motor must produce to move evenly; it is fed forward at the measured angle. That makes it a position feedback of up toN * amplitudeN*m/rad, negative when the phase is wrong, socheck()refuses a model that could cancel more thanmax_shareof the position gain. The phase belongs to the joint’s zero: after re-zeroing a motor the model must be calibrated again.- cycles: numpy.ndarray = None¶
- a1: numpy.ndarray = None¶
- b1: numpy.ndarray = None¶
- a2: numpy.ndarray = None¶
- b2: numpy.ndarray = None¶
- classmethod zeros(n: int) rebot_control.config.RippleParams¶
- torque(q: numpy.ndarray) numpy.ndarray¶
- amplitude() numpy.ndarray¶
Largest torque of the model per joint (upper bound: both harmonics in phase).
- stiffness() numpy.ndarray¶
Largest
|d tau / d q|per joint (N*m/rad).
- check(kp: numpy.ndarray, scale: float = 1.0, max_share: float = 0.75) None¶
- to_dict() dict¶
- classmethod from_dict(d: dict, n: int) rebot_control.config.RippleParams¶
- class rebot_control.config.ArmConfig¶
- name: str = None¶
- urdf: pathlib.Path = None¶
- flange_frame: str = None¶
- joints: list[str] = None¶
- bus: rebot_control.config.BusConfig = None¶
- motors: list[rebot_control.config.MotorConfig] = None¶
- control_hz: float = None¶
- servo_hz: float = None¶
- gains: rebot_control.config.GainConfig = None¶
- feedforward: rebot_control.config.FeedforwardConfig = None¶
- rotor_inertia: numpy.ndarray = None¶
- safety: rebot_control.config.SafetyConfig = None¶
- poses: rebot_control.config.PoseConfig = None¶
- sim: rebot_control.config.SimConfig = None¶
- friction: rebot_control.config.FrictionParams = None¶
- ripple: rebot_control.config.RippleParams | None = None¶
- source: pathlib.Path | None = None¶
- property n: int¶
- classmethod load(name_or_path: str | pathlib.Path = 'b601_rs', overrides: dict | None = None) rebot_control.config.ArmConfig¶
- classmethod from_dict(d: dict[str, Any], source: pathlib.Path | None = None) rebot_control.config.ArmConfig¶
- class rebot_control.config.ToolConfig¶
An end effector: TCP pose and payload, both expressed in
mount_frame(the flange, link6).- name: str = 'none'¶
- mount_frame: str = 'link6'¶
- tcp_xyz: numpy.ndarray = 'field(...)'¶
- tcp_rpy: numpy.ndarray = 'field(...)'¶
- mass: float = 0.0¶
- com: numpy.ndarray = 'field(...)'¶
- inertia: numpy.ndarray | None = None¶
- home: numpy.ndarray | None = None¶
- cartesian: dict = 'field(...)'¶
- source: pathlib.Path | None = None¶
- extra: dict = 'field(...)'¶
- classmethod load(name_or_path: str | pathlib.Path = 'none') rebot_control.config.ToolConfig¶
- classmethod from_dict(d: dict, source: pathlib.Path | None = None) rebot_control.config.ToolConfig¶
- to_dict() dict¶
- save(path: str | pathlib.Path) None¶
- class rebot_control.config.Calibration¶
Results of the self-calibration tools for one physical arm (see
rebot-calib).link_params: identified mass and centre of mass per link ({link: {"mass": m, "com": [x, y, z]}}, COM in the link frame);friction:FrictionParams;ripple:RippleParams;gains: tunedkp/kd(rad units);feedforward: scales that go with these models on this arm (friction_scale,ripple_scale,gravity_scale), overriding the arm config’s.- link_params: dict[str, dict] = 'field(...)'¶
- friction: rebot_control.config.FrictionParams | None = None¶
- ripple: rebot_control.config.RippleParams | None = None¶
- feedforward: dict[str, float] = 'field(...)'¶
- gains: dict[str, list[float]] = 'field(...)'¶
- meta: dict = 'field(...)'¶
- classmethod load(path: str | pathlib.Path, n: int = 6) rebot_control.config.Calibration¶
- save(path: str | pathlib.Path) None¶
- merge(other: rebot_control.config.Calibration) rebot_control.config.Calibration¶
Fields set in
otherreplace the ones here.
- apply_to(cfg: rebot_control.config.ArmConfig) None¶
Copy friction and gains into an arm config (link params are applied by the model).