kinsolve module

class kinsolve.KinSolve(wheel_center: Point, lower_wishbone: Tuple[Point, Point, Point], upper_wishbone: Tuple[Point, Point, Point], tie_rod: Tuple[Point, Point], full_jounce: float, full_rebound: float, moving_points: List[Point], unit: str = 'mm', bump_steer: Optional[List[float]] = None, camber_gain: Optional[List[float]] = None, caster_gain: Optional[List[float]] = None)

Bases: object

Kinematics Solver

bump_steer: List[float] = None
bump_zs = None
camber_gain: List[float] = None
caster_gain: List[float] = None
full_jounce: float
full_rebound: float
lower_wishbone: Tuple[Point, Point, Point]
moving_points: List[Point]
plot(suspension: bool = True, bump_steer: bool = True, camber_gain: bool = True, caster_gain: bool = True, roll_center_in_roll=True, bump_steer_in_deg: bool = False, camber_gain_in_deg: bool = False, caster_gain_in_deg: bool = False)

Put %matplotlib into the kernel to get pop-out graphs that are interactive if you fix my bad graphs, send me your fix pls

Parameters
  • suspension – Plot suspension graph

  • bump_steer – Plot bump steer vs vertical travel

  • camber_gain – Plot camber gain vs vertical traval

  • caster_gain – Plot caster gain

  • roll_center_in_roll – Path of roll center as the car rolls

  • bump_steer_in_deg – Sets y-axis of bump steer plot to roll angle in deg

  • camber_gain_in_deg – Sets y-axis of camber gain plot to roll angle in deg

  • caster_gain_in_deg – Sets y-axis of caster gain plot to roll angle in deg

roll_angle = None
roll_center = None
sa = None
solve(steps: int = 5, happy: float = 0.001, learning_rate: float = 0.001, offset_toe: float = 0, offset_camber: float = 0, offset_caster: float = 0)

Solve stuff(?)

Parameters
  • steps – Number of steps in each direction. (e.g. 10 -> 20 datapoints)

  • happy – Error margin for gradient descent to be considered complete

  • learning_rate – Learning rate

  • offset_toe – Static offset

  • offset_camber – Static offset

  • offset_caster – Static offset

tie_rod: Tuple[Point, Point]
unit: str = 'mm'
upper_wishbone: Tuple[Point, Point, Point]
wheel_center: Point
class kinsolve.Point(coords)

Bases: object

Ass_Fcn()

Associative Function

Returns

Gx describes how much longer each link is than it should be

Jacobian()

Jacobian of Objective Function

Returns

Obj_Fcn()

Objective Function (cost fcn)

Returns

jr_combine()
kinsolve.angle(v1: List[float], v2: List[float])

Angle between two vectors Arccos of the dot product of two unit vectors

Parameters
  • v1 – Vector 1

  • v2 – Vector 2

Returns

Angle

kinsolve.perp(a)

Creates a perpendicular line segement

Parameters

a – line?

Returns

perpendicular line?

kinsolve.pt_to_ln(pt, a, b)
kinsolve.seg_intersect(a1, a2, b1, b2)