wip
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user