Skip to content

Commit cbca866

Browse files
authored
Merge pull request #1 from eFiniLan/master_dev
up to 2023-04-26 commits
2 parents aeef76b + f08c414 commit cbca866

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+470
-314
lines changed

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,3 +83,13 @@ build/
8383
!**/.gitkeep
8484

8585
poetry.toml
86+
87+
# rick - these are generated during compilation.
88+
selfdrive/camerad/camerad
89+
selfdrive/golden/
90+
selfdrive/legacy_modeld/_dmonitoringmodeld
91+
selfdrive/legacy_modeld/_modeld
92+
selfdrive/legacy_modeld/models/supercombo.thneed
93+
selfdrive/legacy_modeld/models/supercombo_badweights.thneed
94+
selfdrive/legacy_modeld/thneed/compile
95+
selfdrive/loggerd/bootlog

README.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@ legacypilot is a side project that enables comma.ai EON and Comma Two devices to
1111

1212
legacypilot combines the Nuclear Grade Model with the latest openpilot (almost) codebase to create a hybrid solution. With the legacypilot project, we have stripped out nearly 99% of the dragonpilot code.
1313

14+
In summary, legacypilot is based on Openpilot 0.8.16 with the latest vehicle model support from the Openpilot master branch.
15+
16+
Please note that this build is and will always be in the experimental phase and may not be suitable for use as a daily driver.
17+
18+
I recommend using the openpilot [commatwo_master](https://github.com/commaai/openpilot/tree/commatwo_master) branch for your daily driving needs.
19+
20+
Please see [README_openpilot.md](README_openpilot.md) for the original readme.
1421

1522
## Why use legacypilot
1623

@@ -22,8 +29,9 @@ I have decided to make this side project open source for users who wish to:
2229
* Experience pure openpilot (without the modifications of dragonpilot)
2330
* Make their own EON/C2 fork without spending hundreds of hours reverting and testing code.
2431

25-
By making this project open source, I hope to alleviate some of the frustration and complaints about not being able to access the source code. However, I still encourage users to consider purchasing a [comma 3](https://shop.comma.ai) for the best and up-to-date openpilot experience.
32+
By making this project open source, I hope to alleviate some of the frustration and complaints about not being able to access the dragonpilot source code.
2633

34+
I still encourage users to consider purchasing a [comma 3](https://shop.comma.ai) for the best and up-to-date openpilot experience.
2735

2836
## Limitations
2937

@@ -33,9 +41,3 @@ By making this project open source, I hope to alleviate some of the frustration
3341
* Navigation On Openpilot (NOO) is not supported, as it requires a newer driving model that is not currently available in legacypilot.
3442
* Services are not optimized for resource usage, and using all services may result in overheating issues.
3543
* Language files can only be generated in a PC due to missing Qt5 tools.
36-
37-
In summary, legacypilot is based on Openpilot 0.8.16 with the latest vehicle model support from the Openpilot master branch.
38-
39-
However, please note that this build is still in the experimental phase and may not be suitable for use as a daily driver. We recommend using the openpilot mastertwo branch for your daily driving needs.
40-
41-
Please see README_openpilot.md for the original readme.

SConstruct

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ import numpy as np
77

88
import SCons.Errors
99

10+
SCons.Warnings.warningAsException(True)
11+
1012
TICI = os.path.isfile('/TICI')
1113
AGNOS = TICI
1214

@@ -359,7 +361,9 @@ else:
359361
qt_libs = ['gui', 'adreno_utils']
360362
elif arch != "Darwin":
361363
qt_libs += ["GL"]
364+
qt_env['QT3DIR'] = qt_env['QTDIR']
362365

366+
# compatibility for older SCons versions
363367
try:
364368
qt_env.Tool('qt3')
365369
except SCons.Errors.UserError:
@@ -491,7 +495,7 @@ SConscript(['system/sensord/SConscript'])
491495
SConscript(['selfdrive/ui/SConscript'])
492496
# SConscript(['selfdrive/navd/SConscript'])
493497

494-
if arch in ['x86_64', 'Darwin'] or GetOption('extras'):
498+
if (arch in ['x86_64', 'Darwin'] and Dir('#tools/cabana/').exists()) or GetOption('extras'):
495499
SConscript(['tools/replay/SConscript'])
496500
SConscript(['tools/cabana/SConscript'])
497501

common/legacy_modeldata.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
#include "system/hardware/hw.h"
66

77
const int TRAJECTORY_SIZE = 33;
8-
const int LAT_MPC_N = 16;
9-
const int LON_MPC_N = 32;
108
const float MIN_DRAW_DISTANCE = 10.0;
119
const float MAX_DRAW_DISTANCE = 100.0;
1210

docs/docker/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ WORKDIR ${OPENPILOT_PATH}
1111

1212
COPY SConstruct ${OPENPILOT_PATH}
1313

14+
COPY ./body ${OPENPILOT_PATH}/body
1415
COPY ./third_party ${OPENPILOT_PATH}/third_party
1516
COPY ./site_scons ${OPENPILOT_PATH}/site_scons
1617
COPY ./laika ${OPENPILOT_PATH}/laika

opendbc

Submodule opendbc updated 51 files

panda

Submodule panda updated 75 files

release/files_common

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -396,9 +396,9 @@ selfdrive/modeld/runners/run.h
396396
selfdrive/monitoring/dmonitoringd.py
397397
selfdrive/monitoring/driver_monitor.py
398398

399+
selfdrive/navd/.gitignore
399400
selfdrive/navd/__init__.py
400-
selfdrive/navd/navd.py
401-
selfdrive/navd/helpers.py
401+
selfdrive/navd/**
402402

403403
selfdrive/assets/.gitignore
404404
selfdrive/assets/assets.qrc

selfdrive/car/ford/carcontroller.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from common.numpy_fast import clip
33
from opendbc.can.packer import CANPacker
44
from selfdrive.car import apply_std_steer_angle_limits
5-
from selfdrive.car.ford.fordcan import create_acc_command, create_acc_ui_msg, create_button_msg, create_lat_ctl_msg, \
5+
from selfdrive.car.ford.fordcan import create_acc_msg, create_acc_ui_msg, create_button_msg, create_lat_ctl_msg, \
66
create_lat_ctl2_msg, create_lka_msg, create_lkas_ui_msg
77
from selfdrive.car.ford.values import CANBUS, CANFD_CARS, CarControllerParams
88

@@ -76,7 +76,7 @@ def update(self, CC, CS, now_nanos):
7676
gas = -5.0
7777
decel = True
7878

79-
can_sends.append(create_acc_command(self.packer, CC.longActive, gas, accel, precharge_brake, decel))
79+
can_sends.append(create_acc_msg(self.packer, CC.longActive, gas, accel, precharge_brake, decel))
8080

8181
### ui ###
8282
send_ui = (self.main_on_last != main_on) or (self.lkas_enabled_last != CC.latActive) or (self.steer_alert_last != steer_alert)

selfdrive/car/ford/fordcan.py

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ def create_lat_ctl2_msg(packer, mode: int, path_offset: float, path_angle: float
9797
return packer.make_can_msg("LateralMotionControl2", CANBUS.main, values)
9898

9999

100-
def create_acc_command(packer, long_active: bool, gas: float, accel: float, precharge_brake: bool, decel: bool):
100+
def create_acc_msg(packer, long_active: bool, gas: float, accel: float, precharge_brake: bool, decel: bool):
101101
"""
102102
Creates a CAN message for the Ford ACC Command.
103103
@@ -117,6 +117,40 @@ def create_acc_command(packer, long_active: bool, gas: float, accel: float, prec
117117
return packer.make_can_msg("ACCDATA", CANBUS.main, values)
118118

119119

120+
def create_acc_ui_msg(packer, main_on: bool, enabled: bool, hud_control, stock_values: dict):
121+
"""
122+
Creates a CAN message for the Ford IPC adaptive cruise, forward collision warning and traffic jam assist status.
123+
124+
Stock functionality is maintained by passing through unmodified signals.
125+
126+
Frequency is 20Hz.
127+
"""
128+
129+
# Tja_D_Stat
130+
if enabled:
131+
if hud_control.leftLaneDepart:
132+
status = 3 # ActiveInterventionLeft
133+
elif hud_control.rightLaneDepart:
134+
status = 4 # ActiveInterventionRight
135+
else:
136+
status = 2 # Active
137+
elif main_on:
138+
if hud_control.leftLaneDepart:
139+
status = 5 # ActiveWarningLeft
140+
elif hud_control.rightLaneDepart:
141+
status = 6 # ActiveWarningRight
142+
else:
143+
status = 1 # Standby
144+
else:
145+
status = 0 # Off
146+
147+
values = {
148+
**stock_values,
149+
"Tja_D_Stat": status,
150+
}
151+
return packer.make_can_msg("ACCDATA_3", CANBUS.main, values)
152+
153+
120154
def create_lkas_ui_msg(packer, main_on: bool, enabled: bool, steer_alert: bool, hud_control, stock_values: dict):
121155
"""
122156
Creates a CAN message for the Ford IPC IPMA/LKAS status.
@@ -168,40 +202,6 @@ def create_lkas_ui_msg(packer, main_on: bool, enabled: bool, steer_alert: bool,
168202
return packer.make_can_msg("IPMA_Data", CANBUS.main, values)
169203

170204

171-
def create_acc_ui_msg(packer, main_on: bool, enabled: bool, hud_control, stock_values: dict):
172-
"""
173-
Creates a CAN message for the Ford IPC adaptive cruise, forward collision warning and traffic jam assist status.
174-
175-
Stock functionality is maintained by passing through unmodified signals.
176-
177-
Frequency is 20Hz.
178-
"""
179-
180-
# Tja_D_Stat
181-
if enabled:
182-
if hud_control.leftLaneDepart:
183-
status = 3 # ActiveInterventionLeft
184-
elif hud_control.rightLaneDepart:
185-
status = 4 # ActiveInterventionRight
186-
else:
187-
status = 2 # Active
188-
elif main_on:
189-
if hud_control.leftLaneDepart:
190-
status = 5 # ActiveWarningLeft
191-
elif hud_control.rightLaneDepart:
192-
status = 6 # ActiveWarningRight
193-
else:
194-
status = 1 # Standby
195-
else:
196-
status = 0 # Off
197-
198-
values = {
199-
**stock_values,
200-
"Tja_D_Stat": status,
201-
}
202-
return packer.make_can_msg("ACCDATA_3", CANBUS.main, values)
203-
204-
205205
def create_button_msg(packer, stock_values: dict, cancel=False, resume=False, tja_toggle=False,
206206
bus: int = CANBUS.camera):
207207
"""

0 commit comments

Comments
 (0)