mirror of
https://github.com/MoreTore/openpilot.git
synced 2026-10-01 03:43:51 +08:00
build on pc
This commit is contained in:
+23
-23
@@ -37,17 +37,17 @@ repos:
|
||||
hooks:
|
||||
- id: ruff
|
||||
exclude: '^(third_party/)|(msgq/)|(panda/)|(rednose/)|(rednose_repo/)|(tinygrad/)|(tinygrad_repo/)|(teleoprtc/)|(teleoprtc_repo/)'
|
||||
- repo: local
|
||||
hooks:
|
||||
- id: mypy
|
||||
name: mypy
|
||||
entry: mypy
|
||||
language: system
|
||||
types: [python]
|
||||
args:
|
||||
- --local-partial-types
|
||||
- --explicit-package-bases
|
||||
exclude: '^(third_party/)|(body/)|(msgq/)|(opendbc/)|(panda/)|(rednose/)|(rednose_repo/)|(tinygrad/)|(tinygrad_repo/)|(teleoprtc/)|(teleoprtc_repo/)'
|
||||
# - repo: local
|
||||
# hooks:
|
||||
# - id: mypy
|
||||
# name: mypy
|
||||
# entry: mypy
|
||||
# language: system
|
||||
# types: [python]
|
||||
# args:
|
||||
# - --local-partial-types
|
||||
# - --explicit-package-bases
|
||||
# exclude: '^(third_party/)|(body/)|(msgq/)|(opendbc/)|(panda/)|(rednose/)|(rednose_repo/)|(tinygrad/)|(tinygrad_repo/)|(teleoprtc/)|(teleoprtc_repo/)'
|
||||
- repo: local
|
||||
hooks:
|
||||
- id: cppcheck
|
||||
@@ -62,18 +62,18 @@ repos:
|
||||
- --quiet
|
||||
- --force
|
||||
- -j8
|
||||
- repo: https://github.com/cpplint/cpplint
|
||||
rev: 1.6.1
|
||||
hooks:
|
||||
- id: cpplint
|
||||
exclude: '^(third_party/)|(msgq/)|(body/)|(rednose/)|(rednose_repo/)|(opendbc/)|(panda/)|(generated/)'
|
||||
args:
|
||||
- --quiet
|
||||
- --counting=total
|
||||
- --linelength=240
|
||||
# https://google.github.io/styleguide/cppguide.html
|
||||
# relevant rules are whitelisted, see all options with: cpplint --filter=
|
||||
- --filter=-build,-legal,-readability,-runtime,-whitespace,+build/include_subdir,+build/forward_decl,+build/include_what_you_use,+build/deprecated,+whitespace/comma,+whitespace/line_length,+whitespace/empty_if_body,+whitespace/empty_loop_body,+whitespace/empty_conditional_body,+whitespace/forcolon,+whitespace/parens,+whitespace/semicolon,+whitespace/tab,+readability/braces
|
||||
# - repo: https://github.com/cpplint/cpplint
|
||||
# rev: 1.6.1
|
||||
# hooks:
|
||||
# - id: cpplint
|
||||
# exclude: '^(third_party/)|(msgq/)|(body/)|(rednose/)|(rednose_repo/)|(opendbc/)|(panda/)|(generated/)'
|
||||
# args:
|
||||
# - --quiet
|
||||
# - --counting=total
|
||||
# - --linelength=240
|
||||
# # https://google.github.io/styleguide/cppguide.html
|
||||
# # relevant rules are whitelisted, see all options with: cpplint --filter=
|
||||
# - --filter=-build,-legal,-readability,-runtime,-whitespace,+build/include_subdir,+build/forward_decl,+build/include_what_you_use,+build/deprecated,+whitespace/comma,+whitespace/line_length,+whitespace/empty_if_body,+whitespace/empty_loop_body,+whitespace/empty_conditional_body,+whitespace/forcolon,+whitespace/parens,+whitespace/semicolon,+whitespace/tab,+readability/braces
|
||||
- repo: https://github.com/MarcoGorelli/cython-lint
|
||||
rev: v0.16.2
|
||||
hooks:
|
||||
|
||||
@@ -69,6 +69,13 @@ AddOption('--minimal',
|
||||
dest='extras',
|
||||
default=os.path.exists(File('#.lfsconfig').abspath), # minimal by default on release branch (where there's no LFS)
|
||||
help='the minimum build to run openpilot. no tests, tools, etc.')
|
||||
AddOption('--extras',
|
||||
action='store_true',
|
||||
help="build extras")
|
||||
|
||||
AddOption('--nosr',
|
||||
action='store_true',
|
||||
help="don't build the screen recorder")
|
||||
|
||||
## Architecture name breakdown (arch)
|
||||
## - larch64: linux tici aarch64
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include "frogpilot/ui/frogpilot_ui.h"
|
||||
#include "frogpilot/ui/qt/widgets/frogpilot_controls.h"
|
||||
|
||||
static void update_state(FrogPilotUIState *fs) {
|
||||
FrogPilotUIScene &frogpilot_scene = fs->frogpilot_scene;
|
||||
|
||||
@@ -6,6 +6,15 @@
|
||||
#include "selfdrive/ui/qt/onroad/buttons.h"
|
||||
|
||||
class ScreenRecorder : public QPushButton {
|
||||
#ifdef NO_SR
|
||||
public:
|
||||
explicit ScreenRecorder(QWidget *parent = nullptr){}
|
||||
~ScreenRecorder() override{}
|
||||
|
||||
void startRecording(){}
|
||||
void stopRecording(){}
|
||||
|
||||
#else
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
@@ -45,4 +54,5 @@ private:
|
||||
QImage synthesizeFrame(const QImage &frame1, const QImage &frame2, double alpha);
|
||||
|
||||
QWidget *rootWidget;
|
||||
#endif //NO_SR
|
||||
};
|
||||
|
||||
+14
-2
@@ -24,7 +24,7 @@ widgets_src = ["ui.cc", "qt/widgets/input.cc", "qt/widgets/wifi.cc",
|
||||
"qt/widgets/scrollview.cc", "qt/widgets/cameraview.cc", "#third_party/qrcode/QrCode.cc",
|
||||
"qt/request_repeater.cc", "qt/qt_window.cc", "qt/network/networking.cc", "qt/network/wifi_manager.cc"]
|
||||
|
||||
frogpilot_widgets_src = ["../../frogpilot/ui/qt/widgets/frogpilot_controls.cc"]
|
||||
frogpilot_widgets_src = ["../../frogpilot/ui/qt/widgets/frogpilot_controls.cc", "../../frogpilot/ui/frogpilot_ui.cc"]
|
||||
|
||||
widgets_src += frogpilot_widgets_src
|
||||
|
||||
@@ -46,7 +46,7 @@ qt_src = ["main.cc", "qt/sidebar.cc", "qt/body.cc",
|
||||
"qt/onroad/onroad_home.cc", "qt/onroad/annotated_camera.cc",
|
||||
"qt/onroad/buttons.cc", "qt/onroad/alerts.cc"]
|
||||
|
||||
frogpilot_src = ["../../frogpilot/ui/frogpilot_ui.cc", "../../frogpilot/ui/qt/offroad/data_settings.cc",
|
||||
frogpilot_src = ["../../frogpilot/ui/qt/offroad/data_settings.cc",
|
||||
"../../frogpilot/ui/qt/offroad/device_settings.cc", "../../frogpilot/ui/qt/offroad/frogpilot_settings.cc",
|
||||
"../../frogpilot/ui/qt/offroad/lateral_settings.cc", "../../frogpilot/ui/qt/offroad/longitudinal_settings.cc",
|
||||
"../../frogpilot/ui/qt/offroad/maps_settings.cc", "../../frogpilot/ui/qt/offroad/model_settings.cc",
|
||||
@@ -62,6 +62,18 @@ frogpilot_src = ["../../frogpilot/ui/frogpilot_ui.cc", "../../frogpilot/ui/qt/of
|
||||
|
||||
qt_src += frogpilot_src
|
||||
|
||||
if GetOption("nosr") or arch != "larch64":
|
||||
qt_env.Append(CXXFLAGS=['-DNO_SR'])
|
||||
if 'OmxCore' in base_libs:
|
||||
base_libs.remove('OmxCore')
|
||||
if 'OmxCore' in qt_libs:
|
||||
qt_libs.remove('OmxCore')
|
||||
if "../../frogpilot/ui/screenrecorder/screenrecorder.cc" in qt_src:
|
||||
qt_src.remove("../../frogpilot/ui/screenrecorder/screenrecorder.cc")
|
||||
if "../../frogpilot/ui/screenrecorder/omx_encoder.cc" in qt_src:
|
||||
qt_src.remove("../../frogpilot/ui/screenrecorder/omx_encoder.cc")
|
||||
print("Removing Screen Recorder")
|
||||
|
||||
# build translation files
|
||||
with open(File("translations/languages.json").abspath) as f:
|
||||
languages = json.loads(f.read())
|
||||
|
||||
+3
-9
@@ -14,19 +14,13 @@ NOTE: This repository uses Git LFS for large files. Ensure you have [Git LFS](ht
|
||||
|
||||
Either do a partial clone for faster download:
|
||||
``` bash
|
||||
git clone --filter=blob:none --recurse-submodules --also-filter-submodules https://github.com/commaai/openpilot.git
|
||||
```
|
||||
|
||||
or do a full clone:
|
||||
``` bash
|
||||
git clone --recurse-submodules https://github.com/commaai/openpilot.git
|
||||
git clone https://github.com/FrogAi/FrogPilot.git --branch MAKE-PRS-HERE
|
||||
```
|
||||
|
||||
**2. Run the setup script**
|
||||
|
||||
``` bash
|
||||
cd openpilot
|
||||
git lfs pull
|
||||
cd FrogPilot
|
||||
tools/ubuntu_setup.sh
|
||||
```
|
||||
|
||||
@@ -38,7 +32,7 @@ poetry shell
|
||||
**3. Build openpilot**
|
||||
|
||||
``` bash
|
||||
scons -u -j$(nproc)
|
||||
scons -u -j$(nproc) --nosr --extras
|
||||
```
|
||||
|
||||
## Dev Container on any Linux or macOS
|
||||
|
||||
Regular → Executable
Regular → Executable
Regular → Executable
Regular → Executable
@@ -1,7 +1,7 @@
|
||||
Import('env', 'qt_env', 'arch', 'common', 'messaging', 'visionipc', 'cereal')
|
||||
Import('env', 'qt_env', 'arch', 'common', 'messaging', 'visionipc', 'cereal', 'widgets')
|
||||
|
||||
base_frameworks = qt_env['FRAMEWORKS']
|
||||
base_libs = [common, messaging, cereal, visionipc,
|
||||
base_libs = [common, messaging, cereal, visionipc, widgets,
|
||||
'm', 'ssl', 'crypto', 'pthread', 'qt_util'] + qt_env["LIBS"]
|
||||
|
||||
if arch == "Darwin":
|
||||
|
||||
Regular → Executable
+4
@@ -9,6 +9,10 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
|
||||
$DIR/install_ubuntu_dependencies.sh
|
||||
$DIR/install_python_dependencies.sh
|
||||
|
||||
sudo mkdir -p /.comma/params/d
|
||||
sudo mkdir -p /persist/params/d
|
||||
sudo mkdir -p /persist/tracking/d
|
||||
|
||||
echo
|
||||
echo "---- OPENPILOT SETUP DONE ----"
|
||||
echo "Open a new shell or configure your active shell env by running:"
|
||||
|
||||
Reference in New Issue
Block a user