跳转至

base

Base interfaces for LAV2 controllers.

类:

名称 描述
ControllerBase

Abstract controller base class.

ControllerBase

ControllerBase(params: VehicleParams, control_mask: dict | None = None, gains: dict | None = None)

Bases: ABC

Abstract controller base class.

Initialize shared controller state.

参数:

名称 类型 描述 默认

params

VehicleParams

Vehicle parameters for the controller.

必需

control_mask

dict | None

Dict mask mapped to state keys. e.g. {"pos": [1, 1, 1], "att_euler": [0, 0, 1]} for position+yaw control. Keys not present are cascade-computed.

None

gains

dict | None

Optional gains configuration for derived controllers.

None

方法:

名称 描述
update

Update the controller and return control outputs.

reset

Reset controller state if necessary.

属性:

名称 类型 描述
params VehicleParams

Vehicle parameters for the controller.

control_mask dict

Control mask dict mapped to state keys, used in update().

gains dict | None

Optional gains configuration for derived controllers.

target dict

Latest target dict input to the controller.

params instance-attribute

params: VehicleParams = params

Vehicle parameters for the controller.

control_mask instance-attribute

control_mask: dict = control_mask if control_mask is not None else {}

Control mask dict mapped to state keys, used in update().

gains instance-attribute

gains: dict | None = gains

Optional gains configuration for derived controllers.

target instance-attribute

target: dict = {}

Latest target dict input to the controller.

update abstractmethod

update(target, state)

Update the controller and return control outputs.

参数:

名称 类型 描述 默认

target

Dict with state keys and desired values.

必需

state

Dict with current state keys.

必需

返回:

类型 描述

Control output array.

reset abstractmethod

reset(*args, **kwargs)

Reset controller state if necessary.