Skip to content

config

BatteryControlConfiguration dataclass

BatteryControlConfiguration(
    *,
    name: str = "battery_control",
    on_expander: bool = True,
    reset_pin: int = 15,
    status_pin: int = 13
)

Configuration for the battery control of the Feldfreund robot.

Defaults

name: 'battery_control' on_expander: True reset_pin: 15 status_pin: 13

BluetoothConfiguration dataclass

BluetoothConfiguration(
    *,
    name: str = "bluetooth",
    pin_code: int | None | Literal["default"] = "default"
)

Configuration for the Lizard Bluetooth module.

Defaults

name: 'bluetooth' pin_code: 'default'

BmsConfiguration dataclass

BmsConfiguration(
    *,
    name: str = "bms",
    on_expander: bool = True,
    rx_pin: int = 26,
    tx_pin: int = 27,
    baud: int = 9600,
    num: int = 2,
    battery_low_threshold: float = 15.0
)

Configuration for the bms of the Feldfreund robot.

Defaults

name: 'bms' on_expander: True rx_pin: 26 tx_pin: 27 baud: 9600 num: 2 battery_low_threshold: 15.0

BumperConfiguration dataclass

BumperConfiguration(
    *,
    pin_front_top: int | None,
    pin_front_bottom: int | None,
    pin_back: int | None,
    name: str = "bumper",
    on_expander: bool = True,
    release_buffer_ms: int = 3000
)

Configuration for the bumper of the Feldfreund robot.

Defaults

name: 'bumper' on_expander: True release_buffer_ms: 3000

CameraConfiguration dataclass

CameraConfiguration(
    *,
    main: CameraSlotConfig | list[CameraSlotConfig] | None,
    front: CameraSlotConfig | None,
    back: CameraSlotConfig | None,
    left: CameraSlotConfig | None = None,
    right: CameraSlotConfig | None = None
)

Container of named camera slots for a Feldfreund robot.

main may be a single CameraSlotConfig or a list of them. The list form configures multiple main cameras; CameraProvider.main then refers to the first, while CameraProvider.mains exposes all of them.

Defaults

left: None right: None

CameraSlotConfig dataclass

CameraSlotConfig(
    *,
    camera_id: str,
    fps: int = 10,
    rotation: ImageRotation = ImageRotation.NONE,
    stream_size: ImageSize | None = None,
    crop: Rectangle | None = None,
    calibration: Calibration | None = None,
    image_size: ImageSize | None = None,
    auto_connect: bool = True
)

Base configuration shared by all camera types.

width and height are derived properties describing the images the camera delivers: the crop size when a crop is configured, otherwise the stream size. At least one of calibration and image_size must be set.

stream_size lets the camera stream at a different resolution than the calibration was fit at (same field of view), so it requires one. crop is the region cut out of the stream, in stream pixel coordinates, applied to the captured images via TransformableCamera. calibration stays as fitted; camera_calibration derives the one matching the delivered images by scaling to the stream size and shifting the principal point by the crop. rotation is currently not passed to the cameras.

auto_connect set to False keeps the camera disconnected until the connection is requested explicitly, for example with the switch in the camera developer UI.

Defaults

fps: 10 rotation: ImageRotation.NONE stream_size: None (the calibration size or image_size) crop: None calibration: None image_size: None auto_connect: True

Attributes & Properties

Name Type Description
camera_calibration rosys.vision.calibration.Calibration | None The calibration matching the delivered images: scaled to stream_size, shifted by crop.

CanConfiguration dataclass

CanConfiguration(
    *,
    name: str = "can",
    on_expander: bool = False,
    rx_pin: int = 32,
    tx_pin: int = 33,
    baud: int = 1000000
)

Configuration for the can of the Feldfreund robot.

Defaults

name: 'can' on_expander: False rx_pin: 32 tx_pin: 33 baud: 1_000_000

EstopConfiguration dataclass

EstopConfiguration(
    *,
    name: str = "estop",
    pin_front: int = 34,
    pin_back: int = 35
)

Configuration for the estop of the Feldfreund robot.

Defaults

name: 'estop' pin_front: 34 pin_back: 35

FeldfreundConfiguration dataclass

