mirror of
https://github.com/sunnypilot/sunnypilot.git
synced 2026-02-18 18:53:55 +08:00
* refactor: move lateral methods from init to lateral.py (#2594) * Extracting lateral methods to lateral.py * cleaning * more cleaning * more cleaning * Making sure it remains where it should * Leave rate_limit where it belongs * Moving things to `car/controls/` * Moving rate limit to get a taste of the changes * clean * copy verbatim * clean up * more * now we can format --------- Co-authored-by: Shane Smiskol <shane@smiskol.com> * No need to change order of import * refactor: consolidate ACCELERATION_DUE_TO_GRAVITY import path * bump opendbc * update refs * don't import from opendbc --------- Co-authored-by: Shane Smiskol <shane@smiskol.com> Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
24 lines
434 B
Python
24 lines
434 B
Python
import numpy as np
|
|
|
|
# conversions
|
|
class CV:
|
|
# Speed
|
|
MPH_TO_KPH = 1.609344
|
|
KPH_TO_MPH = 1. / MPH_TO_KPH
|
|
MS_TO_KPH = 3.6
|
|
KPH_TO_MS = 1. / MS_TO_KPH
|
|
MS_TO_MPH = MS_TO_KPH * KPH_TO_MPH
|
|
MPH_TO_MS = MPH_TO_KPH * KPH_TO_MS
|
|
MS_TO_KNOTS = 1.9438
|
|
KNOTS_TO_MS = 1. / MS_TO_KNOTS
|
|
|
|
# Angle
|
|
DEG_TO_RAD = np.pi / 180.
|
|
RAD_TO_DEG = 1. / DEG_TO_RAD
|
|
|
|
# Mass
|
|
LB_TO_KG = 0.453592
|
|
|
|
|
|
ACCELERATION_DUE_TO_GRAVITY = 9.81 # m/s^2
|