robotpy_toolkit_7407.sensors.limelight package

Submodules

robotpy_toolkit_7407.sensors.limelight.limelight module

class robotpy_toolkit_7407.sensors.limelight.limelight.Limelight(cam_height: float, cam_angle: float, target_height: float | None = None, robot_ip: str = '10.74.07.2')

Bases: object

Wrapper for the Limelight sensor. Connect, get, and modify limelight values and settings through the NetworkTables interface.

calculate_distance() float

Calculate distance of limelight from target. This function is not useful when the limelight and target are of similar height.

Returns:

float: Distance from target in meters

get_bot_pose(round_to: int | None = None) list | None

Get the robot’s pose from the limelight’s perspective.

get_x_offset() float

Offset on the x plane from the target in radians

Returns:

radians: Radian offset of the target from the center of the camera

led_off()

Turn limelight LEDs off. Recommended to use ref_off instead.

led_on()

Turn limelight LEDs on. Recommended to use ref_on instead.

ref_off()

Turn off the limelight LEDs and decrement the reference counter.

ref_on()

Turn on the limelight LEDs and increment the reference counter.

update()

Update Limelight Values to NetworkTables. Run this every loop to ensure fresh values.

class robotpy_toolkit_7407.sensors.limelight.limelight.LimelightController(limelight_list: list[robotpy_toolkit_7407.sensors.limelight.limelight.Limelight])

Bases: VisionEstimator

get_estimated_robot_pose() list[wpimath.geometry._geometry.Pose3d, float] | None

Returns the robot’s pose relative to the field, estimated by the limelight. :return: Limelight estimate of robot pose. :rtype: Pose3d | None

Module contents