Commit Graph

244 Commits

Author SHA1 Message Date
Adeeb Shihadeh 39811d083f boardd: reduce unnecessary allocations (#22494)
old-commit-hash: 2f1ab6392057b33d7375a243aa37f46f829e9c55
2021-10-08 16:16:23 -07:00
Robbe Derks 58c99158a1 Make pandaState and safetyMode a list (#22454)
* wip: move to pandaStates

* bump cereal

* wip: SafetyMode struct

* move to safetyMode

* fix typo

* this can be None

* fix potential empty pandaStates list

* fix thermald

* fix controlsd

* rename safetyModes to safetyConfigs

* update process_replay

* fix test_models

* bump cereal
old-commit-hash: 91987f38d425e2a5dc61d09571933cffb9536113
2021-10-08 17:54:34 +02:00
Willem Melching 6762c152de boardd: fix context leak in init_usb_ctx (#22472)
old-commit-hash: 43d94787401d91f58f8a84ae8e70c739f10172a4
2021-10-07 13:24:38 +02:00
Willem Melching ed7088c0f6 boardd: lower log level for ublox msg timing issues
old-commit-hash: b9797259edeca45cc5794a4bc009f56734b5c618
2021-10-07 11:07:43 +02:00
Willem Melching 5aa9a8e217 safety_setter_thread: exit on ignition low (#22426)
old-commit-hash: 3e854b83517e8239a56b99802ea32d70913563f2
2021-10-04 15:00:25 +02:00
Dean Lee ca45a040fc boardd: wait for safety_setter_thread to finish while quitting panda_state_thread (#21961)
* rebase master

* merge master

* merge master

* remove space
old-commit-hash: 47f601e50a8357ff1a30b4224f7fef0e65253df0
2021-10-04 14:38:35 +02:00
Willem Melching 11066c6236 Split pandaState into peripheralState and pandaState (#22385)
* publish peripheralState from boardd

* refactor consumers

* rename thread

* peripheralState has panda type too

* add to process replay

* fix device build

* properly remove hardware unsupported alert

* latest peripheralState

* remove pandaState from thermal_monitor

* put that back

* add back harness check

* fix cloudlog

* needs pandaState

* Update selfdrive/thermald/tests/test_power_monitoring.py

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

* dont conflate

* Update selfdrive/thermald/tests/test_power_monitoring.py

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

* pigeon is peripheral

* cleanup

* less global

* comment

* move rtc to peripheral_control_thread

* better diff?

* whitespace

* get msg

* bump cereal

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: f4e2537b124d3d1c0d697a12d8b243b54b76501b
2021-10-04 11:30:11 +02:00
Willem Melching 4680b6f940 Don't send empty pandaState from panda_state_thread (#22393)
old-commit-hash: abaa7b2d55c8ff6e986a9c9b502c5071875df99e
2021-10-01 09:05:33 +02:00
Willem Melching 8aa225b3f9 move acados deps out of devpackages (#22376)
* move acados deps out of devpackages

* fix new pylint errors
old-commit-hash: a60f3c6a35736d39a4ad73e69b5c91c47279d934
2021-09-29 23:20:33 +02:00
Dean Lee 00e02325ab boardd: new function get_time_str (#22158)
* new function get_time_str

* apply review
old-commit-hash: e90eb79ceb8fce4542d7cbba1f02e5a6f4a9d9f9
2021-09-13 10:32:12 -07:00
Jason Young 1df072cd3a VW MQB: Fixes for network location detection (#22174)
* VW MQB: Fixes for network location detection

* apply review suggestion

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

* FP back to 100ms; VIN state poll at 50Hz

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: 5a4d03da29b3afe428c8add57b8bfb36b185dd12
2021-09-09 17:49:31 -07:00
Dean Lee 5afeb1e0a3 panda: call libusb_free_device_list before libusb_exit (#22162)
old-commit-hash: a077b8a566c27d3625047c0f165b75906df45cff
2021-09-07 15:52:34 -07:00
Dean Lee 9a1fa559ba Panda::list: remove call to libusb_release_interface (#22157)
old-commit-hash: c61e7c7898256896b44a48a5094125aa542eee4b
2021-09-07 15:51:06 -07:00
Dean Lee 31adaa3906 panda: fix dev_list may be freed twice on failure (#22161)
old-commit-hash: 83cd67ddb5a7f8fc649d38aa24130e38f230fe69
2021-09-07 15:12:38 -07:00
Dean Lee 4c17c06799 Handle EINTR for all syscalls that can return it (#21948)
old-commit-hash: f02c8d0e2c04e45ceeea9f2fe9851319d724a637
2021-08-31 16:22:56 -07:00
Dean Lee f2d7b27cbd boardd: remove global panda (#21962)
old-commit-hash: 8008cf554771284fecf8794839601bc7afa7a7a2
2021-08-31 07:25:53 -07:00
Adeeb Shihadeh 7611b94e51 fix boardd reconnect loop (#22081)
* fix boardd reconnect loop

* add that back
old-commit-hash: 0e3462e0510d6b8708a478b9a78855d5965777f1
2021-08-30 21:25:48 -07:00
Igor Biletskyy 2e1ea456f0 add function to list connected pandas to panda.cc (#21989)
* add list() to panda.cc

* std:size instead of sizeof

* refactor usb init

* change serial length to 26 to get null terminated

* safer char to string

* forgot variable

* initialize descriptor array

* ...

* move init usb out of class

Co-authored-by: Willem Melching <willem.melching@gmail.com>
old-commit-hash: 603ad435bef2a1db28b294b36768fda5f53fc814
2021-08-30 19:20:50 -07:00
Dean Lee ea344bb52f panda_state_thread: replace stoi with atoi (#21981)
old-commit-hash: 3b0b20ba4bab2a32d28145000a4f260ad38ea402
2021-08-27 14:25:24 -07:00
Igor Biletskyy b82c83ccae Add argument to Panda to connect by serial number (#21905)
* Add list() to panda.cc

* add default

* change var names

* comments

* advices

* revert

* ...

* ..

* connect by serial

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: fc56ae70ee147c8665a818b95cbd3d2b7a5fd80b
2021-08-19 19:06:24 -07:00
Willem Melching 9038e1b86f C3 AE improvements (#21698)
* AE improvements

* boardd: also use gain to compute IR brightness

* use default rect for DM autoexposure

* more smooth

* whitespace

* camerad cpu usage

* hcg on is slightly better for noise

* hysteris around high conversion gain

* improve i2c timing

* use AB contexts

* HCG default off

* run at 10 hz

* stay in context A for now

* remove ae thread

* wait till next frame is started before sending i2c

* back at 20fps

* add comment and filter across 3 evs

* remove context switch code

* tuning

* recomened without HCG is 0.8x
old-commit-hash: 25de93d133c386c353155c2b782e3807c46150cd
2021-08-05 16:34:36 +02:00
Willem Melching 0bdc6918c7 boardd: remove ir multiplier after AE revert
old-commit-hash: d7ab611bb0a616374e28eb4f0cdf46bb0172bb4b
2021-07-23 10:26:00 +02:00
Willem Melching 1187fe4e05 Increase IR filter time constant to 30 seconds (#21666)
old-commit-hash: 49c618946cc4aad4fc69b495de485e41929736ba
2021-07-20 18:15:35 +02:00
Willem Melching dee6218c5e fix dcam AE feedback loop with IR LEDs (#21651)
old-commit-hash: 1c40b8092ccc5370b69104fa027f244b829b19a5
2021-07-19 12:41:32 +02:00
Igor 7595ad4d28 bump cereal
* bump cereal

* TIM9 to TICK in boardd.cc
old-commit-hash: 8e3d7a43c36843bc1b85a0ec8270052c12755109
2021-07-13 21:42:49 -07:00
Willem Melching ba505de08c Stay in ELM327 mode during controls init (#21386)
old-commit-hash: e7476943b60b7ffc8bbdd9b9b8f3cd14ab0cb089
2021-06-24 13:12:03 +02:00
Willem Melching e57dab8f40 revert changes to boardd safety mode setting
old-commit-hash: 2e3aa81ce53a29f6cd4b7534a355c35689393f05
2021-06-22 18:44:55 +02:00
Willem Melching 5bc0d28708 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
old-commit-hash: a8fac002ae8e7c6ab37e9b1a5deb8cfcea2a71ac
2021-06-22 16:28:11 +02:00
Dean Lee 147b355dde add space after function name and if statement (#21225)
old-commit-hash: e4e669bb0fc1a919dfb38800099f8e3ad52346f1
2021-06-11 10:17:52 +02:00
Dean Lee 51cf285c31 Passing arguments by reference (#21205)
old-commit-hash: ee46672d3c8c86b41fd8ae2fce9120e050b8e628
2021-06-09 14:09:02 +02:00
Dean Lee f70a79b838 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
old-commit-hash: c53cb5d570adb82bc454fcabab458d7e7f09738c
2021-06-08 13:46:22 -07:00
Adeeb Shihadeh f8cd0061c8 log on startup when panda heartbeat is lost (#21151)
* log when heartbeat lost

* bump panda

* bump panda

* add to pandaState

* move that
old-commit-hash: f04d6a9b3ff9e8558c2711be14797971c3a83d87
2021-06-04 23:22:08 -07:00
ShaneSmiskol ddff72ccea Add CLEAR_ON_IGNITION_OFF param type (#21121)
old-commit-hash: 36beaf0d6895c9d69d05c3a25eab21a4d9dbb692
2021-06-03 15:21:53 -07:00
robbederks 5441d1f348 Add harness connection as requirement for powerdown (#21087)
* add harness connection as requirement for powerdown

* fix unittests
old-commit-hash: 4a24d389c47a6dff4f9524490355a852f701aaaf
2021-05-31 13:32:26 +02:00
Willem Melching 4d874a90ea Store almanac on ublox poweroff (#20967)
* Store almanac on ublox poweroff

* send current UTC time

* move message building to ublox_msg.h
old-commit-hash: ea5141d9096d64890a23a806612eb4edf58ea548
2021-05-20 11:43:03 +02:00
Dean Lee 5609f32cee Cleanup includes (#20925)
* remove #include <pthread.h>

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

* remove #include<iostream>
old-commit-hash: 0495426535490e7d8d503af35ace7a20dc70a7bb
2021-05-17 10:31:31 +02:00
Adeeb Shihadeh 3fbeb1299e boardd: set can and pandaState valid flags (#20899)
* boardd: set can and pandaState valid flags

* add event

* bump cereal

* consistency
old-commit-hash: e694f0b4d6f8cfe55e2c8d36a78cf86fe0c86f1a
2021-05-14 21:26:02 -07:00
HaraldSchafer 8559ab5ebd Add ublox interference monitor (#20911)
* add interference monitor

* new thresholds

* correct labels

* always run for test

* new msg

* add flag

* Revert "always run for test"

This reverts commit b04b92ac2d73d996d1526509e26c4e1a4338cbbb.

* add hw status flags
old-commit-hash: e5f93ef142af706eed05f1d015e1436efa29d1de
2021-05-14 15:23:27 -07:00
Dean Lee e333e4f189 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>
old-commit-hash: 7222d0f20dc8edfe0d2f3417d1ce7c84fbd32805
2021-05-08 22:15:17 -07:00
Willem Melching 78bf4f5867 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>
old-commit-hash: ab319d4f54a53e1a0aa1c2c0d94d56a9acef8362
2021-05-06 14:39:05 +02:00
Willem Melching 39c18d4c5a Revert "Replace ifdefs with hardware abstraction layer (#20801)"
This reverts commit 9f2ad462f39f4c880f283b71bffbc9248a2b577d.

old-commit-hash: 3a95d3ccaae7168073410cd7d392a9564d9d45ba
2021-05-06 12:29:30 +02:00
Dean Lee e0282ced49 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
old-commit-hash: 757d2923d2bfcda620b252e21a348ac3f87f3a63
2021-05-06 11:41:46 +02:00
Adeeb Shihadeh 88434dc9e4 add CLEAR_ON_IGNITION param type (#20810)
old-commit-hash: b4447993c10b36628cb72b58dba8104c9060bb7f
2021-05-04 11:32:40 -07:00
Adeeb Shihadeh 532d19427c bump cereal
old-commit-hash: 8a280fbb8eb433fbfe0fc43254c9cbdaceedbab6
2021-05-03 20:47:11 -07:00
Adeeb Shihadeh e09f7360e0 clear controls ready flag on falling edge of ignition (#20807)
old-commit-hash: 6954eb62595474d6f1e974f1cdcad72e79d1fe5d
2021-05-03 19:09:42 -07:00
Adeeb Shihadeh ec7913cbe5 delay controls start (#20761)
* delay controls start

* shouldn't need this stuff anymore

* only delay board

* bail after 2s

* fix loopback test

* fix process replay

* update refs

* bump cereal

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: f9a961f6fb69f36f8a113246920b2d71e6af8ae1
2021-04-30 13:55:17 -07:00
Dean Lee d76b938a03 reserve space for vector of can_frame (#20771)
old-commit-hash: e151425c1c7f3e642b06504c165d7db8bab8a603
2021-04-28 13:50:21 -07:00
Willem Melching 1d79459667 Remove panda set power functions (#20712)
* remove panda set power functions

* removed
old-commit-hash: 34328ba3056557e2efc614ca35e8d04a480b6caa
2021-04-20 15:31:19 +02:00
Willem Melching 548722a954 pigeon init add max retry count
old-commit-hash: f7e276fcce39e5e27c10d0bfb003754ec463c788
2021-04-15 16:49:09 +02:00
Willem Melching 07f89b2838 Improve robustness of ublox init procedure (#20685)
* improve ublox init robustness

* cleanup

* only log if running at 1hz

* not needed
old-commit-hash: a163daf5e024867d7301f4e20bea20fba4bb59ae
2021-04-15 14:11:53 +02:00