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.Calibration[source]

Bases: object

CALIBRATED = 1
INVALID = 2
UNCALIBRATED = 0
class selfdrive.locationd.calibrationd.Calibrator(param_put: bool = False)[source]

Bases: object

get_msg() _DynamicStructBuilder[source]
get_smooth_rpy() ndarray[source]
get_valid_idxs() List[int][source]
handle_cam_odom(trans: List[float], rot: List[float], trans_std: List[float]) Optional[ndarray][source]
handle_v_ego(v_ego: float) None[source]
reset(rpy_init: ndarray = array([0., 0., 0.]), valid_blocks: int = 0, smooth_from: Optional[ndarray] = None) None[source]
send_data(pm: PubMaster) None[source]
update_status() None[source]
selfdrive.locationd.calibrationd.calibrationd_thread(sm: Optional[SubMaster] = None, pm: Optional[PubMaster] = None) NoReturn[source]
selfdrive.locationd.calibrationd.is_calibration_valid(rpy: ndarray) bool[source]
selfdrive.locationd.calibrationd.main(sm: Optional[SubMaster] = None, pm: Optional[PubMaster] = None) NoReturn[source]
selfdrive.locationd.calibrationd.sanity_clip(rpy: ndarray) ndarray[source]

selfdrive.locationd.laikad module

class selfdrive.locationd.laikad.CacheSerializer(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, default=None)[source]

Bases: JSONEncoder

default(o)[source]

Implement this method in a subclass such that it returns a serializable object for o, or calls the base implementation (to raise a TypeError).

For example, to support arbitrary iterators, you could implement default like this:

def default(self, o):
    try:
        iterable = iter(o)
    except TypeError:
        pass
    else:
        return list(iterable)
    # Let the base class default method raise the TypeError
    return JSONEncoder.default(self, o)
class selfdrive.locationd.laikad.EphemerisSourceType(value)[source]

Bases: IntEnum

An enumeration.

glonassIacUltraRapid = 2
nasaUltraRapid = 1
nav = 0
class selfdrive.locationd.laikad.Laikad(valid_const=('GPS', 'GLONASS'), auto_fetch_orbits=True, auto_update=False, valid_ephem_types=(<EphemerisType.ULTRA_RAPID_ORBIT: 3>, <EphemerisType.NAV: 0>), save_ephemeris=False, use_qcom=False)[source]

Bases: object

cache_ephemeris(t: GPSTime)[source]
fetch_orbits(t: GPSTime, block)[source]
get_est_pos(t, processed_measurements)[source]
init_gnss_localizer(est_pos)[source]
is_good_report(gnss_msg)[source]
kf_valid(t: float) List[bool][source]
load_cache()[source]
process_gnss_msg(gnss_msg, gnss_mono_time: int, block=False)[source]
read_report(gnss_msg)[source]
update_localizer(est_pos, t: float, measurements: List[GNSSMeasurement])[source]
selfdrive.locationd.laikad.create_measurement_msg(meas: GNSSMeasurement)[source]
selfdrive.locationd.laikad.deserialize_hook(dct)[source]
selfdrive.locationd.laikad.get_orbit_data(t: GPSTime, valid_const, auto_update, valid_ephem_types, cache_dir)[source]
selfdrive.locationd.laikad.kf_add_observations(gnss_kf: GNSSKalman, t: float, measurements: List[GNSSMeasurement])[source]
selfdrive.locationd.laikad.main(sm=None, pm=None)[source]

selfdrive.locationd.laikad_helpers module

selfdrive.locationd.laikad_helpers.calc_pos_fix_gauss_newton(measurements, posfix_functions, x0=None, signal='C1C', min_measurements=6)[source]

Calculates gps fix using gauss newton method To solve the problem a minimal of 4 measurements are required.

If Glonass is included 5 are required to solve for the additional free variable.

returns: 0 -> list with positions

selfdrive.locationd.laikad_helpers.gauss_newton(fun, b, xtol=1e-08, max_n=25)[source]
selfdrive.locationd.laikad_helpers.get_posfix_sympy_fun(constellation)[source]
selfdrive.locationd.laikad_helpers.pr_residual(measurements, posfix_functions, signal='C1C')[source]

selfdrive.locationd.liblocationd module

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.main(sm=None, pm=None)[source]

Module contents