Commit graph

60 commits

Author SHA1 Message Date
Adeeb Shihadeh b9c14c92a7 no gl inside nvg frame 2020-11-27 14:25:52 -08:00
Harald Schafer d409dabedd sometimes never goes into the loop 2020-11-17 10:19:12 -08:00
Dean Lee 91f79acac3
remove std::clamp (#2530) 2020-11-12 11:30:04 -08:00
HaraldSchafer 08846b5c0e
Torch model (#2452)
* refactor draw model

* rebase master

* correct valid_len

* rename function

* rename variables

* white space

* rebase to master

* e16c13ac-927d-455e-ae0a-81b482a2c787

* start rewriting

* save proress

* compiles!

* oops

* many fixes

* seems to work

* fix desires

* finally cleaned

* wrong std for ll

* dont pulse none

* compiles!

* ready to test

* WIP does not compile

* compiles

* various fixes

* does something!

* full 3d

* not needed

* draw up to 100m

* fix segfault

* wrong sign

* fix flicker

* add road edges

* finish v2 packet

* Added pytorch supercombo

* fix rebase

* no more keras

* Hacky solution to the NCHW/NHWC incompatibility between SNPE and our frame data

* dont break dmonitoringd, final model 229e3ce1-7259-412b-85e6-cc646d70f1d8/430

* fix hack

* Revert "fix hack"

This reverts commit 5550fc01a7881d065a5eddbbb42dac55ef7ec36c.

* Removed axis permutation hack

* Folded padding layers into conv layers

* Removed the last pad layer from the dlc

* Revert "Removed the last pad layer from the dlc"

This reverts commit b85f24b9e1d04abf64e85901a7ff49e00d82020a.

* Revert "Folded padding layers into conv layers"

This reverts commit b8d1773e4e76dea481acebbfad6a6235fbb58463.

* vision model: 5034ac8b-5703-4a49-948b-11c064d10880/780  temporal model: 229e3ce1-7259-412b-85e6-cc646d70f1d8/430  with permute + pool opt

* fix ui drawing with clips

* ./compile_torch.py 5034ac8b-5703-4a49-948b-11c064d10880/780 dfcd2375-81d8-49df-95bf-1d2d6ad86010/450 with variable history length

* std::clamp

* not sure how this compiled before

* 2895ace6-a296-47ac-86e6-17ea800a74e5/550

* db090195-8810-42de-ab38-bb835d775d87/601

* 5m is very little

* onnx runner

* add onnxruntime to pipfile

* run in real time without using the whole CPU

* bump cereal;

* add stds

* set road edge opacity based on stddev

* don't access the model packet in paint

* convert mat.h to a c++ header file (#2499)

* update tests

* safety first

Co-authored-by: deanlee <deanlee3@gmail.com>
Co-authored-by: mitchell <mitchell@comma.ai>
Co-authored-by: Comma Device <device@comma.ai>
Co-authored-by: George Hotz <george@comma.ai>
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2020-11-11 20:31:46 -08:00
Willem Melching 8896b7a791 paint.cc: fix drawing lane lines on sidebar 2020-11-11 02:12:55 -08:00
Willem Melching 9d0b893944
UI: get video aspect ratio from camera intrinsics (#2351)
* UI: get video aspect ratio from camera intrinsics

* cleanup video rect definition

* const zoom

* Match zoom level

* Fix comment

* Zoom out more
2020-10-20 12:14:19 +02:00
Adeeb Shihadeh 671183184b
UI cleanup + startup time improvement (#2295) 2020-10-08 19:29:56 -07:00
Willem Melching 53e71f44ce
tici: fix ui rotation (#2222)
* fix rotation using wayland

* put back intrinsic matrix fix
2020-09-23 23:16:55 +02:00
ZwX1616 b3fad609d9 revert tici ui rotate 2020-09-18 14:12:03 -07:00
Willem Melching 9bbb166303
tici: fix ui rotation (#2184)
* rotate ui 90 degree

* put rotation behind ifdef

* Also ifdef that

* ui intrinsic_matrix

* that doesnt do anything

* Keep parent on non qcom
2020-09-16 17:46:08 +02:00
Dean Lee 8417be6f40
UI: simplify layout calculation (#2131)
* add Rect struct

* simplify layout calculation by using viz_rect

* fix

* add whitespace

* use the correct value for vwp_w

* correct vwp_w again

* rebase

* dd
2020-09-12 18:35:36 -07:00
Willem Melching e8c8e9dab2 ui: glTexImage2D only redundant on QCOM 2020-09-08 14:33:27 +00:00
Adeeb Shihadeh 848301b091
UI vision refactor (#2115)
* refactor vision

* don't show slow frame message when in preview mode

* change draws to uint32_t

* set vision_seen=false after destroy

* remove vision_connect_thread

* refactor ui_update

* seelp 30ms when vision is not connected

* remove should_swap

* call ui_update_sizes before ui_draw

* rebase

* start bigger UI refactor

* don't need the touch fd

* fix qt build

* more cleanup

* more responsive

* more refactor

* fix for pc

* poll for frames

* lower CPU usage

* cleanup

* no more zmq

* undo that

* cleanup speed limit

* fix sidebar severity for athena status

* not aarch64

Co-authored-by: deanlee <deanlee3@gmail.com>
Co-authored-by: Comma Device <device@comma.ai>
Co-authored-by: Willem Melching <willem.melching@gmail.com>
2020-09-03 16:32:55 -07:00
Willem Melching 42b6292fa5
ui: simplify shader versions and fix hardcoded texture size (#2112)
* fix shader version

* fix texture buffer size

* Attribute/Varying is deprecated
2020-08-31 15:02:01 +02:00
Adeeb Shihadeh 43e3ec1bc1
UI cleanup (#2091)
* remove unused UI code

* these params aren't used anymore

* this is cleaner

* remove one more timeout

* read that from carParams

* only android needs pm

* fix that

* fix that

Co-authored-by: Comma Device <device@comma.ai>
2020-08-27 11:57:31 -07:00
Dean Lee 08d6fe1880
paint.cc: deleted two meaningless lines (#2043) 2020-08-24 14:15:34 +02:00
Willem Melching e115c51452
Qt ui for PC (#2023)
* qt ui boilerplate

* this kinda works

* cleanup

* render inside other widget

* cleanup

* more cleanup

* Not needed

* Handle click

* Draw at 20Hz

* create paint.hpp

* move stuff around

* update sidebar

* Draw vision

* this works again

* add clickable settings button

* Only collapse sidebar when started

* always use qt on linux

* fix width

* scrollable area

* talk to NetworkManager

* code to add a connection

* params toggles

* small cleanup

* add qt5 to dockerfile

* Qt on mac

* Add qt to release files

* fix macos build

* nore more ifdefs needed

* add icons

* make a bit nicer

* Hide scrollbar

Co-authored-by: Comma Device <device@comma.ai>
2020-08-20 17:16:44 +02:00
Dean Lee f8ab6bd009
ui: refactor model related functions (#2026)
* remove read_model

* remove structs for c-capnp

* remove duplicate #define from modeld

* add function fill_path_points

* fix Indentation

* use MODEL_PATH_DISTANCE instead of 192

* fix type

use validLen

* rename left_path_points&right_path_points to xxx_lane_points
2020-08-18 15:26:43 +02:00
Dean Lee fe43d51686
paint.cc: remove redundant calls (#2025)
* remove redundant calls

* set MODEL_LANE_PATH_CNT=2
2020-08-17 12:06:09 +02:00
Dean Lee 934506e154
fix two little bugs (#2033) 2020-08-17 11:59:27 +02:00
Chris 1b52930a52
Kilometers per hour now displayed as km/h (#2032)
Fixes #2031

Signed-off-by: Christopher Rabotin <christopher.rabotin@gmail.com>
2020-08-17 11:16:52 +02:00
Adeeb Shihadeh a7ee2a53a8
Driver view refactor (#1869)
* quick driver view cleanup

* send at correct freq

* let manager handle that

* don't block starting on driver view

* fix UI hacks

* ui cleanup

* move driver view functionality into dmonitoringd

* dmonitoring thresholds shouldnt be in UI

* remove driver view file from release files

* timeout on frontview

* bump cereal
2020-08-01 17:26:35 -07:00
Dean Lee 2953ae2810
UI cleanup (#1941)
* remove unused variables

* remove unused variables
2020-07-28 11:13:37 -07:00
Adeeb Shihadeh 61548f5a48
Only draw lead car indicators when controlling longitudinal (#1914) 2020-07-23 13:28:58 -07:00
Adeeb Shihadeh eb1aa3d831
Wunused (#1841)
* enable Wunused, first pass

* unused stuff in snpe model

* these are used on phone

* handle sigint and sigterm in modeld

* fix phone build

* camera qcom

* QCOM build works

* delete unused camerad vars

Co-authored-by: Comma Device <device@comma.ai>
2020-07-09 09:25:32 -07:00
Dean Lee ff4f432f0f
paint.cc: Simplify drawing line (#1643)
* simplify drawing line

* remove space
2020-07-03 19:42:26 -07:00
Adeeb Shihadeh e8259895f7 remove unused UI variables 2020-06-29 14:12:28 -07:00
George Hotz b62da571b4
UI 10x speedup with hardware antialias (#1787)
* enable MSAA, disable nvg antialias

* less opaque and clean up

Co-authored-by: Comma Device <device@comma.ai>
2020-06-29 13:54:23 -07:00
George Hotz 344a9a3699
Fixups for Mac, and a bunch for PC (#1654)
* fix mac nui

* fix cereal

* builds on mac without warnings

* ui swap shouldn't be instant on pc

* camerad builds on mac

* modeld, and now everything, builds on mac

* ui draws pictures on mac now

* fix camerad shutdown

* support ui looping on pc

* python3 on that

* SCNu64 should be cross platform

* bump cereal and new apk

* clean up

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2020-06-11 18:21:59 -07:00
ZwX1616 681ef81ed8
fix dtype (#1676) 2020-06-10 15:15:51 -07:00
George Hotz 7770041f92
Getting PC openpilot working again (#1650)
* fixup keras_runner to work and be nicer

* truncate the lane lines based on the valid len
2020-06-05 17:40:56 -07:00
Dean Lee d720f28ecb
ui.cc: remove variables from UIScene, use event::Reader to get data (#1585)
* use struct to store lead status

* remove white space

* use RadarState::LeadData::Reader

* use reader to get thermal data

* use reader

* continue

* remove variables

reset submodules,fix some errors

reset submodules

revert

* remove s->scene.gps_planner_active

* modify

* cleanup

* done

* resolve conflict

* remove irrelevant comment

* remove white space
2020-06-05 15:33:45 -07:00
Dean Lee af36aa28ab
driving.cc: Pass ModelDataRaw by reference (#1600)
* pass ModelDataRaw by reference

* pass NVGpaint by refer
2020-05-30 10:08:44 -07:00
Dean Lee 108a13ead8
UI: better read_model (#1586)
* update model struct inplace

* refer params

* pass path by refer
2020-05-28 15:10:49 -07:00
Willem Melching 50f3f1d335
-Werror (#1567)
* werror

* -Wno-inconsistent-missing-override

* Silence ffmpeg deprecation warnings

* add some more pragmas to ignore warnings

Co-authored-by: Comma Device <device@comma.ai>
2020-05-26 13:27:01 -07:00
Willem Melching 2ae2c40b29
Fix steering wheel icon showing (#1497)
* this should fix steering wheel icon showing

* fix syntax
2020-05-12 18:17:04 -07:00
Dean Lee ee725534bb
UI: move c-capnp to c++ (#1455)
* ui:move c-capnp to c++

* move Subsockets into vector

* rename reader to msg

include cereal/gen/cpp/log.capnp

* fix some errors

restore some changes

restore previous

* cleanup codes

cleanup codes

* remove unused variable alert_size

* handle capnproto's enum in a robust way

add break to default

* switch -> std:map

* use static std::map instead of switch

do cleanup

* fix wrong variable name

* use FlatArrayMessageReader instead of custom MessageReader

remove messagehelp.h

Revert "use FlatArrayMessageReader instead of custom MessageReader"

This reverts commit 57d8b6b1e2b4bad908246f35eb068535b1627167.

use FlatArrayMessageReader instead of custom MessageReader

add header file

remove capnp_c lib,add kj lib

include serialize.h

fix

remove duplicate includes
2020-05-06 08:38:26 -07:00
Dean Lee 846a58507f
simplify drawing text and rect (#1446)
* add ui_draw_text

remove draw textbox

make draw_text static

add blank line

* add ui_draw_text

remove draw textbox

make draw_text static

add blank line

add ui_draw_rect

draw rounded rect

fx typo

* remove used variables

* reduce lines

fix typo

* resolve confilit
2020-05-02 11:27:03 -07:00
Dean Lee 4857f45d6a
simplify drawing circle images (#1445)
* simplify drawing circle images

add static

set default color to 0 0 0 0

remove lines

* fix img_weel_y

* use color macro
2020-05-01 19:16:17 -07:00
Dean Lee 3fe3afeede
better ui_draw() (#1432)
* better ui_draw()

* fix missed border

reduce code

remove white line
2020-04-30 12:11:35 -07:00
Dean Lee b2be607974
replace duplicate codes with variable (#1431)
* eplace duplicate codes with variable

* remove space
2020-04-28 13:44:57 -07:00
Dean Lee 3e2e241a38
Remove redundant code (#1361)
* changing the coordinate system only once

* remove white space

* remove white space

* s->scene. to  scene->

* whitespace
2020-04-17 15:59:43 -07:00
ZwX1616 133b1a20b4
RHD support for driver monitoring (#1299) 2020-04-15 16:48:44 -07:00
Dean Lee ea055d169f
assert after nvgCreateImage in ui_nvg_init() (#1360)
* assert after nvgCreateImage

* update apks
2020-04-14 12:27:55 -07:00
Dean Lee 1ecef2c6be
add ui_draw_image to reduce code repetition 2020-04-13 15:38:45 -07:00
Willem Melching 54d8f9c27b
ui.cc: use thermald to decide when to go onroad (#1351)
* use thermald to decide when to go onroad

* Check for stopped

* set alert timeout to 0 when going offroad

* set controls seen to false

* Don't mark as seen when already stopped

* Don't process controlsState when stopped

* Needs free

* Small cleanup

* Remove that again

* Process controlsState when started

* Need that back
2020-04-10 16:12:39 -07:00
George Hotz ef8aaa77b7
Remove bg_thread from ui (#1347)
* remove bg_thread

* debug print app

Co-authored-by: Comma Device <device@comma.ai>
2020-04-09 20:55:54 -07:00
Andy 35b34fb700
offroad/ui: Transparent layout mode and msgq-based layout control (#1337)
* offroadLayout

* replace broadcasts with offroadLayout socket

* apk

* set 'none' layoutstate for transparent offroad

* refactor, hide offroad when vision connected

* apk supporting transparency

* reset layout state when stopping

* apk

* cleanup includes

* permit offroad to mangae sidebar state only when vision disconnected

* apk

* use c-capnp

* always upd

* send that too

* sync layout state with offroad

* apk

* fix regression in onboarding (mock engage green border)

* apk

* bump apks

* simplify event processing

* bump cereal to master

* in case ui exited in a bad state

Co-authored-by: Comma Device <device@comma.ai>
2020-04-09 19:28:11 -07:00
Dean Lee ee52046957
remove unnecessary nvgLineTo (#1333) 2020-04-08 15:10:42 -07:00
Andy 41bb3ac7ca
Sidebar Connectivity Status (#1268)
* store athena connected-at time

* refactor

* deref

* dt import

* Athena status based on last ping time param

* upd test for pingtime

* lower error timeout
2020-04-05 11:06:49 -07:00