Skip to content

Commit

Permalink
few more updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Comma Device committed Mar 25, 2020
1 parent 3a9cd0c commit 3b78d0e
Show file tree
Hide file tree
Showing 11 changed files with 8 additions and 178 deletions.
2 changes: 1 addition & 1 deletion selfdrive/car/modules/ALCA_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
from common.numpy_fast import interp,clip
from selfdrive.controls.lib.pid import PIController
from common.realtime import sec_since_boot
from selfdrive.services import service_list
from cereal.services import service_list
import selfdrive.messaging as messaging
import numpy as np
from cereal import tesla
Expand Down
2 changes: 1 addition & 1 deletion selfdrive/car/modules/GYRO_module.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from selfdrive.services import service_list
from cereal.services import service_list
from collections import deque
import selfdrive.messaging as messaging
import cereal
Expand Down
2 changes: 1 addition & 1 deletion selfdrive/car/tesla/carcontroller.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from selfdrive.car.tesla.blinker_module import Blinker
from selfdrive.car.tesla.speed_utils.fleet_speed import FleetSpeed
from selfdrive.car.tesla.values import AH, CM
from selfdrive.can.packer import CANPacker
from opendbc.can.packer import CANPacker
from selfdrive.config import Conversions as CV
from selfdrive.car.modules.ALCA_module import ALCAController
from selfdrive.car.modules.GYRO_module import GYROController
Expand Down
2 changes: 1 addition & 1 deletion selfdrive/car/tesla/carstate.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from common.kalman.simple_kalman import KF1D
from selfdrive.can.parser import CANParser
from opendbc.can.parser import CANParser
from selfdrive.config import Conversions as CV
from selfdrive.car.tesla.ACC_module import ACCMode
from selfdrive.car.tesla.PCC_module import PCCModes
Expand Down
2 changes: 1 addition & 1 deletion selfdrive/car/tesla/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from selfdrive.car import STD_CARGO_KG
from selfdrive.car.tesla.readconfig import CarSettings
import selfdrive.messaging as messaging
from selfdrive.services import service_list
from cereal.services import service_list
from selfdrive.controls.lib.planner import _A_CRUISE_MAX_V

A_ACC_MAX = max(_A_CRUISE_MAX_V)
Expand Down
2 changes: 1 addition & 1 deletion selfdrive/car/tesla/radar_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from cereal import car, tesla
from selfdrive.can.parser import CANParser
from common.realtime import DT_RDR
from selfdrive.services import service_list
from cereal.services import service_list
import selfdrive.messaging as messaging
from selfdrive.car.interfaces import RadarInterfaceBase
from selfdrive.car.tesla.readconfig import CarSettings
Expand Down
2 changes: 1 addition & 1 deletion selfdrive/car/tesla/radar_tools/calibrateRadar.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import os
from selfdrive.can.parser import CANParser
from common.realtime import sec_since_boot
from selfdrive.services import service_list
from cereal.services import service_list
import selfdrive.messaging as messaging
from selfdrive.car.tesla.readconfig import read_config_file,CarSettings
from selfdrive.car.tesla.radar_interface import RadarInterface
Expand Down
41 changes: 1 addition & 40 deletions selfdrive/car/toyota/carcontroller.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,20 +51,13 @@ def __init__(self, dbc_name, CP, VM):
self.alert_active = False
self.last_standstill = False
self.standstill_req = False

self.last_fault_frame = -200
self.steer_rate_limited = False

self.fake_ecus = set()
<<<<<<< HEAD
if enable_camera: self.fake_ecus.add(ECU.CAM)
if enable_dsu: self.fake_ecus.add(ECU.DSU)
if enable_apg: self.fake_ecus.add(ECU.APGS)
self.ALCA = ALCAController(self,True,False) # Enabled True and SteerByAngle only False
=======
if CP.enableCamera: self.fake_ecus.add(Ecu.fwdCamera)
if CP.enableDsu: self.fake_ecus.add(Ecu.dsu)
>>>>>>> cc6358d983479e918d8deac95554c39ed5866e1a

self.packer = CANPacker(dbc_name)

Expand Down Expand Up @@ -97,16 +90,9 @@ def update(self, enabled, CS, frame, actuators, pcm_cancel_cmd, hud_alert,
if (frame % 10 == 0):
self.ALCA.update_status(CS.cstm_btns.get_button_status("alca") > 0)
# steer torque
<<<<<<< HEAD
alca_angle, alca_steer, alca_enabled, turn_signal_needed = self.ALCA.update(enabled, CS, frame, actuators)
apply_steer = int(round(alca_steer * SteerLimitParams.STEER_MAX))

apply_steer = apply_toyota_steer_torque_limits(apply_steer, self.last_steer, CS.steer_torque_motor, SteerLimitParams)
=======
new_steer = int(round(actuators.steer * SteerLimitParams.STEER_MAX))
apply_steer = apply_toyota_steer_torque_limits(new_steer, self.last_steer, CS.out.steeringTorqueEps, SteerLimitParams)
self.steer_rate_limited = new_steer != apply_steer
>>>>>>> cc6358d983479e918d8deac95554c39ed5866e1a

# only cut torque when steer state is a known fault
if CS.steer_state in [9, 25]:
Expand All @@ -119,31 +105,6 @@ def update(self, enabled, CS, frame, actuators, pcm_cancel_cmd, hud_alert,
else:
apply_steer_req = 1

<<<<<<< HEAD
self.steer_angle_enabled, self.ipas_reset_counter = \
ipas_state_transition(self.steer_angle_enabled, enabled, CS.ipas_active, self.ipas_reset_counter)
#print("{0} {1} {2}".format(self.steer_angle_enabled, self.ipas_reset_counter, CS.ipas_active))


# steer angle
if self.steer_angle_enabled and CS.ipas_active:

apply_angle = alca_angle
angle_lim = interp(CS.v_ego, ANGLE_MAX_BP, ANGLE_MAX_V)
apply_angle = clip(apply_angle, -angle_lim, angle_lim)

# windup slower
if self.last_angle * apply_angle > 0. and abs(apply_angle) > abs(self.last_angle):
angle_rate_lim = interp(CS.v_ego, ANGLE_DELTA_BP, ANGLE_DELTA_V)
else:
angle_rate_lim = interp(CS.v_ego, ANGLE_DELTA_BP, ANGLE_DELTA_VU)

apply_angle = clip(apply_angle, self.last_angle - angle_rate_lim, self.last_angle + angle_rate_lim)
else:
apply_angle = CS.angle_steers

=======
>>>>>>> cc6358d983479e918d8deac95554c39ed5866e1a
if not enabled and CS.pcm_acc_status:
# send pcm acc cancel cmd if drive is disabled but pcm is still on, or if the system can't be activated
pcm_cancel_cmd = 1
Expand Down
127 changes: 0 additions & 127 deletions selfdrive/ui/Makefile

This file was deleted.

Binary file modified selfdrive/ui/spinner/spinner
Binary file not shown.
4 changes: 0 additions & 4 deletions selfdrive/ui/ui

This file was deleted.

0 comments on commit 3b78d0e

Please sign in to comment.