Commit Graph

61 Commits

Author SHA1 Message Date
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
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
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
Robbe Derks
13489d092e Pigeond (#25561)
* split out pigeond from boardd

* also want to turn off power

* fix manager calls

* move to sensord folder

* release files:

* add assistnow code

* no bare except

* add test script to test TTFF

Co-authored-by: Comma Device <device@comma.ai>
2022-08-26 23:11:46 -07:00
Adeeb Shihadeh
90a4565eb2 params: make python and c++ API match (#25573)
* params: make python and c++ API match

* few more
2022-08-26 20:46:19 -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
Gijs Koning
c7771d1783 Bump laika and catch Downloadfiles exception. 2022-07-14 11:49:27 +02:00
Willem Melching
7a4c33795a laikad: add residual threshold for pos_fix (#25082)
* laikad: add residual threshold for pos_fix

* update ref

* update test
2022-07-08 09:20:16 -07:00
Gijs Koning
eaf7eb4278 Laikad: Use clocks for faster fetching orbits (#25060)
* Use clocks msg to for first fetch of orbits. Which is sent earlier than ublox msgs

* refactor last_fetch_orbits

* Add comment.
Add test

* increase timeout

* Add clocks to process replay
2022-07-07 04:06:51 -07:00
Gijs Koning
20ccfed9c1 laikad: Improve logging, fix warning and more exception handling (#25005)
* change logs and add some debugging. Add test

* Less logging and better check for exceptions when parsing orbits

* Fix debug log and fix kf initialization
2022-07-01 07:43:36 -07:00
Willem Melching
3823f55476 add laikad to process replay (#24889)
* merge

* Fix closing process executor after fetching orbits

* cleanup

* Add ref commit and revert test_processes hack

* Fix

* Fix ref

* Fix test

* Temp

* Temp

* Trying

* Trying

* Cleanup and change test

* add ref commit

* remove print

* fix test getting stuck

* cleanup fetch_orbits

Co-authored-by: Gijs Koning <gijs-koning@live.nl>
2022-06-28 13:43:15 +02:00
Willem Melching
b95e687782 split locationd and liblocationd tests (#24977)
* laikad: use cython version of gnss kf

* fix import error

* test liblocationd separate

* Revert "laikad: use cython version of gnss kf"

This reverts commit bdd769b9554e7e45e976dabd6595403943e864bb.
2022-06-27 21:31:54 +02:00
Gijs Koning
5958e78037 Laikad: More logging and use last_pos_fix for correcting (#24868)
Use last available pos_fix for correcting measurements.
Improve logging measurements
2022-06-16 06:21:33 -07:00
Gijs Koning
c3fa9151f3 Laikad: Cache orbit and nav data (#24831)
* Cache orbit and nav data

* Cleanup

* Cleanup

* Use ProcessPoolExecutor to fetch orbits

* update laika repo

* Minor

* Create json de/serializers
Save cache only 1 minute at max

* Update laika repo

* Speed up json by caching json in ephemeris class

* Update laika

* Fix test

* Use constant
2022-06-15 02:32:07 -07:00
Gijs Koning
a2d2378ee1 Laikad: process executor to fetch orbits (#24843)
* Use ProcessPoolExecutor to fetch orbits

* update laika repo

* Minor
2022-06-13 05:02:31 -07:00
Gijs Koning
a9bdc792a1 LaikaD: Fix offline handling (#24781)
* Test handling no internet correctly.

* Clean

* Comment

* remove del
2022-06-08 07:33:05 -07:00
Gijs Koning
e7234e22b4 Laikad: Use process for parsing orbits (#24769)
* Use Process instead of Thread to fetch orbits

* small refactor

* Cleanup
2022-06-07 20:55:39 +02:00
Gijs Koning
8d8055f00f Laikad: cleanup fetching orbits (#24759)
* Seperate prediction orbits from regular observation orbits and download them efficient

* Cleanup

* clean and update laika

* Fix test

* Fix test

* Fix checking pos fix

* space
2022-06-07 03:25:58 -07:00
Gijs Koning
7df54792d8 Laikad: Fetch orbit data in thread (#24654)
* Add fetching orbits thread

* Use ephemeris type enum. Send list of std floats.
Speed up parsing orbit data by skipping redundant old data

* Remove Glonass from supported constellation for now

* Fix latest time msg

* Add small laika update

* Fix
2022-06-04 09:25:20 +02:00
Gijs Koning
a51aaaf197 Add ephemeris parsing to laikad (#24642)
* Always send valid messages

* Use ephemeris and move astrodog in laikad

* improve test

* Always correct measurements

* Cleanup

* Fix test

* Update laika
2022-05-25 06:26:58 -07:00
Gijs Koning
ef97329c0e Add gnss kalman filter to laikad (#24578)
* Add gnss kalman filter to laikad

* Fix analysis

* Fix analysis

* Update laika

* Refactor a bit

* cleanup, improve unit test

* Also commit test

* fix

* Always return messages. Use Measurement struct that contains std and valid keys

* Push cereal

* Change prints to cloudlog

* Always send valid messages

* Only send gnssMeasurement msg when measurementReport type
2022-05-20 03:21:17 -07:00
grekiki
17e33978cd Mypy fixes for --check-untyped-defs (#24372)
more type fixes
2022-05-12 14:08:11 +02:00
Gijs Koning
f7c2eefad9 Bump laika (#24454)
* Fix after laika repo changes

* Update laika
2022-05-09 04:05:08 -07:00
Gijs Koning
e6f9f12d1c Test gnssUblox message processing (#24404)
* Add simple test for processing ublox messages

* Add simple test for processing ublox messages

* Update selfdrive/locationd/test/test_ublox_processing.py

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

* Update

* Push laika ref

Co-authored-by: Willem Melching <willem.melching@gmail.com>
2022-05-06 06:44:38 -07:00
Gijs Koning
b64fe6e339 Laikad: the basics for ublox msg processing (#24359)
* Add laikad that receives ublox messages and publishes corrected measurements and position fix

* types

* cleanup

* laikad version 1 with uncorrected measurements

* push

* Fix glonass frequency and delete redundant test

* Update after cereal and cleanup

* Add test, fix laikad and remove process replay for now

* update laika

* add hatanaka to packages. Used to decompress orbit data

* Fix pip
2022-05-06 04:41:14 -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
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
Willem Melching
8444f8267d calibrationd: convert existing calibration to numpy (#23494)
* calibrationd: convert existing calibration to numpy

* use numpy functions
2022-01-11 15:25:01 +01:00
Adeeb Shihadeh
1a6881edc6 skip falling device test 2022-01-06 14:05:13 -08:00
Ewout ter Hoeven
332f568a82 Pyupgrade 3.6: Update syntax with Python 3.6+ features (#23305)
Updated Python code with Python 3.6+ features:
- utf-8 encoding is now the default (PEP 3120)
- Replace list comprehensions by Generator Expressions (PEP 289)
- Replace yield loop by yield from (PEP 380)
- Remove the (object) subclass when defining a class
- Replace the IOError alias by OSError (PEP 3151)
- Define sets with curly braces {} instead of set()
- Remove "r" parameter from open function, which is default

Co-Authored-By: Adeeb Shihadeh <8762862+adeebshihadeh@users.noreply.github.com>
Co-Authored-By: GregorKikelj <96022003+GregorKikelj@users.noreply.github.com>

Co-authored-by: Adeeb Shihadeh <8762862+adeebshihadeh@users.noreply.github.com>
Co-authored-by: GregorKikelj <96022003+GregorKikelj@users.noreply.github.com>
2021-12-24 11:18:39 -08:00
Robbe Derks
bb7208f4c3 add check for restoring almanac, and clear like suggested in the datasheet (#23153)
Co-authored-by: Comma Device <device@comma.ai>
2021-12-08 14:13:56 +01:00
Adeeb Shihadeh
f7cf66867b remove test too 2021-05-27 12:37:52 -07: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
Adeeb Shihadeh
6b4e49af0e fix linter 2021-05-18 19:35:32 -07:00
Comma Device
bffba1a91e little helper script 2021-05-18 18:56:58 -07:00
HaraldSchafer
e5f93ef142 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
2021-05-14 15:23:27 -07:00
HaraldSchafer
62e22e7eac time checks in locationd (#20880)
* time checks

* no debug print

* correct timestamps in test

* non nan
2021-05-11 15:57:13 -07:00
Willem Melching
c62bb10640 Locationd input sanity checks (#20845)
* Add first sanity checks on inputs

* more gps checks

* make sure test values pass sanity checks

* this localizer supports cannonball runs

Co-authored-by: Harald Schafer <harald.the.engineer@gmail.com>
2021-05-06 13:39:50 -07:00
Willem Melching
e9db5723ef Locationd 100 Hz (#20816)
* fix std transform

* 100Hz

* new ref

* no more decimation

* clean up confusing maths

* static typing

* Revert "static typing"

This reverts commit 23d87337de648e629fbd35dd8c04a740bbefca47.

* 100Hz costs more

* move normalization into core

* add quat idxs

* add big eps

* this is not safe in the filter

* more sensible

* updates to rednose

* not tested

* normalize in python too

* update rednose

* nan check

* check for infs too

* all should be finite

* update ref

* rednose pr now in master

Co-authored-by: Harald Schafer <harald.the.engineer@gmail.com>
2021-05-06 11:01:58 +02:00
HaraldSchafer
daecf4247b Revert "Locationd 100hz (#20759)" (#20797)
* Revert "Locationd 100hz (#20759)"

This reverts commit 333313cf0e.

* new ref
2021-05-02 15:06:34 -07:00
HaraldSchafer
333313cf0e Locationd 100hz (#20759)
* fix std transform

* 100Hz

* new ref

* no more decimation

* clean up confusing maths

* static typing

* Revert "static typing"

This reverts commit 23d87337de648e629fbd35dd8c04a740bbefca47.

* 100Hz costs more
2021-04-28 15:29:14 -07:00
Joost Wooning
5fdcce2551 unittests for locationd uncommon events (#20715)
* unittests for locationd uncommon events

* params test using process

* test for posenet spike

* fix library path

* move random seed to setup
2021-04-22 15:31:18 +02:00
Willem Melching
a163daf5e0 Improve robustness of ublox init procedure (#20685)
* improve ublox init robustness

* cleanup

* only log if running at 1hz

* not needed
2021-04-15 14:11:53 +02:00
Willem Melching
4dd4b12140 Ubloxd cleanup (#20637)
* clean out locationd/test

* get rid of ubloxd_main

* remove ubloxd_test.cc

* less includes
2021-04-09 18:01:24 +02:00
Adeeb Shihadeh
312b681a46 cereal cleanup part 2 (#20092)
* car stuff

* thermal

* Revert "car stuff"

This reverts commit 77fd1c65ebd01abfa8493ae12c9e6b14f7ada976.

* panda state

* camera stuff

* start deg

* most is building

* builds

* planner + controls run

* fix up paramsd

* cleanup

* process replay passes

* fix webcam build

* camerad

* no more frame

* thermald

* ui

* paramsd

* camera replay

* fix long tests

* fix camerad tests

* maxSteeringAngle

* bump cereal

* more frame

* cereal master
2021-02-16 21:39:32 -08:00
robbederks
99d58193e4 implement ublox MON_HW2 message (#19962)
* implement MON_HW2 message

* didn't mean to remove this
2021-02-03 13:09:44 +01:00
Adeeb Shihadeh
ee43eb552b small calibration refactor + tests (#2641)
* calibration tests

* read from capnp

* save using cereal struct

* reset calibration if new car

* car params
2020-11-28 10:12:10 -08:00