SubclassDocumentation Index
Fetch the complete documentation index at: https://inorbitinc.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
inorbit_connector.connector.Connector to create a connector for a single robot.
Constructor
robot_id(str): The InOrbit robot IDconfig(ConnectorConfig): The connector configuration
register_user_scripts(bool): Automatically register user scripts. Default:Falsedefault_user_scripts_dir(str): Default directory for user scripts. Default:~/.inorbit_connectors/connector-{robot_id}/local/create_user_scripts_dir(bool): Create the user scripts directory if it doesn’t exist. Default:Falseregister_custom_command_handler(bool): Automatically register the command handler. Default:True
Required Methods
Subclasses must implement the following abstract methods:_connect()
Set up external services and connections. This is called once when the connector starts, before the execution loop begins.
_execution_loop()
The main execution loop that runs periodically. This is where you fetch robot data and publish it to InOrbit.
Refer to the publishing guide for more details on publishing data to InOrbit.
With polling-based connectors, it is advisable to run polling loops concurrently with the execution loop to avoid long running _execution_loop calls. See the robot-connector and fleet-connector examples for more details.
config.update_freq (default: 1.0 Hz).
_disconnect()
Clean up resources and disconnect from external services. This is called when the connector stops.
_inorbit_command_handler()
:::
See the Commands Handling chapter for more details.
:::
Handle commands received from InOrbit. This method is automatically registered if register_custom_command_handler is True (default).
CommandFailure to provide specific error details that will be displayed in InOrbit’s audit logs and action execution details.
Lifecycle Methods
start()
Starts the connector in a background thread. Creates an async event loop and begins the connection process.
join()
Blocks until the connector thread finishes. Use this to keep your main thread alive.
stop()
Signals the connector to stop and waits for shutdown. This calls _disconnect() and cleans up resources.
Publishing Methods
See the Publishing Guide for detailed information on publishing methods.Advanced Methods
_get_session()
Access the underlying RobotSession from the InOrbit Edge SDK for advanced use cases not covered by the connector API.
_is_robot_online()
Override this method to provide custom robot health checks. The default implementation assumes the robot is online if the connector is running.
User Scripts
User scripts allow executing custom shell scripts from InOrbit. To enable:- Set
user_scripts_dirin your configuration - Pass
register_user_scripts=Trueto the constructor - Place
.shscripts in the user scripts directory
Examples
- Simple connector: examples/simple-connector/connector.py
- Robot connector (CLI): examples/robot-connector/
- Examples index: examples/README.md