Skip to content

Commit

Permalink
Squashed commit including:
Browse files Browse the repository at this point in the history
Change distance cost and stopping distance
Added script to alter acado_solver.c and changed stopping distance to 5
lowered stopped accel
Fixed typo in generator.cpp and recompiled
updated instructions for acado
Manually edited acado_solover.c to make variable work
Distance weight changed from .1 to 10

Somehow lost cereal/car.capnp when upgrading

Added accel to this repo. Tired of updating lib/planner.py twice

Changed acceleration for tests

Added new RAv4 DBC

Added Toyota

Minor tweaks to get toyota in
  • Loading branch information
Joel Jacobs committed Oct 6, 2018
1 parent 4b2c137 commit 6b89bf7
Show file tree
Hide file tree
Showing 28 changed files with 179 additions and 67 deletions.
2 changes: 2 additions & 0 deletions cereal/car.capnp
Expand Up @@ -113,6 +113,8 @@ struct CarState {
leftBlinker @20 :Bool;
rightBlinker @21 :Bool;
genericToggle @23 :Bool;
distanceToggle @26 :Float32;
laneDepartureToggle @27 :Bool;

# lock info
doorOpen @24 :Bool;
Expand Down
10 changes: 5 additions & 5 deletions launch_chffrplus.sh
Expand Up @@ -6,11 +6,11 @@ fi

function launch {
# apply update
if [ "$(git rev-parse HEAD)" != "$(git rev-parse @{u})" ]; then
git reset --hard @{u} &&
git clean -xdf &&
exec "${BASH_SOURCE[0]}"
fi
# if [ "$(git rev-parse HEAD)" != "$(git rev-parse @{u})" ]; then
# git reset --hard @{u} &&
# git clean -xdf &&
# exec "${BASH_SOURCE[0]}"
# fi

# no cpu rationing for now
echo 0-3 > /dev/cpuset/background/cpus
Expand Down
2 changes: 2 additions & 0 deletions opendbc/honda_odyssey_exl_2018_generated.dbc
Expand Up @@ -162,6 +162,7 @@ BO_ 780 ACC_HUD: 8 ADAS
SG_ BOH_5 : 41|1@0+ (1,0) [0|3] "" BDY
SG_ CRUISE_CONTROL_LABEL : 40|1@0+ (1,0) [0|3] "" BDY
SG_ HUD_DISTANCE_3 : 52|1@0+ (1,0) [0|1] "" BDY
SG_ HUD_DISTANCE_LINES : 47|2@0+ (1,0) [0|3] "" BDY
SG_ SET_ME_X03_2 : 55|2@0+ (1,0) [0|3] "" BDY
SG_ SET_ME_X01 : 48|1@0+ (1,0) [0|1] "" BDY
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" BDY
Expand Down Expand Up @@ -224,6 +225,7 @@ VAL_ 506 FCW 3 "fcw" 2 "fcw" 1 "fcw" 0 "no_fcw" ;
VAL_ 506 CHIME 4 "double_chime" 3 "single_chime" 2 "continuous_chime" 1 "repeating_chime" 0 "no_chime" ;
VAL_ 780 CRUISE_SPEED 255 "no_speed" 252 "stopped" ;
VAL_ 780 HUD_LEAD 3 "acc_off" 2 "solid_car" 1 "dashed_car" 0 "no_car" ;
VAL_ 780 HUD_DISTANCE_LINES 0 "furthest" 3 "2nd_furthest" 2 "3rd_furthest" 1 "closest" ;
VAL_ 829 BEEP 3 "single_beep" 2 "triple_beep" 1 "repeated_beep" 0 "no_beep" ;

CM_ "honda_odyssey_exl_2018.dbc starts here"
Expand Down
18 changes: 13 additions & 5 deletions opendbc/toyota_rav4_2017_pt_generated.dbc
Expand Up @@ -15,14 +15,14 @@ BO_ 359 STEERING_IPAS_COMMA: 8 IPAS
CM BO_ STEERING_IPAS_COMMA "Copy of msg 614 so we can do angle control while the Park Assist ECU is connected (Panda spoofs 614 with 359 on connector J70). Note that addresses 0x266 and 0x167 are checksum-invariant";

BO_ 512 GAS_COMMAND: 6 EON
SG_ GAS_COMMAND : 7|16@0+ (0.0244140625,0) [0|1] "" INTERCEPTOR
SG_ GAS_COMMAND2 : 23|16@0+ (0.0244140625,-11.962890625) [0|1] "" INTERCEPTOR
SG_ GAS_COMMAND : 7|16@0+ (0.159375,-75.555) [0|1] "" INTERCEPTOR
SG_ GAS_COMMAND2 : 23|16@0+ (0.159375,-151.111) [0|1] "" INTERCEPTO
SG_ ENABLE : 39|1@0+ (1,0) [0|1] "" INTERCEPTOR
SG_ CHECKSUM : 47|8@0+ (1,0) [0|3] "" INTERCEPTOR

BO_ 513 GAS_SENSOR: 6 INTERCEPTOR
SG_ INTERCEPTOR_GAS : 7|16@0+ (0.0244140625,0) [0|1] "" EON
SG_ INTERCEPTOR_GAS2 : 23|16@0+ (0.0244140625,-11.962890625) [0|1] "" EON
SG_ INTERCEPTOR_GAS : 7|16@0+ (0.159375,-151.111) [0|1] "" EON
SG_ INTERCEPTOR_GAS2 : 23|16@0+ (0.159375,-75.555) [0|1] "" EON
SG_ STATE : 39|8@0+ (1,0) [0|255] "" EON
SG_ CHECKSUM : 47|8@0+ (1,0) [0|3] "" EON

Expand Down Expand Up @@ -94,6 +94,10 @@ BO_ 466 PCM_CRUISE: 8 XXX
SG_ CRUISE_STATE : 55|4@0+ (1,0) [0|15] "" XXX
SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX

BO_ 515 JOEL_ID: 2 XXX
SG_ ACC_DISTANCE : 7|1@0+ (1,0) [0|1] "" XXX
SG_ LANE_WARNING : 15|1@0+ (1,0) [0|1] "" XXX

BO_ 552 ACCELEROMETER: 8 XXX
SG_ ACCEL_Z : 22|15@0- (1,0) [0|32767] "" XXX
SG_ ACCEL_X : 6|15@0- (0.001,0) [-20|20] "m/s2" XXX
Expand Down Expand Up @@ -128,6 +132,7 @@ BO_ 742 LEAD_INFO: 8 DSU

BO_ 835 ACC_CONTROL: 8 DSU
SG_ ACCEL_CMD : 7|16@0- (0.001,0) [-20|20] "m/s2" HCU
SG_ ACC_DISTANCE : 20|1@0+ (1,0) [0|1] "" XXX
SG_ SET_ME_X63 : 23|8@0+ (1,0) [0|255] "" HCU
SG_ SET_ME_1 : 30|1@0+ (1,0) [0|1] "" HCU
SG_ RELEASE_STANDSTILL : 31|1@0+ (1,0) [0|1] "" HCU
Expand All @@ -147,11 +152,13 @@ BO_ 467 PCM_CRUISE_2: 8 XXX
SG_ LOW_SPEED_LOCKOUT : 14|2@0+ (1,0) [0|3] "kph" XXX
SG_ SET_SPEED : 23|8@0+ (1,0) [0|255] "kph" XXX
SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX
SG_ DISTANCE_LINES : 12|2@0+ (1,0) [0|3] "" XXX

BO_ 921 PCM_CRUISE_SM: 8 XXX
SG_ MAIN_ON : 4|1@0+ (1,0) [0|1] "" XXX
SG_ CRUISE_CONTROL_STATE : 11|4@0+ (1,0) [0|15] "" XXX
SG_ UI_SET_SPEED : 31|8@0+ (1,0) [0|255] "" XXX
SG_ DISTANCE_LINES : 14|2@0+ (1,0) [0|3] "" XXX

BO_ 951 ESP_CONTROL: 8 ESP
SG_ TC_DISABLED : 13|1@0+ (1,0) [0|1] "" XXX
Expand Down Expand Up @@ -224,7 +231,8 @@ CM_ "CHFFR_METRIC 37 STEER_ANGLE STEER_ANGLE 0.36 180";

CM_ "toyota_rav4_2017_pt.dbc starts here"


BO_ 352 HUD: 8 XXX
SG_ DISTANCE_LINES : 25|2@1+ (1,0) [0|3] "" XXX

BO_ 548 BRAKE_MODULE: 8 XXX
SG_ BRAKE_PRESSURE : 43|12@0+ (1,0) [0|4047] "" XXX
Expand Down
3 changes: 3 additions & 0 deletions selfdrive/can/parser.cc
Expand Up @@ -436,6 +436,9 @@ int main(int argc, char** argv) {
{0x296, "CRUISE_BUTTONS", 0},
{0x1a4, "ESP_DISABLED", 1},
{0x30c, "HUD_LEAD", 0},
{0x30c, "HUD_DISTANCE_3", 0},
{0x30c, "HUD_DISTANCE_LINES", 0},
{0x30c, "ENABLE_MINI_CAR", 0},
{0x1a4, "USER_BRAKE", 0},
{0x18f, "STEER_STATUS", 5},
{0x1d0, "WHEEL_SPEED_RR", 0},
Expand Down
15 changes: 10 additions & 5 deletions selfdrive/car/honda/carcontroller.py
Expand Up @@ -49,10 +49,9 @@ def process_hud_alert(hud_alert):

return fcw_display, steer_required, acc_alert


HUDData = namedtuple("HUDData",
["pcm_accel", "v_cruise", "mini_car", "car", "X4",
"lanes", "beep", "chime", "fcw", "acc_alert", "steer_required"])
"lanes", "beep", "chime", "fcw", "acc_alert", "steer_required", "distance", "distance_lines"])


class CarController(object):
Expand Down Expand Up @@ -98,16 +97,22 @@ def update(self, sendcan, enabled, CS, frame, actuators, \
hud_car = 1
else:
hud_car = 0

# For lateral control-only, send chimes as a beep since we don't send 0x1fa
if CS.CP.radarOffCan:
snd_beep = snd_beep if snd_beep is not 0 else snd_chime

#print chime, alert_id, hud_alert
fcw_display, steer_required, acc_alert = process_hud_alert(hud_alert)

hud = HUDData(int(pcm_accel), int(round(hud_v_cruise)), 1, hud_car,
0xc1, hud_lanes, int(snd_beep), snd_chime, fcw_display, acc_alert, steer_required)
if CS.distanceToggle == 1:
hudDistanceToggle = 3
else:
hudDistanceToggle = CS.distanceToggle - 1

#hud = HUDData(int(pcm_accel), int(round(hud_v_cruise)), 1, hud_car,
hud = HUDData(int(pcm_accel), int(round(hud_v_cruise)), 1, int(hudDistanceToggle),
0xc1, hud_lanes, int(snd_beep), snd_chime, fcw_display, acc_alert, steer_required, 1, 0)

if not all(isinstance(x, int) and 0 <= x < 256 for x in hud):
hud = HUDData(0xc6, 255, 64, 0xc0, 209, 0x40, 0, 0, 0, 0)
Expand Down
12 changes: 12 additions & 0 deletions selfdrive/car/honda/carstate.py
Expand Up @@ -49,6 +49,9 @@ def get_can_signals(CP):
("CRUISE_BUTTONS", "SCM_BUTTONS", 0),
("ESP_DISABLED", "VSA_STATUS", 1),
("HUD_LEAD", "ACC_HUD", 0),
("HUD_DISTANCE_3", "ACC_HUD", 0),
("HUD_DISTANCE_LINES", "ACC_HUD", 0),
("ENABLE_MINI_CAR", "ACC_HUD", 0),
("USER_BRAKE", "VSA_STATUS", 0),
("STEER_STATUS", "STEER_STATUS", 5),
("GEAR_SHIFTER", "GEARBOX", 0),
Expand Down Expand Up @@ -142,6 +145,7 @@ def __init__(self, CP):

self.cruise_buttons = 0
self.cruise_setting = 0
self.distanceToggle = 1
self.v_cruise_pcm_prev = 0
self.blinker_on = 0

Expand Down Expand Up @@ -229,6 +233,11 @@ def update(self, cp):

self.cruise_setting = cp.vl["SCM_BUTTONS"]['CRUISE_SETTING']
self.cruise_buttons = cp.vl["SCM_BUTTONS"]['CRUISE_BUTTONS']
if self.cruise_setting == 3 and self.prev_cruise_setting == 0:
if self.distanceToggle != 3:
self.distanceToggle += 1
else:
self.distanceToggle = 1

self.blinker_on = cp.vl["SCM_FEEDBACK"]['LEFT_BLINKER'] or cp.vl["SCM_FEEDBACK"]['RIGHT_BLINKER']
self.left_blinker_on = cp.vl["SCM_FEEDBACK"]['LEFT_BLINKER']
Expand Down Expand Up @@ -288,6 +297,9 @@ def update(self, cp):
self.user_brake = cp.vl["VSA_STATUS"]['USER_BRAKE']
self.pcm_acc_status = cp.vl["POWERTRAIN_DATA"]['ACC_STATUS']
self.hud_lead = cp.vl["ACC_HUD"]['HUD_LEAD']
self.hud_distance = cp.vl["ACC_HUD"]['HUD_DISTANCE_3']
self.hud_distance_lines = cp.vl["ACC_HUD"]['HUD_DISTANCE_LINES']
self.hud_mini_car = cp.vl["ACC_HUD"]['ENABLE_MINI_CAR']


# carstate standalone tester
Expand Down
2 changes: 2 additions & 0 deletions selfdrive/car/honda/hondacan.py
Expand Up @@ -89,6 +89,8 @@ def create_ui_commands(packer, pcm_speed, hud, car_fingerprint, idx):
'CRUISE_SPEED': hud.v_cruise,
'ENABLE_MINI_CAR': hud.mini_car,
'HUD_LEAD': hud.car,
'HUD_DISTANCE_3': hud.distance,
'HUD_DISTANCE_LINES': hud.distance_lines,
'SET_ME_X03': 0x03,
'SET_ME_X03_2': 0x03,
'SET_ME_X01': 0x01,
Expand Down
1 change: 1 addition & 0 deletions selfdrive/car/honda/interface.py
Expand Up @@ -385,6 +385,7 @@ def update(self, c):
ret.wheelSpeeds.fr = self.CS.v_wheel_fr
ret.wheelSpeeds.rl = self.CS.v_wheel_rl
ret.wheelSpeeds.rr = self.CS.v_wheel_rr
ret.distanceToggle = self.CS.distanceToggle

# gas pedal
ret.gas = self.CS.car_gas / 256.0
Expand Down
8 changes: 7 additions & 1 deletion selfdrive/car/toyota/carcontroller.py
Expand Up @@ -202,10 +202,16 @@ def update(self, sendcan, enabled, CS, frame, actuators,
elif ECU.APGS in self.fake_ecus:
can_sends.append(create_ipas_steer_command(self.packer, 0, 0, True))

if CS.distance_toggle == True:
distance = 0b01110011 #x73 comma with toggle - toggle is 5th bit from right
#distance = 0b10010011 #x93 stock with toggle
else:
distance = 0b01100011 #x63 comma with toggle - toggle is 5th bit from right

# accel cmd comes from DSU, but we can spam can to cancel the system even if we are using lat only control
if (frame % 3 == 0 and ECU.DSU in self.fake_ecus) or (pcm_cancel_cmd and ECU.CAM in self.fake_ecus):
if ECU.DSU in self.fake_ecus:
can_sends.append(create_accel_command(self.packer, apply_accel, pcm_cancel_cmd, self.standstill_req))
can_sends.append(create_accel_command(self.packer, apply_accel, pcm_cancel_cmd, self.standstill_req, distance))
else:
can_sends.append(create_accel_command(self.packer, 0, pcm_cancel_cmd, False))

Expand Down
16 changes: 16 additions & 0 deletions selfdrive/car/toyota/carstate.py
Expand Up @@ -3,6 +3,7 @@
from selfdrive.can.parser import CANParser, CANDefine
from selfdrive.config import Conversions as CV
from selfdrive.car.toyota.values import CAR, DBC, STEER_THRESHOLD
import time

def parse_gear_shifter(gear, vals):

Expand All @@ -13,6 +14,8 @@ def parse_gear_shifter(gear, vals):
except KeyError:
return "unknown"

if not "dist_buttime" in locals():
dist_buttime = time.clock()

def get_can_parser(CP):

Expand All @@ -39,13 +42,16 @@ def get_can_parser(CP):
("MAIN_ON", "PCM_CRUISE_2", 0),
("SET_SPEED", "PCM_CRUISE_2", 0),
("LOW_SPEED_LOCKOUT", "PCM_CRUISE_2", 0),
("DISTANCE_LINES", "PCM_CRUISE_2", 0),
("STEER_TORQUE_DRIVER", "STEER_TORQUE_SENSOR", 0),
("STEER_TORQUE_EPS", "STEER_TORQUE_SENSOR", 0),
("TURN_SIGNALS", "STEERING_LEVERS", 3), # 3 is no blinkers
("LKA_STATE", "EPS_STATUS", 0),
("IPAS_STATE", "EPS_STATUS", 1),
("BRAKE_LIGHTS_ACC", "ESP_CONTROL", 0),
("AUTO_HIGH_BEAM", "LIGHT_STALK", 0),
("ACC_DISTANCE", "JOEL_ID", 0),
("LANE_WARNING", "JOEL_ID", 0),
]

checks = [
Expand Down Expand Up @@ -73,6 +79,8 @@ def __init__(self, CP):
self.shifter_values = self.can_define.dv["GEAR_PACKET"]['GEAR']
self.left_blinker_on = 0
self.right_blinker_on = 0
self.distanceToggle = 1
self.distance_toggle = False

# initialize can parser
self.car_fingerprint = CP.carFingerprint
Expand Down Expand Up @@ -144,8 +152,16 @@ def update(self, cp):
self.pcm_acc_status = cp.vl["PCM_CRUISE"]['CRUISE_STATE']
self.gas_pressed = not cp.vl["PCM_CRUISE"]['GAS_RELEASED']
self.low_speed_lockout = cp.vl["PCM_CRUISE_2"]['LOW_SPEED_LOCKOUT'] == 2
self.read_distance_lines = cp.vl["PCM_CRUISE_2"]['DISTANCE_LINES']
self.brake_lights = bool(cp.vl["ESP_CONTROL"]['BRAKE_LIGHTS_ACC'] or self.brake_pressed)
if self.CP.carFingerprint == CAR.PRIUS:
self.generic_toggle = cp.vl["AUTOPARK_STATUS"]['STATE'] != 0
else:
self.generic_toggle = bool(cp.vl["LIGHT_STALK"]['AUTO_HIGH_BEAM'])
self.lane_departure_toggle = bool(cp.vl["JOEL_ID"]['LANE_WARNING'])
global dist_buttime
if time.clock() - dist_buttime > .05:
print str(self.read_distance_lines) + " read_distance_lines"
self.distance_toggle = bool(cp.vl["JOEL_ID"]['ACC_DISTANCE'])
self.distanceToggle = self.read_distance_lines
dist_buttime = time.clock()
16 changes: 16 additions & 0 deletions selfdrive/car/toyota/interface.py
Expand Up @@ -7,12 +7,18 @@
from selfdrive.car.toyota.carstate import CarState, get_can_parser
from selfdrive.car.toyota.values import ECU, check_ecu_msgs, CAR
from selfdrive.swaglog import cloudlog
import time
import requests
import threading
from secret import *

try:
from selfdrive.car.toyota.carcontroller import CarController
except ImportError:
CarController = None

if not "lane_buttime" in locals():
lane_buttime = time.clock()

class CarInterface(object):
def __init__(self, CP, sendcan=None):
Expand Down Expand Up @@ -264,6 +270,14 @@ def update(self, c):
be.pressed = self.CS.right_blinker_on != 0
buttonEvents.append(be)

global lane_buttime
if self.CS.lane_departure_toggle:
if time.clock() - lane_buttime > 1:
threading.Thread(target=requests.get, args=(lane_departure_url,)).start()
with open("/button.log", "a") as lane:
lane.write("opened Garage\n")
lane_buttime = time.clock()

ret.buttonEvents = buttonEvents
ret.leftBlinker = bool(self.CS.left_blinker_on)
ret.rightBlinker = bool(self.CS.right_blinker_on)
Expand All @@ -272,6 +286,8 @@ def update(self, c):
ret.seatbeltUnlatched = not self.CS.seatbelt

ret.genericToggle = self.CS.generic_toggle
ret.laneDepartureToggle = self.CS.lane_departure_toggle
ret.distanceToggle = self.CS.distanceToggle

# events
events = []
Expand Down
1 change: 1 addition & 0 deletions selfdrive/car/toyota/secret.py
1 change: 1 addition & 0 deletions selfdrive/car/toyota/secret.py.example
@@ -0,0 +1 @@
lane_departure_url = "https://<some url to trigger somethning>"
4 changes: 2 additions & 2 deletions selfdrive/car/toyota/toyotacan.py
Expand Up @@ -64,11 +64,11 @@ def create_steer_command(packer, steer, raw_cnt):
return packer.make_can_msg("STEERING_LKA", 0, values)


def create_accel_command(packer, accel, pcm_cancel, standstill_req):
def create_accel_command(packer, accel, pcm_cancel, standstill_req, distance):
# TODO: find the exact canceling bit
values = {
"ACCEL_CMD": accel,
"SET_ME_X63": 0x63,
"SET_ME_X63": distance,
"SET_ME_1": 1,
"RELEASE_STANDSTILL": not standstill_req,
"CANCEL_REQ": pcm_cancel,
Expand Down
2 changes: 1 addition & 1 deletion selfdrive/car/toyota/values.py
Expand Up @@ -79,7 +79,7 @@ def check_ecu_msgs(fingerprint, ecu):

FINGERPRINTS = {
CAR.RAV4: [{
36: 8, 37: 8, 170: 8, 180: 8, 186: 4, 426: 6, 452: 8, 464: 8, 466: 8, 467: 8, 547: 8, 548: 8, 552: 4, 562: 4, 608: 8, 610: 5, 643: 7, 705: 8, 725: 2, 740: 5, 800: 8, 835: 8, 836: 8, 849: 4, 869: 7, 870: 7, 871: 2, 896: 8, 897: 8, 900: 6, 902: 6, 905: 8, 911: 8, 916: 3, 918: 7, 921: 8, 933: 8, 944: 8, 945: 8, 951: 8, 955: 4, 956: 8, 979: 2, 998: 5, 999: 7, 1000: 8, 1001: 8, 1005: 2, 1008: 2, 1014: 8, 1017: 8, 1041: 8, 1042: 8, 1043: 8, 1044: 8, 1056: 8, 1059: 1, 1114: 8, 1161: 8, 1162: 8, 1163: 8, 1176: 8, 1177: 8, 1178: 8, 1179: 8, 1180: 8, 1181: 8, 1190: 8, 1191: 8, 1192: 8, 1196: 8, 1227: 8, 1228: 8, 1235: 8, 1237: 8, 1263: 8, 1264: 8, 1279: 8, 1408: 8, 1409: 8, 1410: 8, 1552: 8, 1553: 8, 1554: 8, 1555: 8, 1556: 8, 1557: 8, 1561: 8, 1562: 8, 1568: 8, 1569: 8, 1570: 8, 1571: 8, 1572: 8, 1584: 8, 1589: 8, 1592: 8, 1593: 8, 1595: 8, 1596: 8, 1597: 8, 1600: 8, 1656: 8, 1664: 8, 1728: 8, 1745: 8, 1779: 8, 1904: 8, 1912: 8, 1990: 8, 1998: 8
36: 8, 37: 8, 170: 8, 180: 8, 186: 4, 426: 6, 452: 8, 464: 8, 466: 8, 467: 8, 512: 6, 513: 6, 515: 2, 547: 8, 548: 8, 552: 4, 562: 4, 608: 8, 610: 5, 643: 7, 705: 8, 725: 2, 740: 5, 800: 8, 835: 8, 836: 8, 849: 4, 869: 7, 870: 7, 871: 2, 896: 8, 897: 8, 900: 6, 902: 6, 905: 8, 911: 8, 916: 3, 918: 7, 921: 8, 933: 8, 944: 8, 945: 8, 951: 8, 955: 4, 956: 8, 979: 2, 998: 5, 999: 7, 1000: 8, 1001: 8, 1005: 2, 1008: 2, 1014: 8, 1017: 8, 1041: 8, 1042: 8, 1043: 8, 1044: 8, 1056: 8, 1059: 1, 1114: 8, 1161: 8, 1162: 8, 1163: 8, 1176: 8, 1177: 8, 1178: 8, 1179: 8, 1180: 8, 1181: 8, 1190: 8, 1191: 8, 1192: 8, 1196: 8, 1227: 8, 1228: 8, 1235: 8, 1237: 8, 1263: 8, 1264: 8, 1279: 8, 1408: 8, 1409: 8, 1410: 8, 1552: 8, 1553: 8, 1554: 8, 1555: 8, 1556: 8, 1557: 8, 1561: 8, 1562: 8, 1568: 8, 1569: 8, 1570: 8, 1571: 8, 1572: 8, 1584: 8, 1589: 8, 1592: 8, 1593: 8, 1595: 8, 1596: 8, 1597: 8, 1600: 8, 1656: 8, 1664: 8, 1728: 8, 1745: 8, 1779: 8, 1904: 8, 1912: 8, 1990: 8, 1998: 8
}],
CAR.RAV4H: [{
36: 8, 37: 8, 170: 8, 180: 8, 186: 4, 296: 8, 426: 6, 452: 8, 464: 8, 466: 8, 467: 8, 547: 8, 548: 8, 550: 8, 552: 4, 560: 7, 562: 4, 581: 5, 608: 8, 610: 5, 643: 7, 705: 8, 713: 8, 725: 2, 740: 5, 800: 8, 835: 8, 836: 8, 849: 4, 869: 7, 870: 7, 871: 2, 896: 8, 897: 8, 900: 6, 902: 6, 905: 8, 911: 8, 916: 3, 918: 7, 921: 8, 933: 8, 944: 8, 945: 8, 950: 8, 951: 8, 953: 3, 955: 8, 956: 8, 979: 2, 998: 5, 999: 7, 1000: 8, 1001: 8, 1005: 2, 1008: 2, 1014: 8, 1017: 8, 1041: 8, 1042: 8, 1043: 8, 1044: 8, 1056: 8, 1059: 1, 1114: 8, 1161: 8, 1162: 8, 1163: 8, 1176: 8, 1177: 8, 1178: 8, 1179: 8, 1180: 8, 1181: 8, 1184: 8, 1185: 8, 1186: 8, 1190: 8, 1191: 8, 1192: 8, 1196: 8, 1197: 8, 1198: 8, 1199: 8, 1212: 8, 1227: 8, 1228: 8, 1232: 8, 1235: 8, 1237: 8, 1263: 8, 1264: 8, 1279: 8, 1408: 8, 1409: 8, 1410: 8, 1552: 8, 1553: 8, 1554: 8, 1555: 8, 1556: 8, 1557: 8, 1561: 8, 1562: 8, 1568: 8, 1569: 8, 1570: 8, 1571: 8, 1572: 8, 1584: 8, 1589: 8, 1592: 8, 1593: 8, 1595: 8, 1596: 8, 1597: 8, 1600: 8, 1656: 8, 1664: 8, 1728: 8, 1745: 8, 1779: 8, 1904: 8, 1912: 8, 1990: 8, 1998: 8
Expand Down
2 changes: 1 addition & 1 deletion selfdrive/controls/lib/drive_helpers.py
Expand Up @@ -19,7 +19,7 @@ class MPC_COST_LAT:

class MPC_COST_LONG:
TTC = 5.0
DISTANCE = 0.1
DISTANCE = 2
ACCELERATION = 10.0
JERK = 20.0

Expand Down
4 changes: 2 additions & 2 deletions selfdrive/controls/lib/longitudinal_mpc/Makefile
Expand Up @@ -13,9 +13,9 @@ QPOASES_FLAGS = -I$(PHONELIBS)/qpoases -I$(PHONELIBS)/qpoases/INCLUDE -I$(PHONEL
ACADO_FLAGS = -I$(PHONELIBS)/acado/include -I$(PHONELIBS)/acado/include/acado

ifeq ($(UNAME_M),aarch64)
ACADO_LIBS := -L $(PHONELIBS)/acado/aarch64/lib -l:libacado_toolkit.a -l:libacado_casadi.a -l:libacado_csparse.a
ACADO_LIBS := -L $(PHONELIBS)/acado/aarch64/lib -l:libacado_toolkit_s -l:libacado_casadi.a -l:libacado_csparse.a
else
ACADO_LIBS := -L $(PHONELIBS)/acado/x64/lib -l:libacado_toolkit.a -l:libacado_casadi.a -l:libacado_csparse.a
ACADO_LIBS := -L $(PHONELIBS)/acado/x64/lib -l:libacado_toolkit_s -l:libacado_casadi.a -l:libacado_csparse.a
endif

OBJS = \
Expand Down
2 changes: 2 additions & 0 deletions selfdrive/controls/lib/longitudinal_mpc/fixdistancevar.sh
@@ -0,0 +1,2 @@
#!/usr/bin/env bash
sed -i -e 's/1\.2345678[^)]*)/TR)/g' -e 's/out)/out, double TR)/g' -e 's/Objective( )/Objective(double TR)/g' -e 's/ValueOut )/ValueOut, TR )/g' -e 's/ionStep( )/ionStep(double TR)/g' -e 's/Objective(double TR);/Objective(TR);/g' mpc_export/acado_solver.c

This comment has been minimized.

Copy link
@rhinodavid

rhinodavid Feb 24, 2019

Placeholder variable in generator.cpp is 1234567.8 but regex appears to match 1.2345678

0 comments on commit 6b89bf7

Please sign in to comment.