Commit Graph

66 Commits

Author SHA1 Message Date
Adeeb Shihadeh
e63e2dde18 don't block on reading ublox param (#28859) 2023-07-10 15:33:58 -07:00
Kacper Rączy
242e8d2ca8 locationd: initial value for gps_std_factor (#28533)
* setup_gps method

* Add LocalizerGnssSource

* slight refactor

* make it more readable

* Move gnss_source initialization to configure_gnss_souce

* Add gps_variance_factor, gps_vertical_variance_factor and gps_time_offset

* add header changes
2023-06-13 16:12:53 -07:00
Kacper Rączy
9abe95c949 locationd: add filterState (#28340)
* Add filterState to published messages

* Hide it behind DEBUG flag

* Update cereal

* Update cereal
2023-05-31 15:01:12 -07:00
Harald Schäfer
598343aad1 Calibrationd: make recalibrating alert (#28149)
* Initial

* fixes

* not an int anymore

* elif

* revert ref

* update ref

* fix alert text

* regen refs

* update ref

* add recalibration unit test

* set into recalibration state

* fix words

* recalib

* text

* Update selfdrive/controls/lib/events.py

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

---------

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2023-05-15 09:29:57 -07:00
Shane Smiskol
03eb02906d locationd: log time to first fix (#27990)
* locationd ttff

* log time to first fix

* rename

* max it like laikad

* Update selfdrive/locationd/locationd.cc

* Update ref_commit

* Log when gpsOK first becomes true

* don't forget to update current time!

* stash

* make it deterministic (no proc replay cur time)

* Update ref_commit

* rename to make this clear
2023-04-21 16:15:13 -07:00
Shane Smiskol
c9804f8ec2 quectel: move vertical accuracy sanity check (#27819)
* Update rawgpsd.py

* remove from locationd

* Update system/sensord/rawgps/rawgpsd.py

* flip
2023-04-10 20:46:12 -07:00
Harald Schäfer
eca3838237 Locationd qcom retune (#27739) 2023-03-29 16:35:30 -07:00
Adeeb Shihadeh
00513f1001 locationd: adjust GPS alive check for QCOM GPS (#27339)
* locationd: adjust GPS alive check for QCOM GPS

* update refs

* update refs
2023-02-15 11:28:47 -08:00
Kurt Nistelberger
9131da9103 Revert "Add low Gnss laikad test (#26987)"
This reverts commit b7ce77b3aa.
2023-01-19 11:46:22 -08:00
Kurt Nistelberger
b7ce77b3aa Add low Gnss laikad test (#26987)
* add low gnss test

* enable laikad

* temp fix for cache

* update replay

* save LaikadEphemeris for testing

* rem

* update refs

* add comment

Co-authored-by: Kurt Nistelberger <kurt.nistelberger@gmail.com>
2023-01-18 22:29:12 -08:00
Harald Schäfer
4c33d94d3f Revert locationd to gpsLocation (#26963)
* revert locationd laika change

* switch msg

* change proc replay

* back to gpslocation

* update ref

* no np floats in msg

* Ignore empty laikad messages in mapos

* more tolerance

* c++ doesnt work like that
2023-01-14 16:56:14 -08:00
Bruce Wayne
c44b622559 Revert "temporary revert laikad as main gps"
This reverts commit 1e8e4f7ede.
2023-01-14 10:34:59 -08:00
Kurt Nistelberger
1e8e4f7ede temporary revert laikad as main gps 2023-01-13 22:24:16 -08:00
Kurt Nistelberger
88423e25df Laikad: set active (#26850)
* laikad update, renaming

* update locationd

* fix naming

* address PR comments

* upsi

* .

* draft to fix replay

* fix process relay to allow no response for messages

* final fix for process replay

* .

* bump cereal

* update process replay ref commit

* reduce wait time

* .

* last ref change

* move laikad helpers to laika

* .

* fix ublox test

* update refs

* add proper qcom replay support

* fix gnss support if both is available

* update refs

* remove left over

* revert laikad msg

* move laika back to master

* init

* fix gps valid flag

* change time

* add gnss to ignore

* remove gps_valid flag

* .

* adopt orientation reset threshold

* .

* update laikad

* .

* fix stanstill KF resets

* test orienation reset count

* update laika

* bump cereal

* fix process replay

* update laika repo

* remove handle gps

* add extra logging for cache

* .

* add more log

* .

* .

* update laika

* dont remove gps code

* inc min satellite count

* update magic vals and add acc drop

* update laika

* upsi

* rem

* bump laika

* use nav and correct

* more fixes

* use sftp

* No more glonass

* Revert "No more glonass"

This reverts commit a76124da50a1e25f423ad1137c7a046e1d57811d.

* nump laika

* back support old ephemeris cache

* add health to ephemeris message

* bump laika

* remove print

* fix laikad tests

* clean

* remove extra log

* bump laika

* inc timeout for plotjuggler build

* rem cache clear

* .

* enable gps after checks

Co-authored-by: Kurt Nistelberger <kurt.nistelberger@gmail.com>
Co-authored-by: Bruce Wayne <harald.the.engineer@gmail.com>
Co-authored-by: Shane Smiskol <shane@smiskol.com>
2023-01-13 11:37:38 -08:00
Kurt Nistelberger
981532f0c3 Laikad preperation (#26800)
* laikad update, renaming

* update locationd

* address PR comments

* draft to fix replay

* fix process relay to allow no response for messages

* bump cereal

* update process replay ref commit

* move laikad helpers to laika

* fix ublox test

* update refs

* add proper qcom replay support

* fix gnss support if both is available

* update refs

* move laika back to master

* move cereal back to master

Co-authored-by: Kurt Nistelberger <kurt.nistelberger@gmail.com>
2022-12-29 16:56:35 -08:00
Vivek Aithal
fbf2f3816b [locationd] Add input checks (#26460)
* add input checks with same decay as reset_tracker

* add observation timings check

* typo

* bugfix

* improve offline locationd visibility

* sbugfix offline lld

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2022-11-14 15:02:26 -08:00
Kurt Nistelberger
aebb08e105 locationd: add gps sanity check for quectel gps (#26352)
* update check

* .

* .

* remove gps kf time check for gps ok

* upsi

* dont use gps_mode

* update refs

* Update selfdrive/locationd/locationd.cc

Co-authored-by: Shane Smiskol <shane@smiskol.com>

Co-authored-by: Kurt Nistelberger <kurt.nistelberger@gmail.com>
Co-authored-by: Cameron Clough <cameronjclough@gmail.com>
Co-authored-by: Shane Smiskol <shane@smiskol.com>
2022-11-03 23:43:30 -07:00
HaraldSchafer
b332441803 locationd: Fix GPS sensor times with fixed offsets (#25920)
* Rewind to qcom time

* Fix test

* Typo

* init unix_time fix

* add gps sensor_time_offsets

* remove all clocks code and add todo

* :emove clocks in unit test

* update refs

* update refs

Co-authored-by: nuwandavek <vivekaithal44@gmail.com>
2022-10-12 17:47:30 -07:00
Adeeb Shihadeh
01d05f66fe auto-detect pigeon or quectel (#25991)
* auto-detect pigeon or quectel

* persistent

* fix sim

* fix process replay

* fix locationd unit tests

* fix that

Co-authored-by: Comma Device <device@comma.ai>
2022-10-06 16:46:15 -07:00
Adeeb Shihadeh
5d33199905 sim: fix sensor freq and timestamps (#25937)
* sim: fix sensor freq and timestamps

* 100hz

* fix that too
2022-09-29 22:36:09 -07:00
Kurt Nistelberger
29d3ed2ce6 Sensor events splitup (#25714)
* PoC of reading sensors via interrupts instead of polling

* add Gyro and draft for magn

* add more functionality to gpio.cc

* change LSM gyro to interrupt

* resolve rebase conflict

* update BMX accel interrupt impl

* add interrupt collector thread to fetch in parallel

* change get_event interface to return true on successful read

* update BMX gyro interrupt impl

* update gpio.h/.cc according to comments

* address comments, rename Edgetype enum

* Edgetype to EdgeType

* update sensor interrupt interface

* add error handling, and read fd on trigger

* avoid sending empty messages

* fix build

* use gpiochip

* less diff

* gpiochip on both edges, but skip falling edge if rising edge is detected

* init last_ts with 0

* update sensord testcases

* update sensord testsweet

* test for pipeline

* readd with_process

* add null check

* move tests update to seperate PR

* sensord: improve test coverage (#25683)

* update sensord-interrupt testsweet

* address review comments

* inc stddev threshold

* fix format string

* add version 0 check again

* relax strictness after c3 with bmx tests

* relax strictness after tests

Co-authored-by: Kurt Nistelberger <kurt.nistelberger@gmail.com>

* address PR comments

* fix typo

* remove 4ms limit, and skip first 0.5sec of data

* revert disable_interuppt change to destructor

* fix and remove timing skip

* make gpiochip generic

* sensord port

* change from sensorEvents to separated events

* fix gyro usage

* add splitted sensor tests

* modify debug script sensor_data_to_hist.py

* refactor get_event interface to remove sensorEvent message type

* update locationd to non sensorEvent usage

* tmp commit

* fix replay

* fix accelerometer type

* fix sensor to hist debug script

* update sensord tests to split events

* remove rebase artifacts

* port test_sensord.py

* small clean up

* change cereal to sensorEvents-splitup branch

* upate sensorEvents in regen

* fix route generation for splitted sensor events

* regen cleanUp from sensorEvents change

* .

* remove light and temp from locationd

* add generic init delay per sensor

* .

* update routes

* move bmx gyro/accel to its own channel

* adopt sensor tests to bmx channel

* remove rebase artifacts

* fix sensord test

* handle bmx not present

* add bmx sockets to regen

* .

* .

* code cleanUp

* .

* address PR comments

* address PR comments

* address PR comments

* lsm clean up

* readd sensorEvents

* rever regen.py

* .

* update replay refs

* move channels

* fix artifact

* bump cereal

* update refs

* fix timing issue

Co-authored-by: Bruce Wayne <batman@workstation-eu-intern2.eu.local>
Co-authored-by: gast04 <kurt.nistelberger@gmail.com>
Co-authored-by: Willem Melching <willem.melching@gmail.com>
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2022-09-29 14:31:54 -07:00
Adeeb Shihadeh
6590fb2b93 pre-commit: add codespell (#25571) 2022-08-30 11:20:55 -07:00
HaraldSchafer
32201bbbbd Quectel unix timestamp (#25329)
* Use laika

* Fix bug

* Better timestamp name

* Better name

* bump cereal
2022-08-01 22:06:58 -07:00
HaraldSchafer
11da2804f6 Support quectel gps (#25299)
* qcom clock gets corrected randomly it seems

* Use quectel gps

* fix small laikad bugs

* Support both

* Support ublox and qcom clock model

* fix laikad test

* fix typo

* Back to original value

* More typos

Co-authored-by: Comma Device <device@comma.ai>
2022-07-28 10:56:59 -07:00
Shane Smiskol
e6da217813 SubMaster: support for polling in C++ (#24602)
* poll when sm.update isn't 0

* bump cereal

* poll modelV2 in UI

* fix driverview

* need to update here

* empty list means poll all

revert

* Revert "poll modelV2 in UI"

This reverts commit 82aac96a1ffc64eb79b07817451b76e6924a9812.

* Revert "fix driverview"

This reverts commit 074ee10f177cf7c99f8201a85904e01d40adbe6d.

* poll all
2022-05-20 15:00:28 -07:00
HaraldSchafer
f54e724b5d Body cleanup + 100Hz locationd (#24168)
* use PID

* 100hz on the branch

* Better defaults

* fix int clip

* More cleanup

* Fix pid comments

* only notcar gets 100hz

* cleanup

* fix tests

* ignore

* update refs

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2022-04-09 15:22:29 -07:00
Vivek Aithal
dfc1292614 locationd: Commissue fix (#23951)
* check allAliveAndValid only at filter init

* revert cereal and bugfix test

* rename filterValid to filterInitialized

* bump cereal

* correct err

* update refs
2022-03-15 14:40:29 -07:00
Willem Melching
f4c822e8c6 locationd: fix writing LastGPSPosition interval (#23895) 2022-03-02 15:16:19 +01:00
Vivek Aithal
7e6903b58f locationd, paramsd: Check conditions before updating kalman filters (#23789)
* update filters only when all messages are alivbe and valid

* update message valid and fix unit test

* update refs

* move check outside loop

* modify fake message fn in test

* deprecate inputsOK and resolve PR comments

* avoid double looped list comprehension

* follow import conventions

* modify paramsd valid to only be invalid in case of commIssue

* update refs
2022-03-02 01:01:29 -08:00
Vivek Aithal
f808b174af use roll std from locationd (#23449)
* use roll std from locationd

* cleaner

* add todo

* new ref

Co-authored-by: Harald Schafer <harald.the.engineer@gmail.com>
2022-01-12 21:37:09 -08:00
Adeeb Shihadeh
ef225e3e35 locationd: disable falling device detector (#23431) 2022-01-06 12:01:14 -08:00
Dean Lee
9decd3d8a2 util: move all functions into util namespace (#23203) 2021-12-12 14:42:23 -08:00
Dean Lee
48963d4b24 locationd_thread: fix possible dangling reference to params (#23156) 2021-12-08 17:46:18 +01:00
Vivek Aithal
64eb5b0da4 locationd: cleanup (#23088)
* remove dead code, avoid indexing by value in locationd

* remove dead states in live_kf
2021-12-01 00:09:00 -08:00
Vivek Aithal
8b6a147583 locationd: Fix Nav localization reliability (#22959)
* modify reset logic

* remove debug statements

* use ecef pos and vel covariances during reset

* reset orientations initialized to 0,0,GPSbearing

* refactor nav fix

* add fake gps observations to control ecef pos and ecef vel std

* replace fake_P with individual fake cov

* set gps mode flag

* add gps invalid flag names

* update refs

* more accurate gps accuracy check + update refs
2021-11-24 15:24:25 -08:00
Vivek Aithal
534bf697ee locationd : Acceleration Bias in locationd (#22879)
* add accel bias to filter for offline calculation

* bugfix acc bias in live_kf

* add no_accel obsertvation

* increase initial certainty of acc-bias and reduce PN

* increase initial certainty of acc-bias and reduce PN

* increase accel bias PN

* increase obs noise for no_accel observation

* style fixes

* update refs
2021-11-12 15:55:16 -08:00
Vivek Aithal
c7be73b826 locationd: Set ECEF_POS valid flag to false if in no-gps mode (#22857)
* set ECEF_POS valid flag to false if in no-gps mode

* modify valid flag for all ecef states before gps

* add calibrated valid when no gps

* update refs

* remove extra whitespace

* add invalid flag to all NED values pre gps

* update refs

* update correct refs

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2021-11-11 21:34:17 -08:00
Vivek Aithal
5c810a45b0 locationd: Make live_kf robust to no GPS (#22774)
* add no gps observations

* use correct ecef_location, orientation vals and stds for nogps states

* remove earth radius obs

* move initial loc to the ocean

* remove unnecessary changes

* update refs
2021-11-09 14:45:47 -08:00
Mayfield
5246f0231e enable wshadow (#22756)
* enable wshadow (#22714)

* fix replay

* more build fixes

Co-authored-by: Willem Melching <willem.melching@gmail.com>
2021-11-02 17:08:53 +01:00
Vivek Aithal
f1546e6552 expose filter internal states and stds (#22564) 2021-10-14 19:44:31 -07:00
Vivek Aithal
d22f57e36d remove confusing logic in live_kf, move to locationd (#22558) 2021-10-14 11:57:50 -07:00
Vivek Aithal
3778592f50 locationd: modify factor for measurement STDEV in gps update (#22262)
* modify factor for measurement STDEV in gps update

* add new ref_commit
2021-09-17 22:33:46 -07:00
HaraldSchafer
e0087fc313 Fix orientation in map (#21863)
* fix calibrated orientation

* update ref

* cleaner

* update ref

* master

* update again

* update ref again again

* actually compiled this tim,e
2021-08-05 21:06:46 -07:00
Harald Schafer
e63d94d8d2 Revert "nav: use calibrated orientation (#21853)"
This reverts commit 4b209f31a1.
2021-08-04 10:41:49 -07:00
HaraldSchafer
4b209f31a1 nav: use calibrated orientation (#21853)
* calibrate map

* msg added
2021-08-04 09:58:04 -07:00
HaraldSchafer
049a1bca34 Better localizer unstable alert (#21660)
* use canonical language

* filter out when gps signal is flaky

* Update selfdrive/locationd/locationd.cc

Co-authored-by: Willem Melching <willem.melching@gmail.com>

Co-authored-by: Willem Melching <willem.melching@gmail.com>
2021-07-20 19:20:00 -07:00
Willem Melching
6feafc0042 tici: use LSM6DS3 (#21496) 2021-07-06 23:02:54 +02:00
Adeeb Shihadeh
f01ebc5680 make locationd and paramsd RT (#21264) 2021-06-17 14:19:24 -07:00
HaraldSchafer
9a2306e008 gps can be bad in cities (#21270) 2021-06-15 10:17:20 -07:00
Dean Lee
e4e669bb0f add space after function name and if statement (#21225) 2021-06-11 10:17:52 +02:00