Models¶
This page specifies the configuration models defined by inorbit_connector.models.
ConnectorRootConfig¶
Top-level configuration model for connectors. Subclasses BaseSettings from pydantic-settings and is generic over T: ConnectorSpecificConfig.
Key points:
Parametrize with a concrete
ConnectorSpecificConfigsubclass to get typedconnector_configaccess:ConnectorRootConfig[MyConfig](**yaml_data).Resolves
INORBIT_*environment variables and readsconfig/.envat instantiation time via pydantic-settings. Init kwargs (typically values from a YAML file) take precedence over env vars.fleetmust contain at least oneRobotConfig, and robot IDs must be unique.When
connector_configarrives as a dict, the model validator constructs it via__init__(notmodel_validate) to preserve env-var resolution. The_env_fileinit kwarg is forwarded to the nested constructor for consistent dotenv behavior.
to_singular_config(robot_id) -> Self¶
Returns a config instance of the same type, with fleet filtered down to exactly the requested robot.
ConnectorSpecificConfig¶
Base class for per-connector vendor configuration. Subclasses BaseSettings from pydantic-settings.
Subclass this and set the CONNECTOR_TYPE class variable. The framework automatically configures env-var loading with the prefix INORBIT_{CONNECTOR_TYPE}_ and reads config/.env.
from inorbit_connector.models import ConnectorSpecificConfig
class AcmeConfig(ConnectorSpecificConfig):
CONNECTOR_TYPE = "acme"
fleet_host: str
fleet_api_key: str = "default"
With this definition, INORBIT_ACME_FLEET_HOST and INORBIT_ACME_FLEET_API_KEY are resolved from the environment. Init kwargs take precedence over env vars.
Connectors with custom env-loading needs (e.g. per-robot prefixes) can subclass BaseSettings directly instead.
RobotConfig¶
Per-robot configuration:
robot_id: the InOrbit robot ID.cameras: list of Edge SDKCameraConfigobjects. Camera registration is performed automatically during connector startup.
MapConfig / MapConfigTemp¶
These models describe map metadata and image source.
MapConfig: file-backed map withfile: FilePathpointing to a.png.MapConfigTemp: in-memory map payload withimage: bytes.
Both carry metadata via MapConfigBase:
map_id, optionalmap_labelorigin_x,origin_y,resolutionformat_version(must be 1 or 2)
LoggingConfig¶
Logging configuration used by the connector at startup:
config_file: path to a logging config file (defaults to the package’slogging.default.conf).log_level: optional override for the root logger level.defaults: dictionary passed to the logging config (e.g.log_file).
See setup_logger() for how it is applied.