This commit is contained in:
Your Name
2024-05-04 00:38:43 -05:00
parent 5a5904e2c5
commit f3cdd57b41
2 changed files with 6 additions and 0 deletions

View File

@@ -294,6 +294,7 @@ class CarState(CarStateBase):
# print('Hello World', file=sys.stderr)
# sys.stderr.write(str({k: v for k, v in vars(ret).items() if isinstance(v, (int, float, str, bool))}) + '\n')
# print(ret, sys.stderr)
print(ret.cruiseState, sys.stderr)
# notes on self:
# lkas_enabled = 1 = lkas button has been pressed
# prev_cruise_buttons = 0 (none), 1, 2 - up down

View File

@@ -33,7 +33,12 @@ def calculate_lane_width(lane, current_lane, road_edge):
def calculate_road_curvature(modelData, v_ego):
predicted_velocities = np.array(modelData.velocity.x)
# clearpilot fix
# /data/openpilot/openpilot/selfdrive/frogpilot/controls/lib/frogpilot_functions.py:36: RuntimeWarning: divide by zero encountered in divide
# curvature_ratios = np.abs(np.array(modelData.acceleration.y)) / (predicted_velocities**2)
curvature_ratios = np.abs(np.array(modelData.acceleration.y)) / (predicted_velocities**2)
# /data/openpilot/openpilot/selfdrive/frogpilot/controls/lib/frogpilot_functions.py:37: RuntimeWarning: invalid value encountered in multiply
# return np.amax(curvature_ratios * (v_ego**2))
return np.amax(curvature_ratios * (v_ego**2))
class MovingAverageCalculator: