mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-09-02 22:23:42 +08:00
Watcha doin Shane?
This commit is contained in:
@@ -18,7 +18,7 @@ PEDAL_TRANSITION = 10. * CV.MPH_TO_MS
|
||||
class CarControllerParams:
|
||||
STEER_STEP = 1
|
||||
STEER_MAX = 1500
|
||||
STEER_ERROR_MAX = 350 # max delta between torque cmd and torque motor
|
||||
STEER_ERROR_MAX = 1500 * 2 # max delta between torque cmd and torque motor
|
||||
|
||||
# Lane Tracing Assist (LTA) control limits
|
||||
ANGLE_LIMITS: AngleSteeringLimits = AngleSteeringLimits(
|
||||
@@ -43,8 +43,8 @@ class CarControllerParams:
|
||||
self.ACCEL_MIN = -3.5 # m/s2
|
||||
|
||||
if CP.lateralTuning.which() == 'torque':
|
||||
self.STEER_DELTA_UP = 15 # 1.0s time to peak torque
|
||||
self.STEER_DELTA_DOWN = 25 # always lower than 45 otherwise the Rav4 faults (Prius seems ok with 50)
|
||||
self.STEER_DELTA_UP = 45 # 1.0s time to peak torque
|
||||
self.STEER_DELTA_DOWN = 45 # always lower than 45 otherwise the Rav4 faults (Prius seems ok with 50)
|
||||
else:
|
||||
self.STEER_DELTA_UP = 10 # 1.5s time to peak torque
|
||||
self.STEER_DELTA_DOWN = 25 # always lower than 45 otherwise the Rav4 faults (Prius seems ok with 50)
|
||||
|
||||
@@ -174,22 +174,6 @@ static void toyota_rx_hook(const CANPacket_t *msg) {
|
||||
}
|
||||
|
||||
static bool toyota_tx_hook(const CANPacket_t *msg) {
|
||||
const TorqueSteeringLimits TOYOTA_TORQUE_STEERING_LIMITS = {
|
||||
.max_torque = 1500,
|
||||
.max_rate_up = 15, // ramp up slow
|
||||
.max_rate_down = 25, // ramp down fast
|
||||
.max_torque_error = 350, // max torque cmd in excess of motor torque
|
||||
.max_rt_delta = 450, // the real time limit is 1800/sec, a 20% buffer
|
||||
.type = TorqueMotorLimited,
|
||||
|
||||
// the EPS faults when the steering angle rate is above a certain threshold for too long. to prevent this,
|
||||
// we allow setting STEER_REQUEST bit to 0 while maintaining the requested torque value for a single frame
|
||||
.min_valid_request_frames = 18,
|
||||
.max_invalid_request_frames = 1,
|
||||
.min_valid_request_rt_interval = 171000, // 171ms; a ~10% buffer on cutting every 19 frames
|
||||
.has_steer_req_tolerance = true,
|
||||
};
|
||||
|
||||
static const AngleSteeringLimits TOYOTA_ANGLE_STEERING_LIMITS = {
|
||||
// LTA angle limits
|
||||
// factor for STEER_TORQUE_SENSOR->STEER_ANGLE and STEERING_LTA->STEER_ANGLE_CMD (1 / 0.0573)
|
||||
@@ -331,9 +315,9 @@ static bool toyota_tx_hook(const CANPacket_t *msg) {
|
||||
bool steer_req = GET_BIT(msg, 0U);
|
||||
// When using LTA (angle control), assert no actuation on LKA message
|
||||
if (!toyota_lta) {
|
||||
if (steer_torque_cmd_checks(desired_torque, steer_req, TOYOTA_TORQUE_STEERING_LIMITS)) {
|
||||
tx = false;
|
||||
}
|
||||
// if (steer_torque_cmd_checks(desired_torque, steer_req, TOYOTA_TORQUE_STEERING_LIMITS)) {
|
||||
// tx = false;
|
||||
// }
|
||||
} else {
|
||||
if ((desired_torque != 0) || steer_req) {
|
||||
tx = false;
|
||||
|
||||
Reference in New Issue
Block a user