Configuration¶
The inorbit-connector framework uses Pydantic models for configuration, providing validation and type safety.
ConnectorConfig¶
The main configuration class is ConnectorConfig, which contains all settings for your connector. It includes a fleet field containing a list of RobotConfig entries.
Connectors should subclass inorbit_connector.models.ConnectorConfig and define a connector_config field that contains the configuration for the connector. For more details see the Creating a Custom Configuration section below.
Key Fields¶
api_key(str | None): The InOrbit API key. Can be set via environment variableINORBIT_API_KEYapi_url(HttpUrl): The URL of the InOrbit API endpoint. Defaults to InOrbit Cloud SDK URL. Can be set via environment variableINORBIT_API_URLconnector_type(str): A string identifier for your connector type (e.g., “example_bot”)connector_config(BaseModel): Your custom configuration model that inherits from Pydantic’sBaseModel. This is where you define connector-specific fieldsupdate_freq(float): Update frequency in Hz for the execution loop. Default is 1.0location_tz(str): The timezone of the robot location (e.g., “America/Los_Angeles”, “UTC”). Must be a valid pytz timezonelogging(LoggingConfig): Logging configuration (see below)maps(dict[str, MapConfig]): Dictionary mapping frame_id to map configuration (see below)env_vars(dict[str, str]): Environment variables to be set in the connector or user scriptsfleet(list[RobotConfig]): List of robot configurations (see below)user_scripts_dir(DirectoryPath | None): Path to directory containing user scripts for command executionaccount_id(str | None): InOrbit account ID, required for publishing footprintsinorbit_robot_key(str | None): Robot key for InOrbit Connect robots. See API documentation
Environment Variables¶
The following environment variables are automatically read during configuration:
INORBIT_API_KEY(required): The InOrbit API keyINORBIT_API_URL(optional): The InOrbit API endpoint URL
RobotConfig¶
Represents configuration for a single robot in the fleet:
robot_id(str): The InOrbit robot IDcameras(list[CameraConfig]): List of camera configurations for this robot
MapConfig¶
Configuration for a map that can be associated with a frame_id:
file(FilePath): Path to the PNG map filemap_id(str): The map identifiermap_label(str, optional): Human-readable map labelorigin_x(float): X coordinate of the map originorigin_y(float): Y coordinate of the map originresolution(float): Map resolution in meters per pixel
LoggingConfig¶
Configuration for logging:
config_file(FilePath | None): Path to logging configuration file. If not set, uses default configurationlog_level(LogLevels | None): Log level (DEBUG, INFO, WARNING, ERROR, CRITICAL). Overrides the level set in the config filedefaults(dict[str, str]): Default values to pass to the logging configuration file (e.g., log file path)
Creating a Custom Configuration¶
To create a connector-specific configuration, subclass ConnectorConfig:
from pydantic import BaseModel
from inorbit_connector.models import ConnectorConfig, RobotConfig
class MyRobotConfig(BaseModel):
"""Custom fields for your robot."""
api_version: str
hardware_revision: str
custom_setting: str
class MyConnectorConfig(ConnectorConfig):
"""Configuration for your connector."""
connector_config: MyRobotConfig
@field_validator("connector_type")
def check_connector_type(cls, connector_type: str) -> str:
if connector_type != "my_connector":
raise ValueError(f"Expected connector type 'my_connector'")
return connector_type
Configuration Files¶
Configuration is typically loaded from YAML files. See:
Single robot:
examples/example.yamlFleet:
examples/example.fleet.yaml
Use inorbit_connector.utils.read_yaml() to load configuration from YAML files:
from inorbit_connector.utils import read_yaml
yaml_data = read_yaml("config.yaml")
config = MyConnectorConfig(**yaml_data)