Commit Graph

69 Commits

Author SHA1 Message Date
HaraldSchafer eac9ec1570 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>
old-commit-hash: b3324418034fcf09123b614ee2429a4e5bc9d7a5
2022-10-12 17:47:30 -07:00
Adeeb Shihadeh 3e2f436d4c 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>
old-commit-hash: 01d05f66fe5a189209538650dce319b2f7e192ee
2022-10-06 16:46:15 -07:00
Kurt Nistelberger fb06d2769f 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>
old-commit-hash: 29d3ed2ce63a65f793dc0ecb553180a0d0fba03e
2022-09-29 14:31:54 -07:00
Adeeb Shihadeh 35ff65121e pre-commit: add codespell (#25571)
old-commit-hash: 6590fb2b93baedb2e1c5267b4f191f8e20fcd1d2
2022-08-30 11:20:55 -07:00
Robbe Derks 78881cf731 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>
old-commit-hash: 13489d092e2c09119e880022507d7331cf54c615
2022-08-26 23:11:46 -07:00
Adeeb Shihadeh d9c279aea9 params: make python and c++ API match (#25573)
* params: make python and c++ API match

* few more
old-commit-hash: 90a4565eb29fe95fc83acf6e4f0ea0851c284d61
2022-08-26 20:46:19 -07:00
HaraldSchafer fa226dd852 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>
old-commit-hash: 11da2804f6f0ffdc6d9bc0b146c8a308d6b66018
2022-07-28 10:56:59 -07:00
Gijs Koning 2686b4f8e3 Bump laika and catch Downloadfiles exception.
old-commit-hash: c7771d1783ef7d7e1efb29e81aae44ad26747c5c
2022-07-14 11:49:27 +02:00
Willem Melching 1c8af02e54 laikad: add residual threshold for pos_fix (#25082)
* laikad: add residual threshold for pos_fix

* update ref

* update test
old-commit-hash: 7a4c33795a12eefff4c3e5c311f40eae2cf3506b
2022-07-08 09:20:16 -07:00
Gijs Koning c64a61e652 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
old-commit-hash: eaf7eb42784732136e52cd031035e9c5ab520e6e
2022-07-07 04:06:51 -07:00
Gijs Koning 02ee2fd12d 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
old-commit-hash: 20ccfed9c1d75de2a589294a5407e15304fd3f4a
2022-07-01 07:43:36 -07:00
Willem Melching 0071d28b7b 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>
old-commit-hash: 3823f55476b56fd3db0afe686b1d2f3d508817bc
2022-06-28 13:43:15 +02:00
Willem Melching 88a90035cf 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.
old-commit-hash: b95e68778271cccf558452686e022ae57f25a701
2022-06-27 21:31:54 +02:00
Gijs Koning 4b338d69db Laikad: More logging and use last_pos_fix for correcting (#24868)
Use last available pos_fix for correcting measurements.
Improve logging measurements
old-commit-hash: 5958e78037e468795e0db8d42d5209e1e41aec18
2022-06-16 06:21:33 -07:00
Gijs Koning 61dcb8729c 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
old-commit-hash: c3fa9151f39994984b60a19cdd7425dba73ec2fc
2022-06-15 02:32:07 -07:00
Gijs Koning e03eddea87 Laikad: process executor to fetch orbits (#24843)
* Use ProcessPoolExecutor to fetch orbits

* update laika repo

* Minor
old-commit-hash: a2d2378ee147f2db59aecd3401677cb2427d1ced
2022-06-13 05:02:31 -07:00
Gijs Koning 735a7770dc LaikaD: Fix offline handling (#24781)
* Test handling no internet correctly.

* Clean

* Comment

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

* small refactor

* Cleanup
old-commit-hash: e7234e22b4d11cc8f349d02855df9b3414096c0d
2022-06-07 20:55:39 +02:00
Gijs Koning 7bf243b61e 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
old-commit-hash: 8d8055f00f11fcdf0a8a235de5218d9c2fd2f5ad
2022-06-07 03:25:58 -07:00
Gijs Koning 9771eebb62 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
old-commit-hash: 7df54792d8c04d842d44536723edb7b8370c47a1
2022-06-04 09:25:20 +02:00
Gijs Koning 8976820211 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
old-commit-hash: a51aaaf1970fa864a8a2de7c59abd1db277c123a
2022-05-25 06:26:58 -07:00
Gijs Koning e72a8d9330 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
old-commit-hash: ef97329c0e825d477577bf27cbaf772753f077ca
2022-05-20 03:21:17 -07:00
grekiki 7cd23af9b1 Mypy fixes for --check-untyped-defs (#24372)
more type fixes
old-commit-hash: 17e33978cdd9322918e9d5d388f7fa47aa30e9b7
2022-05-12 14:08:11 +02:00
Gijs Koning d849330ca1 Bump laika (#24454)
* Fix after laika repo changes

* Update laika
old-commit-hash: f7c2eefad9897830bf7bce290dec1dfc7d97e1d2
2022-05-09 04:05:08 -07:00
Gijs Koning 0010b565f5 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>
old-commit-hash: e6f9f12d1c9faae8f718306bcd2862278a083351
2022-05-06 06:44:38 -07:00
Gijs Koning c082f26d63 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
old-commit-hash: b64fe6e339c8b8b3f5016a9c58b553c91abc5bdf
2022-05-06 04:41:14 -07:00
HaraldSchafer b0444b39d2 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>
old-commit-hash: f54e724b5dd8b95e03dd4f46676c5e854bafaea6
2022-04-09 15:22:29 -07:00
Vivek Aithal 069fe1a749 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
old-commit-hash: dfc12926144df063fb6bd20a97bb4390a4f5a4ef
2022-03-15 14:40:29 -07:00
Vivek Aithal 5bad0f4400 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
old-commit-hash: 7e6903b58f141b94d645f25c5e0ce15825b60075
2022-03-02 01:01:29 -08:00
Willem Melching fec321a178 calibrationd: convert existing calibration to numpy (#23494)
* calibrationd: convert existing calibration to numpy

* use numpy functions
old-commit-hash: 8444f8267da10aaf52789d03f6d46d6b90be13ab
2022-01-11 15:25:01 +01:00
Adeeb Shihadeh 1d324e09c4 skip falling device test
old-commit-hash: 1a6881edc6318bf30d2ba451d75eeb7d1b53389d
2022-01-06 14:05:13 -08:00
Ewout ter Hoeven f206ebd054 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>
old-commit-hash: 332f568a8241fba9459cb70c76840b9670e6993a
2021-12-24 11:18:39 -08:00
Robbe Derks c9ef5b176e add check for restoring almanac, and clear like suggested in the datasheet (#23153)
Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: bb7208f4c34fe70682f24a3e637b03aeaa4f719c
2021-12-08 14:13:56 +01:00
Adeeb Shihadeh 82a82ce9b6 remove test too
old-commit-hash: f7cf66867bff75f5b53b6d0a2919a67e6e22242f
2021-05-27 12:37:52 -07: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
Adeeb Shihadeh 5a9504b59a fix linter
old-commit-hash: 6b4e49af0ea9ea29493a7f4006a5c0cb5c92ad78
2021-05-18 19:35:32 -07:00
Comma Device 262a059933 little helper script
old-commit-hash: bffba1a91ef37a19a65bc8d7a1546fe0bf326f1a
2021-05-18 18:56:58 -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
HaraldSchafer 420090ffea time checks in locationd (#20880)
* time checks

* no debug print

* correct timestamps in test

* non nan
old-commit-hash: 62e22e7eac898216b11fc0ae364a3a9905df6699
2021-05-11 15:57:13 -07:00
Willem Melching 4707416cdd 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>
old-commit-hash: c62bb106407f50b785570f6b01736839e2b42514
2021-05-06 13:39:50 -07:00
Willem Melching b4263a43fc 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>
old-commit-hash: e9db5723ef348954118643501a92cf0715402fea
2021-05-06 11:01:58 +02:00
HaraldSchafer fd28911282 Revert "Locationd 100hz (#20759)" (#20797)
* Revert "Locationd 100hz (#20759)"

This reverts commit 995b89e6424a7b717fb2c725a64d617fb24a1a85.

* new ref
old-commit-hash: daecf4247be74fbe56ae84b4c6585c4c8cbc49b5
2021-05-02 15:06:34 -07:00
HaraldSchafer cbc2cb24b7 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
old-commit-hash: 333313cf0e6819767d8dcc4a55bea70f0354579f
2021-04-28 15:29:14 -07:00
Joost Wooning ac03b730a4 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
old-commit-hash: 5fdcce2551e5cb7477d9646e449469399d6576fa
2021-04-22 15:31:18 +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
Willem Melching 2d6d92402a Ubloxd cleanup (#20637)
* clean out locationd/test

* get rid of ubloxd_main

* remove ubloxd_test.cc

* less includes
old-commit-hash: 4dd4b1214061ebade872e7de73fce1800a9b74ca
2021-04-09 18:01:24 +02:00
Adeeb Shihadeh 05eb44115e 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
old-commit-hash: 312b681a46b8153314a8420611b6479dd6f70dfc
2021-02-16 21:39:32 -08:00
robbederks 8156542312 implement ublox MON_HW2 message (#19962)
* implement MON_HW2 message

* didn't mean to remove this
old-commit-hash: 99d58193e497385b925a215f42b8bc470e328da4
2021-02-03 13:09:44 +01:00
Adeeb Shihadeh 7ec1329d53 small calibration refactor + tests (#2641)
* calibration tests

* read from capnp

* save using cereal struct

* reset calibration if new car

* car params
old-commit-hash: ee43eb552b9a5d5d1cfea65f00150325c9808a2d
2020-11-28 10:12:10 -08:00
Willem Melching 488bbcaaa4 remove old params learner (#1918)
old-commit-hash: e0e7c7486d653a550c596f9dca7e5b6424d4c05d
2020-07-24 18:43:17 +02:00