Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into niro-hev-2023-port
Browse files Browse the repository at this point in the history
# Conflicts:
#	RELEASES.md
#	docs/CARS.md
#	selfdrive/car/hyundai/interface.py
#	selfdrive/car/hyundai/values.py
#	selfdrive/car/torque_data/override.yaml
  • Loading branch information
sunnyhaibin committed Feb 3, 2023
2 parents c7d9816 + 41304db commit 27e67a6
Show file tree
Hide file tree
Showing 223 changed files with 6,386 additions and 2,574 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/selfdrive_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
cp .pylintrc $STRIPPED_DIR
cp mypy.ini $STRIPPED_DIR
cd $STRIPPED_DIR
${{ env.RUN }} "SKIP=test_translations pre-commit run --all"
${{ env.RUN }} "pre-commit run --all"
build_all:
name: build all
Expand Down Expand Up @@ -219,6 +219,7 @@ jobs:
$UNIT_TEST selfdrive/car && \
$UNIT_TEST selfdrive/locationd && \
selfdrive/locationd/test/_test_locationd_lib.py && \
./selfdrive/locationd/test/test_glonass_runner && \
$UNIT_TEST selfdrive/athena && \
$UNIT_TEST selfdrive/thermald && \
$UNIT_TEST system/hardware/tici && \
Expand Down
9 changes: 6 additions & 3 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ pipeline {

parallel {

/*
stage('simulator') {
agent {
dockerfile {
Expand All @@ -90,7 +91,8 @@ pipeline {
}
}
steps {
sh "git config --global --add safe.directory ${WORKSPACE}"
sh "git config --global --add safe.directory '*'"
sh "git submodule update --init --recursive"
sh "git lfs pull"
lock(resource: "", label: "simulator", inversePrecedence: true, quantity: 1) {
sh "${WORKSPACE}/tools/sim/build_container.sh"
Expand All @@ -107,6 +109,7 @@ pipeline {
}
}
}
*/

stage('build') {
agent { docker { image 'ghcr.io/commaai/alpine-ssh'; args '--user=root' } }
Expand Down Expand Up @@ -151,7 +154,7 @@ pipeline {
stage('camerad-ar') {
agent { docker { image 'ghcr.io/commaai/alpine-ssh'; args '--user=root' } }
steps {
phone_steps("tici-ar0321", [
phone_steps("tici-ar0231", [
["build", "cd selfdrive/manager && ./build.py"],
["test camerad", "python system/camerad/test/test_camerad.py"],
["test exposure", "python system/camerad/test/test_exposure.py"],
Expand Down Expand Up @@ -189,7 +192,7 @@ pipeline {
steps {
phone_steps("tici-common", [
["build", "cd selfdrive/manager && ./build.py"],
["model replay", "cd selfdrive/test/process_replay && ./model_replay.py"],
["model replay", "cd selfdrive/test/process_replay && NO_NAV=1 ./model_replay.py"],
])
}
}
Expand Down
2 changes: 2 additions & 0 deletions RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ Version 0.9.1 (2022-12-XX)
* Genesis GV60 2023 support thanks to sunnyhaibin!
* Hyundai Tucson 2022-23 support
* Kia Niro Hybrid 2023 support thanks to sunnyhaibin!
* Kia Sorento 2022-23 support thanks to sunnyhaibin!
* Kia Sorento Plug-in Hybrid 2022 support thanks to sunnyhaibin!
* Volkswagen Crafter and MAN TGE 2017-23 support thanks to jyoung8607!

Version 0.9.0 (2022-11-21)
========================
Expand Down
5 changes: 3 additions & 2 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ Export('envCython')

# Qt build environment
qt_env = env.Clone()
qt_modules = ["Widgets", "Gui", "Core", "Network", "Concurrent", "Multimedia", "Quick", "Qml", "QuickWidgets", "Location", "Positioning", "DBus"]
qt_modules = ["Widgets", "Gui", "Core", "Network", "Concurrent", "Multimedia", "Quick", "Qml", "QuickWidgets", "Location", "Positioning", "DBus", "Xml"]

qt_libs = []
if arch == "Darwin":
Expand Down Expand Up @@ -311,6 +311,7 @@ else:
qt_libs = [f"Qt5{m}" for m in qt_modules]
if arch == "larch64":
qt_libs += ["GLESv2", "wayland-client"]
qt_env.PrependENVPath('PATH', Dir("#third_party/qt5/larch64/bin/").abspath)
elif arch != "Darwin":
qt_libs += ["GL"]

Expand Down Expand Up @@ -387,10 +388,10 @@ rednose_config = {
if arch != "larch64":
rednose_config['to_build'].update({
'loc_4': ('#selfdrive/locationd/models/loc_kf.py', True, [], rednose_deps),
'lane': ('#selfdrive/locationd/models/lane_kf.py', True, [], rednose_deps),
'pos_computer_4': ('#rednose/helpers/lst_sq_computer.py', False, [], []),
'pos_computer_5': ('#rednose/helpers/lst_sq_computer.py', False, [], []),
'feature_handler_5': ('#rednose/helpers/feature_handler.py', False, [], []),
'lane': ('#xx/pipeline/lib/ekf/lane_kf.py', True, [], rednose_deps),
})

Export('rednose_config')
Expand Down
2 changes: 1 addition & 1 deletion body
2 changes: 1 addition & 1 deletion cereal
4 changes: 3 additions & 1 deletion common/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@ common_libs = [
'statlog.cc',
'swaglog.cc',
'util.cc',
'gpio.cc',
'i2c.cc',
'watchdog.cc',
]

if arch != "Darwin":
common_libs.append('gpio.cc')

_common = fxn('common', common_libs, LIBS="json11")

files = [
Expand Down
24 changes: 13 additions & 11 deletions common/clutil.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <memory>

#include "common/util.h"
#include "common/swaglog.h"

namespace { // helper functions

Expand All @@ -31,14 +32,14 @@ void cl_print_info(cl_platform_id platform, cl_device_id device) {
case CL_DEVICE_TYPE_ACCELERATOR: type_str = "CL_DEVICE_TYPE_ACCELERATOR"; break;
}

std::cout << "vendor: " << get_platform_info(platform, CL_PLATFORM_VENDOR) << std::endl
<< "platform version: " << get_platform_info(platform, CL_PLATFORM_VERSION) << std::endl
<< "profile: " << get_platform_info(platform, CL_PLATFORM_PROFILE) << std::endl
<< "extensions: " << get_platform_info(platform, CL_PLATFORM_EXTENSIONS) << std::endl
<< "name :" << get_device_info(device, CL_DEVICE_NAME) << std::endl
<< "device version :" << get_device_info(device, CL_DEVICE_VERSION) << std::endl
<< "max work group size :" << work_group_size << std::endl
<< "type = " << device_type << " = " << type_str << std::endl;
LOGD("vendor: %s", get_platform_info(platform, CL_PLATFORM_VENDOR).c_str());
LOGD("platform version: %s", get_platform_info(platform, CL_PLATFORM_VERSION).c_str());
LOGD("profile: %s", get_platform_info(platform, CL_PLATFORM_PROFILE).c_str());
LOGD("extensions: %s", get_platform_info(platform, CL_PLATFORM_EXTENSIONS).c_str());
LOGD("name: %s", get_device_info(device, CL_DEVICE_NAME).c_str());
LOGD("device version: %s", get_device_info(device, CL_DEVICE_VERSION).c_str());
LOGD("max work group size: %d", work_group_size);
LOGD("type = %d = ", device_type, type_str);
}

void cl_print_build_errors(cl_program program, cl_device_id device) {
Expand All @@ -49,7 +50,7 @@ void cl_print_build_errors(cl_program program, cl_device_id device) {
std::string log(log_size, '\0');
clGetProgramBuildInfo(program, device, CL_PROGRAM_BUILD_LOG, log_size, &log[0], NULL);

std::cout << "build failed; status=" << status << ", log:" << std::endl << log << std::endl;
LOGE("build failed; status=%d, log: %s", status, log.c_str());
}

} // namespace
Expand All @@ -61,14 +62,15 @@ cl_device_id cl_get_device_id(cl_device_type device_type) {
CL_CHECK(clGetPlatformIDs(num_platforms, &platform_ids[0], NULL));

for (size_t i = 0; i < num_platforms; ++i) {
std::cout << "platform[" << i << "] CL_PLATFORM_NAME: " << get_platform_info(platform_ids[i], CL_PLATFORM_NAME) << std::endl;
LOGD("platform[%d] CL_PLATFORM_NAME: %s", i, get_platform_info(platform_ids[i], CL_PLATFORM_NAME).c_str());

// Get first device
if (cl_device_id device_id = NULL; clGetDeviceIDs(platform_ids[i], device_type, 1, &device_id, NULL) == 0 && device_id) {
cl_print_info(platform_ids[i], device_id);
return device_id;
}
}
std::cout << "No valid openCL platform found" << std::endl;
LOGE("No valid openCL platform found");
assert(0);
return nullptr;
}
Expand Down
17 changes: 17 additions & 0 deletions common/gpio.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
#include "common/gpio.h"

#ifdef __APPLE__
int gpio_init(int pin_nr, bool output) {
return 0;
}

int gpio_set(int pin_nr, bool high) {
return 0;
}

int gpiochip_get_ro_value_fd(const char* consumer_label, int gpiochiop_id, int pin_nr) {
return 0;
}

#else

#include <fcntl.h>
#include <unistd.h>

Expand Down Expand Up @@ -63,3 +78,5 @@ int gpiochip_get_ro_value_fd(const char* consumer_label, int gpiochiop_id, int p
close(fd);
return rq.fd;
}

#endif
6 changes: 4 additions & 2 deletions common/params.cc
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,14 @@ std::unordered_map<std::string, uint32_t> keys = {
{"DisablePowerDown", PERSISTENT},
{"ExperimentalMode", PERSISTENT},
{"ExperimentalModeConfirmed", PERSISTENT},
{"ExperimentalLongitudinalEnabled", PERSISTENT}, // WARNING: THIS MAY DISABLE AEB
{"ExperimentalLongitudinalEnabled", PERSISTENT},
{"DisableUpdates", PERSISTENT},
{"DisengageOnAccelerator", PERSISTENT},
{"DongleId", PERSISTENT},
{"DoReboot", CLEAR_ON_MANAGER_START},
{"DoShutdown", CLEAR_ON_MANAGER_START},
{"DoUninstall", CLEAR_ON_MANAGER_START},
{"FirmwareObdQueryDone", CLEAR_ON_MANAGER_START | CLEAR_ON_IGNITION_ON},
{"ForcePowerDown", CLEAR_ON_MANAGER_START},
{"GitBranch", PERSISTENT},
{"GitCommit", PERSISTENT},
Expand All @@ -134,6 +135,7 @@ std::unordered_map<std::string, uint32_t> keys = {
{"IsRhdDetected", PERSISTENT},
{"IsTakingSnapshot", CLEAR_ON_MANAGER_START},
{"IsTestedBranch", CLEAR_ON_MANAGER_START},
{"IsReleaseBranch", CLEAR_ON_MANAGER_START},
{"IsUpdateAvailable", CLEAR_ON_MANAGER_START},
{"JoystickDebugMode", CLEAR_ON_MANAGER_START | CLEAR_ON_IGNITION_OFF},
{"LaikadEphemeris", PERSISTENT | DONT_LOG},
Expand Down Expand Up @@ -169,7 +171,7 @@ std::unordered_map<std::string, uint32_t> keys = {
{"Timezone", PERSISTENT},
{"TrainingVersion", PERSISTENT},
{"UbloxAvailable", PERSISTENT},
{"UpdateAvailable", CLEAR_ON_MANAGER_START},
{"UpdateAvailable", CLEAR_ON_MANAGER_START | CLEAR_ON_IGNITION_ON},
{"UpdateFailedCount", CLEAR_ON_MANAGER_START},
{"UpdaterState", CLEAR_ON_MANAGER_START},
{"UpdaterFetchAvailable", CLEAR_ON_MANAGER_START},
Expand Down

0 comments on commit 27e67a6

Please sign in to comment.