FeldfreundConfiguration(
    *,
    robot_id: str,
    robot_footprint: RobotFootprint = RobotFootprint(),
    battery_control: BatteryControlConfiguration = BatteryControlConfiguration(),
    bluetooth: BluetoothConfiguration = BluetoothConfiguration(),
    bms: BmsConfiguration = BmsConfiguration(),
    bumper: BumperConfiguration | None = None,
    can: CanConfiguration = CanConfiguration(),
    cameras: CameraConfiguration | None = None,
    driver: DriveParameters = create_drive_parameters(),
    estop: EstopConfiguration = EstopConfiguration(),
    gnss: GnssConfiguration | None = None,
    headlights: HeadlightConfigurations = None,
    implements: list[ImplementConfiguration] = list(),
    imu: ImuConfiguration | None = None,
    robot_brain: RobotBrainConfiguration,
    wheels: TracksConfiguration,
    work_lights: WorkLightConfigurations = None
)

Main configuration for a Feldfreund robot combining all module configurations.

GnssConfiguration dataclass

GnssConfiguration(
    *,
    x: float = 0.041,
    y: float = -0.255,
    z: float = 0.6225,
    yaw: float = 0.0
)

Configuration for the GNSS of the Feldfreund robot.

X, Y, Z are the position of the main GNSS antenna. The yaw is the direction to the auxiliary antenna. It should be 90°, but the offset is configured in the Septentrio software.

Defaults

x: 0.041 y: -0.255 z: 0.6225 yaw: 0.0

ImplementConfiguration dataclass

ImplementConfiguration(
    *,
    lizard_name: str,
    display_name: str,
    default_offset: Pose3d = Pose3d.zero(),
    work_radius: float
)

Base configuration for all implements.

Defaults

default_offset: Pose3d.zero

default_offset class-attribute instance-attribute

default_offset: Pose3d = field(default_factory=Pose3d.zero)

Tool pose in the robot frame until an implement calibrates or persists its own.

ImuConfiguration dataclass

ImuConfiguration(
    *,
    name: str = "imu",
    offset_rotation: Rotation = Rotation.zero(),
    min_gyro_calibration: float = 1.0
)

Configuration for the IMU of the Feldfreund robot.

Defaults

name: 'imu' offset_rotation: Rotation.zero min_gyro_calibration: 1.0

LightConfiguration dataclass

LightConfiguration(
    *,
    name: str,
    on_expander: bool = True,
    pin: int,
    duty_cycle: float = 1.0,
    initially_on: bool = False,
    safety_managed: bool = True
)

Configuration for a single light of the Feldfreund robot.

The name is the lamp's variable in Lizard's flat namespace, so it must be free of every other module of the robot; prefix it with the kind of lamp, as the shipped configs do.

A lamp normally goes dark with the robot's other safety-critical outputs on an e-stop or bumper trigger, and stays dark until it is switched on again: re-enabling the robot clears the disable but does not light the lamp. Set safety_managed to False to keep a lamp out of that force-off, e.g. for a headlight whose job is making a stopped robot visible rather than illuminating the ground for plant detection.

A lamp lit from the start has to set safety_managed=False, because after an e-stop it would stay dark until someone switches it on again.

Defaults

on_expander: True duty_cycle: 1.0 initially_on: False safety_managed: True

MjpegCameraConfig dataclass

MjpegCameraConfig(
    *,
    camera_id: str,
    fps: int = 10,
    rotation: ImageRotation = ImageRotation.NONE,
    stream_size: ImageSize | None = None,
    crop: Rectangle | None = None,
    calibration: Calibration | None = None,
    image_size: ImageSize | None = None,
    auto_connect: bool = True,
    ip: str = "192.168.42.3",
    username: str = "root",
    password: str
)

Bases: CameraSlotConfig

Configuration for an MJPEG camera.

The password can be added to the .env file as MJPEG_CAMERA_PASSWORD and then used with secrets.py.

Defaults

ip: '192.168.42.3' username: 'root'

Attributes & Properties

Name Type Description
camera_calibration rosys.vision.calibration.Calibration | None The calibration matching the delivered images: scaled to stream_size, shifted by crop.

ODriveTracksConfiguration dataclass

ODriveTracksConfiguration(
    *,
    name: str = "wheels",
    is_left_reversed: bool = False,
    is_right_reversed: bool = False,
    width: float = 0.502,
    left_back_can_address: int = 0,
    right_back_can_address: int = 256,
    left_front_can_address: int = 512,
    right_front_can_address: int = 768,
    odrive_version: int = 4,
    tooth_count: int = 15,
    pitch: float = 0.033,
    motor_gear_ratio: float = 12.52,
    has_temperature_sensor: bool = False
)

Bases: TracksConfiguration

Configuration for ODrive-based tracks with four motors (front/back, left/right).

