Skip to content

Commit

Permalink
Honda: missing float (#1661)
Browse files Browse the repository at this point in the history
* missing float

* more
  • Loading branch information
sshane authored Jan 23, 2025
1 parent 7ceed32 commit 00bb29c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion opendbc/car/honda/carcontroller.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def update(self, CC, CS, now_nanos):
np.clip(CS.out.vEgo - 3.0, 0.0, 100.0),
np.clip(CS.out.vEgo + 0.0, 0.0, 100.0),
np.clip(CS.out.vEgo + 5.0, 0.0, 100.0)]
pcm_speed = np.interp(gas - brake, pcm_speed_BP, pcm_speed_V)
pcm_speed = float(np.interp(gas - brake, pcm_speed_BP, pcm_speed_V))
pcm_accel = int(1.0 * self.params.NIDEC_GAS_MAX)
else:
pcm_speed_V = [0.0,
Expand Down
3 changes: 1 addition & 2 deletions opendbc/car/honda/carstate.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,7 @@ def update(self, can_parsers) -> structs.CarState:
v_wheel = (ret.wheelSpeeds.fl + ret.wheelSpeeds.fr + ret.wheelSpeeds.rl + ret.wheelSpeeds.rr) / 4.0

# blend in transmission speed at low speed, since it has more low speed accuracy
v_weight = np.interp(v_wheel, v_weight_bp, v_weight_v)
v_weight = float(v_weight)
v_weight = float(np.interp(v_wheel, v_weight_bp, v_weight_v))
ret.vEgoRaw = (1. - v_weight) * cp.vl["ENGINE_DATA"]["XMISSION_SPEED"] * CV.KPH_TO_MS * self.CP.wheelSpeedFactor + v_weight * v_wheel
ret.vEgo, ret.aEgo = self.update_speed_kf(ret.vEgoRaw)

Expand Down
4 changes: 2 additions & 2 deletions opendbc/car/toyota/carcontroller.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ def update(self, CC, CS, now_nanos):

# GVC does not overshoot ego acceleration when starting from stop, but still has a similar delay
if not self.CP.flags & ToyotaFlags.SECOC.value:
a_ego_blended = np.interp(CS.out.vEgo, [1.0, 2.0], [CS.gvc, CS.out.aEgo])
a_ego_blended = float(np.interp(CS.out.vEgo, [1.0, 2.0], [CS.gvc, CS.out.aEgo]))
else:
a_ego_blended = CS.out.aEgo

Expand Down Expand Up @@ -287,7 +287,7 @@ def update(self, CC, CS, now_nanos):
new_actuators = actuators.as_builder()
new_actuators.steer = apply_steer / self.params.STEER_MAX
new_actuators.steerOutputCan = apply_steer
new_actuators.steeringAngleDeg = float(self.last_angle)
new_actuators.steeringAngleDeg = self.last_angle
new_actuators.accel = self.accel

self.frame += 1
Expand Down

0 comments on commit 00bb29c

Please sign in to comment.