selfdrive.locationd package

Subpackages

Submodules

selfdrive.locationd.calibrationd module

This process finds calibration values. More info on what these calibration values are can be found here https://github.com/commaai/openpilot/tree/master/common/transformations While the roll calibration is a real value that can be estimated, here we assume it’s zero, and the image input into the neural network is not corrected for roll.

class selfdrive.locationd.calibrationd.Calibrator(param_put: bool = False)[source]

Bases: object

get_msg(valid: bool) _DynamicStructBuilder[source]
get_smooth_rpy() ndarray[source]
get_valid_idxs() list[int][source]
handle_cam_odom(trans: list[float], rot: list[float], wide_from_device_euler: list[float], trans_std: list[float], road_transform_trans: list[float], road_transform_trans_std: list[float]) ndarray | None[source]
handle_v_ego(v_ego: float) None[source]
reset(rpy_init: ndarray = array([0., 0., 0.]), valid_blocks: int = 0, wide_from_device_euler_init: ndarray = array([0., 0., 0.]), height_init: ndarray = array([1.22]), smooth_from: ndarray = None) None[source]
send_data(pm: PubMaster, valid: bool) None[source]
update_status() None[source]
selfdrive.locationd.calibrationd.is_calibration_valid(rpy: ndarray) bool[source]
selfdrive.locationd.calibrationd.main() NoReturn[source]
selfdrive.locationd.calibrationd.moving_avg_with_linear_decay(prev_mean: ndarray, new_val: ndarray, idx: int, block_size: float) ndarray[source]
selfdrive.locationd.calibrationd.sanity_clip(rpy: ndarray) ndarray[source]

selfdrive.locationd.helpers module

class selfdrive.locationd.helpers.NPQueue(maxlen: int, rowsize: int)[source]

Bases: object

append(pt: list[float]) None[source]
class selfdrive.locationd.helpers.ParameterEstimator[source]

Bases: object

Base class for parameter estimators

get_msg(valid: bool, with_points: bool) <capnp.lib.capnp._StructModule object at 0x7f3309022890>[source]
handle_log(t: int, which: str, msg: <capnp.lib.capnp._StructModule object at 0x7f3309022890>) None[source]
reset() None[source]
class selfdrive.locationd.helpers.PointBuckets(x_bounds: list[tuple[float, float]], min_points: list[float], min_points_total: int, points_per_bucket: int, rowsize: int)[source]

Bases: object

add_point(x: float, y: float, bucket_val: float) None[source]
get_points(num_points: int = None) Any[source]
is_calculable() bool[source]
is_valid() bool[source]
load_points(points: list[list[float]]) None[source]

selfdrive.locationd.paramsd module

class selfdrive.locationd.paramsd.ParamsLearner(CP, steer_ratio, stiffness_factor, angle_offset, P_initial=None)[source]

Bases: object

handle_log(t, which, msg)[source]
selfdrive.locationd.paramsd.check_valid_with_hysteresis(current_valid: bool, val: float, threshold: float, lowered_threshold: float)[source]
selfdrive.locationd.paramsd.main()[source]

selfdrive.locationd.torqued module

class selfdrive.locationd.torqued.TorqueBuckets(x_bounds: list[tuple[float, float]], min_points: list[float], min_points_total: int, points_per_bucket: int, rowsize: int)[source]

Bases: PointBuckets

add_point(x, y)[source]
class selfdrive.locationd.torqued.TorqueEstimator(CP, decimated=False)[source]

Bases: ParameterEstimator

estimate_params()[source]
get_msg(valid=True, with_points=False)[source]
get_restore_key(CP, version)[source]
handle_log(t, which, msg)[source]
reset()[source]
update_params(params)[source]
selfdrive.locationd.torqued.main(demo=False)[source]
selfdrive.locationd.torqued.slope2rot(slope)[source]

Module contents