Commit Graph

289 Commits (master)

Author SHA1 Message Date
Adeeb Shihadeh 88424ede2c
Revert model (#21571)
* Revert "New desire model (#21458)"

This reverts commit 4230d5d212.

* revert rel notes
2021-07-12 19:26:50 -07:00
Willem Melching 9ea913bcc8
nav: various cleanup (#21521)
* nav: various cleanup

* eta resize instant

* show
2021-07-08 14:33:58 +02:00
HaraldSchafer 4230d5d212
New desire model (#21458)
* New model: b822ee32-917c-4639-99f8-25be3e6aabad/900

* Enable keeps

* use new packet

* Send keep pulses once per second

* Updated model_replay_ref_commit

* New model: 0f160bf9-1bce-43e6-9785-564b2453eeac

* Bump model_replay_ref_commit

Co-authored-by: mitchell <mitchellgoffpc@gmail.com>
2021-07-07 19:44:17 -07:00
HaraldSchafer be5ddd25cd
Refactor long (#21433)
* refactor

* needs casting

* tests pass

* fix that test

* refactor in controls

* lets not go crazy

* change of names

* use constants

* better naming

* renamed

* soft constraints

* compile slack variables

* rm git conflict

* add slack variables

* unused

* new edition

* fcw

* fix tests

* dividing causes problems

* was way too slow

* take a step back

* byeeee

* for another time

* bad idxs

* little more cpu for cruise mpc

* update refs

* these limits seem fine

* rename

* test model timings fails sometimes

* add default

* save some cpu

* Revert "little more cpu for cruise mpc"

This reverts commit f0a8163ec90e8dc1eabb3c4a4268ad330d23374d.

* Revert "test model timings fails sometimes"

This reverts commit d259d845710ed2cbeb28b383e2600476527d4838.

* update refs

* less cpu

* Revert "Revert "test model timings fails sometimes""

This reverts commit e0263050d9929bfc7ee70c9788234541a4a8461c.

* Revert "less cpu"

This reverts commit 679007472bc2013e7fafb7b17de7a43d6f82359a.

* cleanup

* not too much until we clean up mpc

* more cost on jerk

* change ref

* add todo

* new ref

* indentation
2021-07-07 19:42:26 -07:00
Willem Melching 86630effcf bump date in time_valid check 2021-06-30 12:18:53 +02:00
Adeeb Shihadeh 4a1aec27ef
segment regen (#21148)
* start seg regen

* send vipc

* fix up some paths

* set fp

* fix no entries

* engages

* seperate camera procs

* send real frames

* regen test routes

* nice argparser

* fix valgrind test

* move that

* fix that
2021-06-28 21:44:40 -07:00
Adeeb Shihadeh a420c7ad50
remove lte toggle (#21392)
* remove lte toggle

* little more
2021-06-23 17:01:17 -07:00
Dean Lee 766f3281bb
fix FileLock: fd could be closed twice (#21362) 2021-06-22 14:05:48 -07:00
Dean Lee ac71384a28
util.cc: refactor read_file (#21350) 2021-06-22 13:48:41 -07:00
Willem Melching a8fac002ae
Honda Bosch longitudinal prerequisites (#21217)
* untested changes

* set compute_gb

* community feature for good measure

* add code for rolling backwards

* init needs CarParams

* stay in elm mode until carParams is written

* fix tester present bus number

* fix can errors

* fix enableCruise flag

* print when radar disable is done

* move retry logic to controlsd

* move lookup table into carcontroller params

* cleanup brake error values

* make init return

* that should be 1

* floats

* back to no failure handling

* try simplify knockout

* bump panda

* Move flags to panda

* add warnings

* Revert "try simplify knockout"

This reverts commit 4f496245791ea6bd041d4412b96035c6b434b91c.

* add note about LoC.long_control_state

* update ref
2021-06-22 16:28:11 +02:00
Willem Melching c21ea8b506
nav: home/work shortcuts (#21276)
* add home/work widgets

* remove todo

* set contents from response

* turn into buttons

* add navigate button

* fix includes

* close settings on nav press

* close sidebar when closing settings

* use live api endpoint

* larger fonts

* more text fits

* only place name

* remove static response

* properly clear
2021-06-22 13:25:22 +02:00
Adeeb Shihadeh d90d9b2280
util::read_file: fix reading from sysfs and add test case (#21325)
* add sysfs test case

* Revert "util.cc: refactor read_file (#21321)"

This reverts commit 8d5c61eefe.
2021-06-18 01:34:52 -07:00
Dean Lee 8d5c61eefe
util.cc: refactor read_file (#21321)
* mode read & open once

* change return statement for better readibility

* apply reviews

* can't open with ate flag
2021-06-17 23:19:41 -07:00
Adeeb Shihadeh ea6f779b3e fix /proc test case for util::read_file 2021-06-17 15:03:59 -07:00
Adeeb Shihadeh 7dec206437 Revert "util.cc: refactor read_file (#21295)"
This reverts commit 190a845505.
2021-06-17 15:02:48 -07:00
Dean Lee 190a845505
util.cc: refactor read_file (#21295)
* mode read & open once

* change return statement for better readibility

* apply reviews

* Update selfdrive/common/util.cc

* fix

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2021-06-17 14:03:07 -07:00
Dean Lee a873a23e0d
common/util.cc: add unit test, fix bug in util::read_file (#21251)
* add test case for util

* fix bug in read_file

* gitignore test_util

* better test

* referer

* more

* more test

* REQUIRE size

* apply reviews

* only test binary

* simplify the test

* read  non-permission

* debug print

* remove /etc/shadow

* test read directory

* Update selfdrive/common/tests/test_util.cc

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
Co-authored-by: Willem Melching <willem.melching@gmail.com>
2021-06-16 11:01:13 +02:00
Willem Melching e85fa7f1c9
UI: check if dongle id is valid before calling API (#21275) 2021-06-15 14:10:44 +02:00
Willem Melching fcf9f00a2a
Only call ensure_params_path once (#21229)
* Only call ensore_params_path once

* only ensure default params path once
2021-06-14 16:12:27 -07:00
ShaneSmiskol ae77f693a2
Fixup joystick (#21129)
* some common changes

* rename to joystick

* add alert and update controlsd to work with joystick

* update joystickd

* Update Joystick readme

* assume we have inputs

* only send gb or steer when engaged_toggle is true

* Update instructions

* fix --ip

* Easier to understand at a glance

* much better

* -a

* receive events and send msg in same loop

* always import

* Update selfdrive/controls/lib/events.py

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>

* Update selfdrive/controls/lib/events.py

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>

* combine logic and clean up

* use argparse

* outdated, and use normal class

* rm

* bit of a refactor

* refactor part 2 / 3

* much better (3 / 3)

* Simplify

* bump cereal and update readme

* capitalize

* Update tools/joystick/joystickd.py

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>

* Update tools/joystick/joystickd.py

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>

* make joystick abstraction class clearer

* use interp, clearer without comments

* no need to use apply_deadzone

* more explicit

* define btns and axes once

* split function by use_keyboard again, but simpler

* we can use handle_button as a reset function

* need to flip sign

* remove

* invert axes map for kb, easier to read the button mapping

* apply changes from review

* new lateral log for debug mode

* bump

* add saturated

* static alert

* joystick_mode

* conditionally subscribe

* Update selfdrive/controls/controlsd.py

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>

* move params instantiation

* Spoof active and enabled

* Only allow car to engage

* no startup alert if joystick

* Update controlsd.py

* Should be orange not enabled, green enabled

* no more button states

* should work

* blue

* submaster conflates, so only send when we have an update

* final change

* remove msg

* clean up a bit

sort of clean up

clean up a bit

remove msg

* this was right

* Apply suggestions from code review

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>

* lowercase

* suggestions from code review

* forgot laptop

* bump to latest

* fixes

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
Co-authored-by: vanillagorillaa <31773928+vanillagorillaa@users.noreply.github.com>
2021-06-11 14:33:17 -07:00
Dean Lee e4e669bb0f
add space after function name and if statement (#21225) 2021-06-11 10:17:52 +02:00
Willem Melching 3c197953bc
nav: add page to settings (#21208)
* add navigation panel to settings

* am/pm display and dynamic width
2021-06-10 09:59:34 +02:00
Maxime Desroches 03df1b08bb
Convert C++ while loops from int to bool (#21214) 2021-06-09 21:09:21 -07:00
Dean Lee ee46672d3c
Passing arguments by reference (#21205) 2021-06-09 14:09:02 +02:00
Dean Lee c53cb5d570
Use C++ header files instead of C header files. (#21192)
* use cstring instead of string.h

* use cstdio instead of stdio.h

* remove inttypes.h

* use cstdlib instead of stdlib.h

* use cstdint instead of stdint.h

* #include <cstddef>

* cstdlib

* use cmath

* remove stddef.h

* use cassert

* use csignal

* use ctime

* use cerror

* rebase master
2021-06-08 13:46:22 -07:00
Dean Lee b06b3ecb60
Use full include path (#21194) 2021-06-08 12:09:30 -07:00
Adeeb Shihadeh e5ef36786f bump version to 0.8.6 2021-06-07 22:42:58 -07:00
Adeeb Shihadeh 96271f8bc3
log on startup if onroad flag set (#21150) 2021-06-04 22:04:26 -07:00
Willem Melching 14f09e4ee1
Various nav improvements (#21133)
* various nav improvements

* use traffic aware routing

* read last position from param

* allow compute without gps when no route

* cleanup

* properly hide route

* set pitch
2021-06-04 13:45:42 +02:00
Adeeb Shihadeh c76c30fa2d
disable uploading raw by default (#21128) 2021-06-03 15:24:30 -07:00
ShaneSmiskol 36beaf0d68
Add CLEAR_ON_IGNITION_OFF param type (#21121) 2021-06-03 15:21:53 -07:00
Dean Lee 65e0b1e699
Cleanup util.h (#20849)
* cleanup util.h

* fix build error:omx_encoder.cc:408: undefined reference to do_exit

* fix build error

* rebase master

* move helper functions back to util

* ExitHandleHelper->ExitHandlerHelper

* std::clamp

* struct ExitHandlerHelper to class

* rebase master

* cleanup

* restore ExitHandler

* prefer cassert
2021-06-01 16:53:12 +02:00
Willem Melching e66bbec52b
Update UI fixes/improvements (#21089)
* Show latest update time

* utc

* make work more than once

* cleanup

* whitespace

* only while offroad
2021-05-31 15:33:49 +02:00
Adeeb Shihadeh cf6d133638
fix up model tests + tools (#21071)
* unlogger: send yuv stream

* fix up model test tools

* fix unlogger

* rename model replay

* bump cereal

* test in actions

* no ci for now
2021-05-28 23:08:08 -07:00
Willem Melching 6e22f16ddb
loggerd: put signal in end of route sentinel (#21025) 2021-05-25 17:34:40 +02:00
Willem Melching ea5141d909
Store almanac on ublox poweroff (#20967)
* Store almanac on ublox poweroff

* send current UTC time

* move message building to ublox_msg.h
2021-05-20 11:43:03 +02:00
Mitchell Goff 29cc3500a5
New model outputs (#20933)
* New model: 51a237cd-9c43-4281-9072-802325e6744d/950

* Added new meta outputs and proper interp for plan_t_arr

* Added meta-based trigger for FCW

* No nans in planner, separate alert for model FCW

* Cleaned up plan_t interp logic

* Added empty cameraError alert to fix unit tests

* Use the normal FCW event

* Updated filter logic

* Updated model replay ref

* Moved disengage predictions into their own cereal struct

* Updated model replay ref for new cereal structs

* Apparently this breaks stuff?

* Bumped cereal commit and model replay ref
2021-05-19 22:30:23 -07:00
Adeeb Shihadeh 313741062e
offroad alert for missing nvme (#20931)
* offroad alert for missing nvme

* remove that

Co-authored-by: Comma Device <device@comma.ai>
2021-05-17 13:35:24 -07:00
Willem Melching 86aefbe766
Mapbox widget (#20751)
* squash mapbox stuff

* only hacks for pc

* no hack there

* only update when needed

* get destination from param

* no need for user agent

* add athena method

* change nav path color

* layout cleanups

* margin top

* add build scripts

* rename header file

* set pitch

* fix icon blinking

* keep both options

* draw on top to fix last blinking

* only recomput with gps

* fix include

* put map in onroadwidget

* update mapbox plugin to allow specifying directions url

* cycle through views

* dynamic resize

* only when present

* add map_helpers

* whitespace

* small fixes

* let scons decide

* update setup files

* implicit dependency

* fix alerts

* Update selfdrive/ui/SConscript

* move clearLayout to util.h

* only build when map.cc present

* move maps to own folder

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2021-05-17 14:57:07 +02:00
Dean Lee 0495426535
Cleanup includes (#20925)
* remove #include <pthread.h>

* remove #include<stdbool.h> for cc files

* remove #include<iostream>
2021-05-17 10:31:31 +02:00
Adeeb Shihadeh 0b39e0353c bump version to 0.8.5 2021-05-15 17:09:41 -07:00
Dean Lee c08ee575f8
read_files_in_dir: closedir before return (#20903) 2021-05-14 17:33:46 -07:00
Willem Melching 4742f55749
store all files in /sys/fs/pstore in bootlog (#20875)
* store all files in /sys/fs/pstore in bootlog

* whitespace

* fix bootlog test
2021-05-12 11:15:54 +02:00
Adeeb Shihadeh b93ccc465d
offroad alert for unregistered devices (#20870)
* offroad alert for unregistered devices

* update tests

* add param

* fix stretch
2021-05-11 03:18:45 -07:00
Dean Lee 7222d0f20d
Cleanup selfdrive/ includes (#20822)
* cleanup include path

* continue

* format includes

* fix testraw.cc

* remove include path from SConstruct

* regroup

* rebase master

* almost done

* apply review

* rename FileReader.xx to filereader.xx

* rename Unlogger.x->unlogger.x

* rename FrameReader.xx -> framereader.xx

* apply reviews

* ui.h

* continue

* fix framebuffer.cc build error:mv util.h up

* full path to msm_media_info

* fix qcom2 camerad

Co-authored-by: Comma Device <device@comma.ai>
2021-05-08 22:15:17 -07:00
Willem Melching ab319d4f54
Replace ifdef with hw abstraction layer (#20843)
* Replace ifdefs with hardware abstraction layer (#20801)

* add type to class hadwareXXX

* replace ifdefs with hardware layer

* continue

* continue

* new function get_driver_view_transform

* full path to hw.h

* fix build error setup.cc

* apply review

* fix typo

* fix deprecated error:replace deprecated fromPath with new

* fix build error

* Fixes after ifdef clenaup (#20842)

* inheritance doesnt work with static

* fix debayer

* small cleanup

* Update selfdrive/camerad/cameras/camera_common.cc

* Update selfdrive/ui/qt/offroad/settings.cc

* Update selfdrive/common/modeldata.h

* flip conditions

* fix comment

Co-authored-by: Dean Lee <deanlee3@gmail.com>
2021-05-06 14:39:05 +02:00
Willem Melching 3a95d3ccaa Revert "Replace ifdefs with hardware abstraction layer (#20801)"
This reverts commit 757d2923d2.
2021-05-06 12:29:30 +02:00
Willem Melching d34647bbf7 Revert "Fixes after ifdef clenaup (#20842)"
This reverts commit fd7c2b4adf.
2021-05-06 12:29:19 +02:00
Willem Melching fd7c2b4adf
Fixes after ifdef clenaup (#20842) 2021-05-06 11:58:35 +02:00
Dean Lee 757d2923d2
Replace ifdefs with hardware abstraction layer (#20801)
* add type to class hadwareXXX

* replace ifdefs with hardware layer

* continue

* continue

* new function get_driver_view_transform

* full path to hw.h

* fix build error setup.cc

* apply review

* fix typo

* fix deprecated error:replace deprecated fromPath with new

* fix build error
2021-05-06 11:41:46 +02:00
Adeeb Shihadeh b4447993c1
add CLEAR_ON_IGNITION param type (#20810) 2021-05-04 11:32:40 -07:00
Dean Lee 27d3f820bf
Params: move keys from cython to cc (#20814)
* move keys from cython to cc

* consistency

* passes tests

* more consistency

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2021-05-04 10:49:26 -07:00
Dean Lee 737d002d80
params.cc clarify conditional compilation(#20699) 2021-04-19 12:16:30 +02:00
Adeeb Shihadeh d90136c1d0 ate sets failbit on some platforms 2021-04-13 14:40:40 -07:00
Comma Device 6f21993915 fix reading procfs files 2021-04-13 13:56:08 -07:00
Dean Lee fe2f63849a
util.cc: reduce two read_file functions into one (#20655)
* no need to malloc one extra byte

* combine two read_file into a faster one

* cleanup #include

* use resize

* apply suggestions from review

* space

* rebase master
2021-04-13 11:43:43 -07:00
Dean Lee eb4666b38f
util.h: remove unused macro ALIGN (#20673) 2021-04-13 10:42:36 +02:00
Dean Lee cf80675369
Use std::size for element counts (#20654) 2021-04-12 12:22:22 +02:00
Willem Melching 74aa6e29c9
Params: new class FileLock (#20636)
* new class LockFile

* lock->try_lock

* rebase master

* close if fd_ >=0

* rename try_lock to lock

* keep tryring if flock() return EINTR

* throw exception on error

* keep trying if open() gets interrupted by a signal

* close fd_ before throw flock exception

* add macro HANDLE_EINTR

* HANDLE_EINTR for open & write

* add errno in exception

* add destructor

* don't throw exception,log err and return

* Revert "don't throw exception,log err and return"

This reverts commit 6e1ba4a1bd82de3d4d07db5238a82184fd2ec9b4.

* add lock file name in exception

* cleanup  exception text

* use lock_guard in function put

* anonymous namespace

* use do-while(0) instead of goto

* cleanup read_db_all

* cleanup FileLock

* remove fchmod 0666 for apks

* Revert "remove fchmod 0666 for apks"

This reverts commit b389c31762417c4465d73be2453efcf7bc693aee.

* log instead of runtime error

* keep libs

Co-authored-by: deanlee <deanlee3@gmail.com>
2021-04-09 16:35:44 +02:00
Adeeb Shihadeh 015973474e
tici: fix GL linking (#20626)
* fix GL linking on tici

* gles

Co-authored-by: Comma Device <device@comma.ai>
2021-04-08 11:59:33 -07:00
Willem Melching 1fc7bcca43
ecam toggle (#20597)
* use ecam in ui

* needs reboot

* use in modeld

* typo

* effective FL is longer in center

* normalize zoom by focal dist

* read param before init

* make 2x as wide

* review comments

* more explicit

* fix camera offset

Co-authored-by: ZwX1616 <zwx1616@gmail.com>
2021-04-07 19:12:35 +02:00
Willem Melching ae094042ad
add putBool/getBool wrappers to cython params class (#20611)
* add putBool/getBool wrappers to cython class

* use new API

* some more puts

* fix mockparams arguments

* add get_bool to MockParams

* typo
2021-04-07 15:36:37 +02:00
Dean Lee ef501afe97
Params: ensure path and symlink in constructor (#20538)
* ensure path and symlink in constructor

* better comments

* global Params g_params

* const params_path

* Revert "global Params g_params"

This reverts commit 3439894334d69a8c8c19516b9865f9a71ab163da.

* Revert "const params_path"

This reverts commit d3de2fc22ce0f32ffdcdba5595db9c35b21b84a1.

* cleanup

* add todo

* concat string

* add comment

* more robust

* cleanup
2021-03-31 11:04:34 +02:00
Adeeb Shihadeh 0adfc931b9 bump version to 0.8.4 2021-03-30 13:16:45 -07:00
Greg Hogan 0847cf6869
prevent corrupted log messages (#20530) 2021-03-30 11:29:26 -07:00
Dean Lee 98e55996f6
Params: python-like interface (#20506)
* rebase master

* delete outdated test_params.c

* putBool & more robust getBool

* putBool(SshEnabled)
2021-03-30 12:54:59 +02:00
Dean Lee 6db31b9a33
Added new util class FirstOrderFilter (#20303)
* new class FirstOrderFilter

* flick face icon

* revert ui_draw_vision_face

* new function reset()

* reset after update

* use filter to update brightness
2021-03-30 12:09:06 +02:00
Adeeb Shihadeh 49748d5dc1
Qt UI: power saving (#20456)
* c2 power saving

* clean that up

* that works

* add to hw

* set power

* release files

* add that

* include hw base

* pc joins the party

* util

Co-authored-by: Comma Device <device@comma.ai>
2021-03-24 11:09:39 -07:00
Adeeb Shihadeh f1da1f9cb2
Qt UI: scale volume with speed (#20441)
* Qt UI: scale volume with speed

* for all hw

* way too loud for tici

* set volume

* volume

* swap
2021-03-22 19:51:44 -07:00
Dean Lee 4cce4385af
FrameBuffer: move the status,success variables closer to usage (#20308) 2021-03-11 15:02:35 +01:00
Willem Melching a94ba4fb8b
Add watchdog check to manager (#20277)
* this should work but doesnt

* Only offroad

* works

* make it work offorad

* reduce diff

* cleanup

* need util

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2021-03-08 19:17:46 -08:00
Dean Lee 80cc0eefc9
modeldata.h: new function get_model_yuv_transform (#20257) 2021-03-08 10:10:13 +01:00
Dean Lee ae72d34a42
move intrinsic_matrix into modeldata.h, removed duplicate definitions. (#20051)
* move intrinsic_matrix into modeldata.h

* def __cplusplus
2021-03-03 11:47:48 +01:00
Adeeb Shihadeh 2525a628a1 bump version to 0.8.3 2021-02-27 21:14:14 -08:00
Willem Melching d3dfb47d0e
loggerd: clean exit on SIGPWR (#20100)
* loggerd: clean exit on SIGPRW

* no SIGPWR on macos
2021-02-18 17:46:46 +01:00
Dean Lee 9a9641a296
OMXEncoder: remove pthread_mutex_t lock from member variables (#19948)
* remove mutex

* rebase master
2021-01-30 19:11:03 -08:00
Dean Lee e6783f4d9f
remove cqueue, use class SafeQueue (#19774)
* class SafeQueue

* cleanup includes

* space

* add timeout

use try_poll

* add function empty() & size()

* class SafeQueue

* add timeout

use try_poll

* add function empty() & size()

* rebase master

* rebase master

* for loop

* fix bug
2021-01-28 15:12:45 +01:00
Dean Lee 6583206ed4
convert framebuffer to class (#19800)
* class FrameBuffer

* fix build error

* remove bootlog
2021-01-28 14:47:05 +01:00
Willem Melching 4f995b35d5 fix valgrind complaints about swaglog 2021-01-28 14:03:46 +01:00
Dean Lee c283be24d3
C++ swaglog (#19825)
* c++ swaglog

* dd

* continue
2021-01-28 13:52:18 +01:00
Dean Lee 316f475544
util.h: re-indent function string_format and use const std::string & for read_file (#19931) 2021-01-27 12:10:03 +01:00
Dean Lee c688461e11
util.h: use const reference for std::string parameter (#19885) 2021-01-23 13:47:09 -08:00
Adeeb Shihadeh c9679222ae
add device type to clouglog ctx (#19890)
* add device type to clouglog ctx

* remove is_eon

* str
2021-01-22 20:02:48 -08:00
Dean Lee f973c56a36
loggerd: split bootlog to a separate program (#19831)
* bootlog

* blank lines

* move file_exists to util.h

* src = ['loggerd.cc']

* log_init_data

* Revert "src = ['loggerd.cc']"

This reverts commit 18a587023d.

* add bootlog to .gitignore

* use s->has_qlog instead of true

* add blank lines & remove extern C
2021-01-19 12:16:12 -08:00
Dean Lee 3381cd371c
clutil.h: remove extern C (#19809) 2021-01-18 15:04:37 +01:00
Dean Lee 53b9d35fda
swaglog: use std::mutex & remove extern C (#19817) 2021-01-18 13:35:11 +01:00
Dean Lee 210b52e622
gpio.h: remove extern "C" (#19799) 2021-01-17 15:51:05 -08:00
Dean Lee c5c9b6f712
text.c->text.cc (#19734) 2021-01-15 13:42:26 -08:00
HaraldSchafer 158210cde8
Mpc rework2 (#19660)
* start again

* need that too

* this actually works

* not needed

* do properly

* still works

* still works

* still good

* all G without ll

* still works

* all still good

* cleanup building

* cleanup sconscript

* new lane planner

* how on earth is this silent too....

* update

* add rotation radius

* update

* pathplanner first pass

* misc fixes

* fix

* need deep_interp

* local again

* fix

* fix test

* very old

* new replay

* interp properly

* correct length

* another horrible silent bug

* like master

* fix that

* do doubles

* different delay compensation

* make robust to empty msg

* make pass with hack for now

* add some extra

* update ref for increased leg

* test cpu usage on this pr

* tiny bit faster

* purge numpy

* update ref

* not needed

* ready for merge

* try again after recompile

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2021-01-14 18:43:50 -08:00
Dean Lee cef469cbed
convert glutil.c to gltuil.cc & add class GLShader (#19720)
* c++ glutil

* function getUniformLocation

* rebase master
2021-01-12 15:43:34 +01:00
Dean Lee b3107e153c
Refactor image texture stuff into class (#19719)
* Refactor image texture stuff into class

* cleanup

* Update selfdrive/common/visionimg.cc

Co-authored-by: Willem Melching <willem.melching@gmail.com>
2021-01-11 15:52:58 +01:00
Dean Lee 83bdd23a08
Fix build error after merge utilpp.h to util.h (#19714)
* fix std::atomic build error

* remove include util.h
2021-01-10 20:28:11 -08:00
Dean Lee 595830135b
merge utilpp.h into util.h (#19710) 2021-01-10 14:57:32 -08:00
Willem Melching fb496c692a
VisionIPC 2.0 (#19641)
* Squashed vipc

* Update release files

* Remove else

* add visionipc to release files

* use poller in vipc receive

* opencl framework instead of lib on macos

* Fix camera webcam

* Fix opencl on mac in ui

* more webcam fixes

* typo in ui sconsfile

* Use cur_yuv_buf

* visionbuf c++ class

* Camera qcom was still using visionbuf_allocate

* Turn loggerd back on

* fix snapshot

* No build needed

* update test camerad

* no more release callback

* make encoder c++

* Revert "no more release callback"

This reverts commit e5707b07002fee665d0483d90713154efc2d70d4.

* fix exit handlers

* No need to check errno

* move release callback call

* s/VIPCBufExtra/VisionIpcBufExtra/g

* use non blocking connect

* ui use non blocking connect

* Lower condition variable wait time

* Snapshot cleanup

* bump cereal

* bump cereal
2021-01-08 14:54:25 +01:00
Dean Lee 8c62b21df1
remove double semicolons (#19682) 2021-01-06 20:57:46 -08:00
Dean Lee 86fe2d1697
common exit handler (#19661)
* common signal handle

* fix typo

* rename to ExitHandler

* remove include signal.h

* remove include csignal

* rename variable exit to v

* rebase master
2021-01-05 20:19:53 -08:00
Adeeb Shihadeh 87950eb312
setup clang tidy (#19533)
* setup clang tidy

* config

* some cleanup

* little more

* remove that

* fix qcom build
2021-01-05 12:50:23 -08:00
Dean Lee c1cf0882bd
Replace usleep with util::sleep_for (#19643)
* replace usleep with sleep_for

* sleep microseconds

* sleep nanoseconds

* Trigger Build
2021-01-04 18:03:11 +01:00
Dean Lee a4afc03a73
UI: reducing CPU usage from 13% to 4% when offroad (#19575)
* Accurately control the UI frequency

* helper function sleep_for
2021-01-04 13:59:23 +01:00
Adeeb Shihadeh a4cec444eb bump version to 0.8.2 2020-12-18 12:23:59 -08:00
grekiki 5b26c97141
Qt Offroad stats (#19498)
* probably broke a lot, need the commit though

* finally works

* make it work...

* ...

* kind of works

* better styling

* all should work

* tiny cleanup

* temp

* looks nicer

* create JWT in C++

* kilometers -> km

* use correct free methods

* dont put code in assert statement

* Build JWT payload dynamically

* get dongle id once

* include cleanup

* Remove qDebug

* Update drive_stats.cc

Github is a nice editor :)

* swap week and all and fix sconscript

* install openssl

* openssl include dirs on mac

* is this where openssl is?

* It's here

* small cleanup

Co-authored-by: Comma Device <device@comma.ai>
Co-authored-by: Willem Melching <willem.melching@gmail.com>
2020-12-18 13:29:20 +01:00
Adeeb Shihadeh a96857f1aa
fix camerad not exiting cleanly (#2768)
Co-authored-by: Comma Device <device@comma.ai>
2020-12-12 13:55:24 -08:00
Dean Lee 3c08d0f1f7
clutil refactor (#2733)
* cleaup clutil.h

* clutil.c -> clutil.cc

* std::hash

* try simplify functions

* using namespace group help functions

* continue

* add function get_platform_info

* continue

* remove caching

* struct CLContext

* std::cout & CL_ERR_TO_STR

* remove CLU_NO_CACHE

* Revert "struct CLContext"

This reverts commit 882e413f22.

* cl_get_error_string : remove undefied error codes

* replace all printf with std::cout

* util::read_file

* cleanup

* revert CL_ERR_TO_STR

* simplify

* add macro CL_ERR_TO_STR

* cl_get_error_string: fix undeclared errors

* log_size should not +1

* use std::stirng log

* apply review
2020-12-11 13:05:32 +01:00
HaraldSchafer 630c7309a5
Test model refactor (#2720)
* template funcion fill_meta

* add function get_plan_max_idx

* add function get_mdn_max_idx

* remove temp builder variables

* get_mdn_max_idx->get_lead_data

* get_pan_max_idx->get_plan_data

* fill_lane_line

* combine fill_lane_line&fill_path into one function

* fill_lead_vw

* using unique_ptr

* prefer using constexpr

* more constexpr,remove duplicate defined TRAJECTORY_SIZE

* remove suffix _arr from variable name

* misc

* remove extern c

* refactor model_publish

* remove unused paramaters

* traffic_convention to c style array

* c style array:prev_desire&pulse_desire

* fix error&make easy for review

* const mat3 &transform

* move cl_command_queue into ModelState

* use maco LEAD_MHP_SELECTION

* move constexpr from .h to .cc

* remove #define MODEL_NAME

* modeldata.h: contexpr

* remove param temporal from model_init

* helper function get_best_data

* fix probs

* int

Co-authored-by: deanlee <deanlee3@gmail.com>
2020-12-09 22:48:14 -08:00
grekiki 3e466aa528
UI style improvements with improved keyboard (#2710)
* fix spaces and make spacebar dynamically sized

* some spaces and a comment

* more spaces

* const

Co-authored-by: Comma Device <device@comma.ai>
2020-12-08 12:00:51 +01:00
Adeeb Shihadeh c80d9f132c bump version to 0.8.1 2020-11-30 09:30:57 -08:00
Dean Lee 42183d913f
Error checking macros for opencl (#2615)
* macro CL_CHECK&CL_CHECK_ERR

* trigger checks
2020-11-30 12:04:49 +01:00
ZwX1616 f244b7c7e1
tici front/wide encodeIdx msgs (#2564)
* different msgs

* also add timestamps

* keep impatient log, remove the other

* meaningless
2020-11-19 16:12:02 -08:00
robbederks c5c875bad9
Tici Focal (#2459)
* fix i2c

* fix libi2c (again?)

* qt 5.12.8

Co-authored-by: Willem Melching <willem.melching@gmail.com>
2020-11-12 17:09:36 -08:00
Harald Schafer a991e8af9c a new dawn 2020-11-11 20:45:36 -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 f2c8a6122d Revert "convert mat.h to a c++ header file (#2499)"
This reverts commit 519c043a63.
2020-11-09 01:41:36 -08:00
Dean Lee 1bd1c961ef
fsync_dir: remove goto (#2498) 2020-11-09 01:21:48 -08:00
Dean Lee 519c043a63
convert mat.h to a c++ header file (#2499) 2020-11-09 01:19:09 -08:00
Adeeb Shihadeh 6c86afee16
Qt spinner (#2494)
* move android spinner

* qt spinner

* rotation

* nothing by default

* spin spin

* fix rotate

* style

* spinner for all

* -2

* unused
2020-11-06 18:44:04 -08:00
Adeeb Shihadeh 818bd8a591 trim trailing whitespace 2020-11-05 14:11:41 -08:00
Adeeb Shihadeh f46ed718ba bump version to 0.7.11 2020-10-23 20:09:08 -07:00
Adeeb Shihadeh 94991d9319 remove unused params function 2020-10-22 17:05:52 -07:00
Willem Melching c0d92516cc
store params in ~/.comma on PC (#2369) 2020-10-20 13:18:21 +02:00
Dean Lee 0bbd080a04
fix build warning (#2365)
* fix build warning

* Update selfdrive/common/util.c

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2020-10-19 22:44:24 -07:00
Willem Melching d28f488ea5 fix typo in params path on PC 2020-10-19 14:25:45 +02:00
Comma Device e4d2174a4e need that one too 2020-10-17 17:44:10 -07:00
Adeeb Shihadeh 20a6ca83c9
fix params permissions for offroad (#2356)
* fix params permissions

* don't need that one
2020-10-17 17:07:40 -07:00
Willem Melching 339d1967cb
--std=c++17 (#2330)
* switch to c++17

* more 17

* 1z

* use std::clamp

* Fix types in clamp

* bump submodules

* bump laika

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2020-10-17 13:33:12 -07:00
Adeeb Shihadeh 96b637737b
fix build warnings (#2355)
* fix build warnings

* cython fixes

* cleanup transformations build

* little more
2020-10-17 12:40:01 -07:00
ZwX1616 6b020241c9
Clean up and test camerad refactor (#2310)
* refactor

add function get_camerabuf_by_type

remove cl_free

use camera_id

move front stuff into frontview_thread

bigger refactor

more

typo

rename camerabuf *c to *b

cleanup header files

remove wideview_thread

camera_qcom.c to c++

fix SConscript

camera_process_buf

space

sendrgb same with before

do autoexposure in processing_thread

correct sendrgb

add camera_common.cc

move yuv_transform to CameraBuf

* use C to keep consitent

* rebase master

* rebase master

* continue refactor

* refactor all camera related data&function out of main

 done

* cleanup

* -use buf.rgb_width&height

* remoe ,

* rebase master

* remove unused std::vector

* add func common_camera_process_front

* fix max

* fix sendrgb

* less crap being logged

* fix indents

* add back thumbnails

* thumbnail fixed on tici

* junk junk junk

* unify api

* fix ptr ref

* lol!

* cleanup

* more simplified

* typos

* remove terminate

* use standard polling

* ops_thread refactor, too much code!

* fix build

* ok

* assert

* listen

* incl more

* wq!

* fix more build

* macos

* fix exp targets

* front is different

* const

* bye

* remath

* remove irrelevant

* do ops in a thread

* fix init

* return null

* QCOM2 ops

* qcom2 build

* missing comma

Co-authored-by: deanlee <deanlee3@gmail.com>
Co-authored-by: Comma Device <device@comma.ai>
2020-10-16 21:58:05 -07:00
Willem Melching 3dd9448981
Params path only in one place (#2344)
* fix params paths

* Qcom & qcom2

* This env variable is not used anywhere

* params path in only one place

* fix other PARAMS_PATH references

* absolute path is probably better
2020-10-15 13:15:22 +02:00
Adeeb Shihadeh 707a670f42
fix params on PC and when reading path from env (#2340)
* fix params when reading path from env

* fix pc
2020-10-14 13:45:24 -07:00
Adeeb Shihadeh 6f307ea4c5 fix params permissions after refactor 2020-10-13 19:14:51 -07:00
Willem Melching 2e182e5c57
Params refactor, simplified (#2300)
* always c++

* Create C++ params class

* get works

* tests hang now

* passes tests

* cleanup string formatting

* handle interrupt in blocking read

* fix memory leak

* remove unused constructor

* Use delete_db_value directly

* Rename put -> write_db_value

* filename cleanup

* no semicolons in cython

* Update common/SConscript

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>

* add std::string version of delete_db_value

* This is handled

* cleanup encoding

* Add clear method to clear all

* add persistent params

* fix android build

* Should be called clear_all

* only import params when needed

* set params path on manager import

* recusrively create directories

* Fix function order

* cleanup mkdirp

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
Co-authored-by: Comma Device <device@comma.ai>
2020-10-13 16:23:23 +02:00
Adeeb Shihadeh 47a42ff432 bump version to 0.7.10 2020-10-03 14:51:47 -07:00
Dean Lee 9983389ffe
close lock_fd if flock failed (#2231) 2020-09-28 11:47:38 +02:00
Dean Lee 9f34d1ff66
camerad: close file descriptors (#2065)
* close file descriptors

* fix struct indent

* add some new lines
2020-09-24 13:39:27 -07:00
Dean Lee 4fba3408c4
Params: use a multiple-reader / single-writer flock to improve concurrency (#2207)
* improve concurrency: multiple readers, single writer locks

* remove lock in read_db_value
2020-09-24 11:51:36 +02:00
Dean Lee 6476207009
add function write_file() (#2181)
* add function write_file()

* handle EAGIN & EWOULDBLOCK

* don't  handle errno
2020-09-21 16:10:38 +02:00
Dean Lee 58e5223aba
touch.c:deleting useless function (#2208) 2020-09-21 11:43:54 +02:00
Adeeb Shihadeh 0ebc037be7
turn display on in spinner (#2148)
Co-authored-by: Comma Device <device@comma.ai>
2020-09-09 20:24:13 -07:00
Dean Lee f71467b450
release copy_q in visionbuf_free (#2121) 2020-09-02 21:11:25 -07:00
Willem Melching 5c058140ed
tici: fix set_realtime_priority (#2124)
* cleanup and pin modeld to core 5

* Unused import
2020-09-02 17:52:41 +02:00
Adeeb Shihadeh 349040d958
driver monitoring cleanup (#2101)
* read rhd from param

* don't need that anymore

* fix build

* bump cereal

* read param from camerad too

* add read_db_bool helper

* bump model replay ref commit, IsRHD wasn't set
2020-08-29 17:16:00 -07:00
robbederks 37d6472bfa
Tici camerad (#2048)
* fix camera config

* typos

* oops

* more typo

* lambless

* forget to send

* visualize hist

* more typo

* 0xC000

* simple

* data loss prevention, clean up later

* loggerd

* back up code

* backup

* fixed memory leak

* fix vsync

* upload ecam

* WB

* 3stream

* fix OMX crash on loggerd rotation

* rewritten debayer kernel

* update viewer

* improved AE

* no artifact lines/grids

* standard trigger

* cleanups

* CCM

* cleanups

* slight tweak

* upd push sock

* build all these

* update tele fl

* update cereal

* upd viewer

* DualCameraState -> MultiCameraState

* cameras_open

* disable frame zmq push by default

* more cleanup

* no apks

* fix submodule error

* wat

* clean up trash

* remove junk

* only build on qcom2

* no need to check these

* update cereal

* some more minor cleanup

* bump panda

* add todo

* minor typo

* Revert "minor typo"

This reverts commit 9233a1df7c.

* not care

* use consistent hdr

* some cleanup

* Update selfdrive/camerad/main.cc

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>

* more cleanups

* remove irrelevant stuff

* this too

* cleanup

* rerun ci

Co-authored-by: ZwX1616 <zwx1616@gmail.com>
Co-authored-by: Tici <robbe@comma.ai>
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2020-08-26 19:59:56 -07:00
ZwX1616 3014280d1a
Fix OMX error on loggerd rotation when using multiple cameras (#1953)
* cherry pick from f8745d3002

* update cereal

* missed this line

* add enum

* Update selfdrive/loggerd/loggerd.cc

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>

* Update selfdrive/loggerd/loggerd.cc

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>

* use same logroot

Co-authored-by: Tici <robbe@comma.ai>
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2020-08-26 15:02:51 -07:00
robbederks 622e42d504
Tici sensord (#2072)
* tici sensord: WIP

* add sensor constants

* rename files

* base class

* init sensors

* publish something

* dont leak memory

* try reading from accel

* Accel works

* add time and sensor source

* Update release files

* If we want low BW we want 125hz

* this should run gyro as well

* add filter on gyro

* also filter accel data

* Add i2c files

* cast makes macos unhappy

* Same outputs as android sensord

Co-authored-by: Tici <robbe@comma.ai>
Co-authored-by: Willem Melching <willem.melching@gmail.com>
2020-08-26 11:30:30 +02:00
Dean Lee 71eedbce44
Remove unnecessary string copy (#2067) 2020-08-24 09:25:16 -07:00
Dean Lee 17dd07e751
visionstream: fix doube fd close (#2057)
* s->ipc_fd counld be closed twice

* white space
2020-08-24 14:07:27 +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 963c00db09
fd should be initialized as -1 (#2041) 2020-08-18 15:22:26 +02:00
Adeeb Shihadeh 86dc54b836 bump version to 0.7.9 2020-08-17 12:49:08 -07:00
Dean Lee d158837617
add function cl_get_device_id (#1948)
* add func cl_get_device_id

cleanup

* add fix from review
2020-08-17 11:24:39 +02:00
Willem Melching 502cc665e0
Pigeon abstraction layer (#1977)
* pigeon abstraction layer

* Fix string literals

* more generic pigeon class

* add TTYpigon

* nicer tty error handling

* close tty fd on pigeon delete

* pigeon receive return std::string

* use sizeof

* max receive size to prevent infinite loop

* remove namespace

* add unistd include for usleep

* fix is pigeon

* Handle tty error in opening

* fix printing binary strings with dump.py

* fix pigeon build on macos

* Handle errors seperately

Co-authored-by: Comma Device <device@comma.ai>
2020-08-13 10:10:50 +02:00