sas
Modularised monitoring, logging, and control of robots.
Loading...
Searching...
No Matches
core.papers.icra2019._debug Namespace Reference

Functions

dict[str, bool] normalize_verbose (Verbose verbose)
str _tag (str category, int index)
None _violation (str description)
None debug_rcm (dict[str, bool] verbose, int index, float signed_error, float vfi_gain)

Variables

tuple CONSTRAINT_CATEGORIES
 Verbose = bool | dict[str, bool]

Detailed Description

Standardized debug output for the ICRA 2019 task-space controller.

Every debug line starts with a fixed-width category tag (for example
``[rcm       #0]``) followed by ``key=value`` fields with a fixed numeric
format, so the per-constraint margins printed at a control step are easy to
read and to grep. The available categories are listed in
:data:`CONSTRAINT_CATEGORIES`; the ``verbose`` argument accepted by the
public API has the type :data:`Verbose` (``True`` enables every category,
``False`` disables all of them, and a mapping selects individual
categories).

Function Documentation

◆ _tag()

str _tag ( str category,
int index )
protected
Return the fixed-width debug tag for a category and entity index.

Args:
    category: One of :data:`CONSTRAINT_CATEGORIES`.
    index: Index of the entity the message refers to (RCM constraint).

Returns:
    A tag such as ``[rcm       #0]``.

◆ _violation()

None _violation ( str description)
protected
Print an indented red line describing a violated constraint.

Args:
    description: Human-readable description of the violation, including
        any measured depth.

◆ debug_rcm()

None debug_rcm ( dict[str, bool] verbose,
int index,
float signed_error,
float vfi_gain )
Print the RCM-constraint debug block for one constraint.

Args:
    verbose: Per-category flags from :func:`normalize_verbose`.
    index: RCM constraint index.
    signed_error: Signed line-to-point error scaled by the VFI gain
        (m^2).
    vfi_gain: VFI gain applied to the constraint; the violation depth
        is recovered as ``sqrt(-signed_error / vfi_gain)``.

◆ normalize_verbose()

dict[str, bool] normalize_verbose ( Verbose verbose)
Normalize a ``verbose`` setting into a per-category flag mapping.

Args:
    verbose: ``True`` enables every category, ``False`` disables all of
        them, and a mapping selects individual categories.

Returns:
    A mapping with one boolean entry per
    :data:`CONSTRAINT_CATEGORIES` category.

Raises:
    ValueError: If the mapping contains an unknown category name.
    TypeError: If ``verbose`` is neither a bool nor a mapping.

Variable Documentation

◆ CONSTRAINT_CATEGORIES

tuple core.papers.icra2019._debug.CONSTRAINT_CATEGORIES
Initial value:
= (
"rcm",
)