Defaults

left_back_can_address: 0x000 right_back_can_address: 0x100 left_front_can_address: 0x200 right_front_can_address: 0x300 odrive_version: 4 tooth_count: 15 pitch: 0.033 motor_gear_ratio: 12.52 has_temperature_sensor: False

RobotBrainConfiguration dataclass

RobotBrainConfiguration(
    *,
    name: str,
    enable_esp_on_startup: bool = False,
    nand: bool = False,
    swap_pins: bool = False,
    heartbeat_interval: float = 0.5,
    supported_lizard_versions: str | None = None,
    serial_baud_rate: Literal[
        115200, 230400, 460800, 921600
    ] = 115200
)

Configuration for the robot brain of the Feldfreund robot.

There are different versions of the Robot Brain's electronics. Make sure to configure the correct parameters for your Robot Brain.

Also have a look the documentation of the espresso.py script. https://github.com/zauberzeug/lizard/blob/main/espresso.py

Defaults

enable_esp_on_startup: False nand: False swap_pins: False heartbeat_interval: 0.5 supported_lizard_versions: None serial_baud_rate: 115200

supported_lizard_versions is a PEP 440 version specifier like '<0.14.0' restricting which Lizard versions can be downloaded and flashed. None allows all versions.

serial_baud_rate class-attribute instance-attribute

serial_baud_rate: Literal[
    115200, 230400, 460800, 921600
] = 115200

Baud rate of the core console, one of the rates Lizard's core.set_baudrate accepts. It must match the rate persisted on the Robot Brain.

RobotFootprint dataclass

RobotFootprint(
    *,
    front: float = 0.5295,
    rear: float = 0.343,
    left: float = 0.33274,
    right: float = 0.33274
)

Physical extent of the robot as distances from the center of motion.

The center of motion is not necessarily the geometric center of the robot frame. Each value represents the distance from the center of motion to that edge.

Defaults

front: 0.5295 rear: 0.343 left: 0.33274 right: 0.33274

corners_at_pose

corners_at_pose(pose: Pose) -> list[Point]

Return the 4 footprint corners at the given pose, rotated by the pose's yaw.

Order: front-left, front-right, rear-right, rear-left.

RtspCameraConfig dataclass

RtspCameraConfig(
    *,
    camera_id: str,
    fps: int = 10,
    rotation: ImageRotation = ImageRotation.NONE,
    stream_size: ImageSize | None = None,
    crop: Rectangle | None = None,
    calibration: Calibration | None = None,
    image_size: ImageSize | None = None,
    auto_connect: bool = True,
    mac: str,
    ip: str,
    codec: Literal["h264", "h265"] = "h265",
    substream: int = 0
)

Bases: CameraSlotConfig

Configuration for an RTSP camera.

The encoder substream determines the resolution, so calibration and crop must match it.

Defaults

codec: 'h265' substream: 0

Attributes & Properties

Name Type Description
camera_calibration rosys.vision.calibration.Calibration | None The calibration matching the delivered images: scaled to stream_size, shifted by crop.

TracksConfiguration dataclass

TracksConfiguration(
    *,
    name: str = "wheels",
    is_left_reversed: bool = False,
    is_right_reversed: bool = False,
    width: float = 0.502
)

Base configuration for Feldfreund tracks.

Defaults

name: 'wheels' is_left_reversed: False is_right_reversed: False width: 0.502

UsbCameraConfig dataclass

UsbCameraConfig(
    *,
    camera_id: str,
    fps: int = 10,
    rotation: ImageRotation = ImageRotation.NONE,
    stream_size: ImageSize | None = None,
    crop: Rectangle | None = None,
    calibration: Calibration | None = None,
    image_size: ImageSize | None = None,
    auto_connect: bool = True,
    auto_exposure: bool = True
)

Bases: CameraSlotConfig

Configuration for a USB camera.

Defaults

auto_exposure: True

Attributes & Properties

Name Type Description
camera_calibration rosys.vision.calibration.Calibration | None The calibration matching the delivered images: scaled to stream_size, shifted by crop.

WorkLightMosfetConfiguration dataclass

WorkLightMosfetConfiguration(
    *,
    name: str = "work_light_mosfet",
    on_expander: bool = True,
    pin: int = 2
)

Configuration for the mosfet based work light of the Feldfreund robot.

Deprecated: only used on U4. Not built into any new robot; do not extend.

Defaults

name: str = 'work_light_mosfet' on_expander: True pin: 2