Skip to content

controllers

create_controller(name, **kwargs)

Creates a controller of type @name with corresponding necessary keyword arguments @kwargs

Parameters:

Name Type Description Default
name str

type of controller to use (e.g. JointController, InverseKinematicsController, etc.)

required
**kwargs

Any relevant keyword arguments to pass to the controller

{}

Returns:

Name Type Description
Controller

created controller

Source code in omnigibson/controllers/__init__.py
def create_controller(name, **kwargs):
    """
    Creates a controller of type @name with corresponding necessary keyword arguments @kwargs

    Args:
        name (str): type of controller to use (e.g. JointController, InverseKinematicsController, etc.)
        **kwargs: Any relevant keyword arguments to pass to the controller

    Returns:
        Controller: created controller
    """
    assert_valid_key(key=name, valid_keys=REGISTERED_CONTROLLERS, name="controller")
    controller_cls = REGISTERED_CONTROLLERS[name]

    return controller_cls(**kwargs)