GEMstack.knowledge.vehicle package

Submodules

GEMstack.knowledge.vehicle.dynamics module

Functions to model the vehicle’s steering / drivetrain dynamics.

TODO: calibrate drivetrain dynamics. Power curves are not yet implemented.

TODO: add functions defining steering friction limits at different speeds and on different surfaces.

GEMstack.knowledge.vehicle.dynamics.acceleration_limits(velocity: float, pitch: float, gear: int) Tuple[float, float]

Returns the min and max achievable acceleration at the given velocity, pitch, and gear.

GEMstack.knowledge.vehicle.dynamics.acceleration_to_pedal_positions(acceleration: float, velocity: float, pitch: float, gear: int) Tuple[float, float, int]

Converts acceleration in m/s^2 to pedal positions in % of pedal travel.

Returns tuple (accelerator_pedal_position, brake_pedal_position, desired_gear)

GEMstack.knowledge.vehicle.dynamics.pedal_positions_to_acceleration(accelerator_pedal_position: float, brake_pedal_position: float, velocity: float, pitch: float, gear: int) float

Converts pedal positions in % of pedal travel to acceleration in m/s^2.

Simulates drag, gravity, and internal viscous deceleration.

Does not yet simulate velocity-dependent power.

Returns acceleration

GEMstack.knowledge.vehicle.dynamics.sign(x)

GEMstack.knowledge.vehicle.geometry module

Functions to model the vehicle’s steering geometry.

TODO: double-check steer2front and front2steer coefficients.

GEMstack.knowledge.vehicle.geometry.clamp_steering_angle(wheel_angle: float) float

Clamps the steering angle to the range defined in the settings.

GEMstack.knowledge.vehicle.geometry.clamp_wheel_angle(wheel_angle: float) float

Clamps the wheel angle to the range defined in the settings.

GEMstack.knowledge.vehicle.geometry.front2steer(f_angle: float)

Conversion of front wheel to steering wheel angle. Both input and output are in radians.

GEMstack.knowledge.vehicle.geometry.front2steer_degrees(f_angle: float) float

Conversion of front wheel to steering wheel angle. Both input and output are in degrees.

No clamping is done: the caller should clamp the input to the steering wheel range defined in the settings.

GEMstack.knowledge.vehicle.geometry.heading_rate(front_angle: float, speed: float, wheelbase: float) float

Returns the heading rate in radians/sec given the front wheel angle, speed, and wheelbase.

GEMstack.knowledge.vehicle.geometry.steer2front(s_angle: float)

Conversion of front wheel to steering wheel angle. Both input and output are in radians.

GEMstack.knowledge.vehicle.geometry.steer2front_degrees(s_angle: float) float

Conversion of steering wheel to front wheel angle. Both input and output are in degrees.

No clamping is done: the caller should clamp the input to the steering wheel range defined in the settings.