Commit Graph

65 Commits

Author SHA1 Message Date
grekiki
0393f8b99c Carla simulator: set driver orientation (#27363)
old-commit-hash: 202eb06a05
2023-02-16 14:51:25 -08:00
Hamid Ebadi
1ba96c78a8 carla sim: fix accelerometer sensor data (#26794)
old-commit-hash: 49ae806534
2022-12-20 13:45:06 -08:00
Rohit Bernard
bf27021719 sim: Converting RGB frames to NV12 format in OpenCL (#26169)
* convert carla rgb frames to nv12

* code cleanup

* move kernel

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: 9377448888
2022-10-29 13:20:37 -07:00
wjxjmj
dbd5cd3341 Add ip and port arguments to /tools/sim/bridge.py (#26011)
* Add ip and port arguments

* Add descriptions of ip and port arguments

* Update README.md

* Update README.md

* prefer host/port options

Co-authored-by: Cameron Clough <cameronjclough@gmail.com>
old-commit-hash: dbdb3a02a8
2022-10-11 14:16:40 -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: 01d05f66fe
2022-10-06 16:46:15 -07:00
Adeeb Shihadeh
1cb4cdab24 sim: fix sensor freq and timestamps (#25937)
* sim: fix sensor freq and timestamps

* 100hz

* fix that too
old-commit-hash: 5d33199905
2022-09-29 22:36:09 -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: 29d3ed2ce6
2022-09-29 14:31:54 -07:00
Adeeb Shihadeh
35ff65121e pre-commit: add codespell (#25571)
old-commit-hash: 6590fb2b93
2022-08-30 11:20:55 -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: 90a4565eb2
2022-08-26 20:46:19 -07:00
Cameron Clough
25236f1f79 sim: fix gps message (#25521)
fix gps timestamp field renamed

bug introduced in https://github.com/commaai/cereal/pull/341
old-commit-hash: f65547fbe2
2022-08-22 16:23:36 -07:00
Jeroen
e215317cf0 sim: role_name attribute used by ScenarioRunner for CARLA (#25315)
old-commit-hash: 26d29d2138
2022-07-31 13:18:02 -07:00
ZwX1616
3e2828c9bb fix carla test fake driverState (#24959)
use driverstatev2
old-commit-hash: 6721f0ef57
2022-06-24 14:29:46 -07:00
Adeeb Shihadeh
5fcc792527 sim: update cl kernel path
old-commit-hash: 1baf0e3f4a
2022-06-19 15:49:38 -07:00
Gijs Koning
6a53db981b Simulator: Speed up process by removing second camera (#24679)
* simulator: support running wide camera only

* proper frame id

* use param name that makes more sense

* do some cleanup

* Update tools/sim/bridge.py

Co-authored-by: Willem Melching <willem.melching@gmail.com>
old-commit-hash: b5aed2bf67
2022-05-30 15:25:07 +02:00
Adeeb Shihadeh
3e8625e50b visionipc python shim (#24660)
old-commit-hash: 32a9ccfc37
2022-05-25 20:49:56 -07:00
Adeeb Shihadeh
29a516bed8 replay: cleanup unused RGB buffers (#24537)
* replay: cleanup unused RGB buffers

* update replay cam

* little more
old-commit-hash: ab75c53792
2022-05-14 19:55:12 -07:00
grekiki
7cd23af9b1 Mypy fixes for --check-untyped-defs (#24372)
more type fixes
old-commit-hash: 17e33978cd
2022-05-12 14:08:11 +02:00
Gijs Koning
d0fc9afa48 Simulator: Fix CI and set low_quality default (#24354)
* Change low_quality argument and fix closing carla bridge

* Some fixes

* Change carla process in test

* Change fov to 120, higher doesn't look good

* Update readme and remove redundant test

* update

* Add folder description
old-commit-hash: ee433dfa57
2022-04-29 07:15:05 -07:00
Gijs Koning
0112f4212f Simulator: Fix keyboard input (#24320)
* Fix keyboard input for simulator

* add unblock_stdout() to test

* Revert import change
old-commit-hash: 01968ca61b
2022-04-25 07:26:30 -07:00
Gijs Koning
4ed3a158af Simulator Tests (#24274)
* squash #24009

* Fix from other pr
Add low-quality arg

* Update tools/sim/test/test_carla_integration.py

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

* Updates for comments. Not finished yet

* commit

* fix arguments

* Final changes for comments

* Final fixes

* increase carla client timeout to 10

* make test executable

* actually wait for controlsd to send messages

* Error proof test. Starting up carla at each test and closing down using docker (tried many things).

* commit test carla

* Removed some time.sleeps
Add some more retries for bridge.

* Stop while loop on shutdown

* Increase teardown waiting time

Co-authored-by: Willem Melching <willem.melching@gmail.com>
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: 9be23cbdb9
2022-04-22 18:00:49 +02:00
grekiki
cc943ac9a5 mypy: enable --warn-unreachable (#24282)
* Optional solves mypy assuming None is always None

* oops

* spaces

* Update registration.py

* fix local error

Co-authored-by: Willem Melching <willem.melching@gmail.com>
old-commit-hash: b8b15d5cf1
2022-04-21 18:27:45 +02:00
Gijs Koning
8ddeb3f531 Add wide camera to Carla (#23989)
* Add c3 camera flag to bridge.py

* Set c3_cameras to default

* add runtime error message

* Remove c2 arg

* Update to 163 fov to not see through car

* update comment

* Update tools/sim/bridge.py

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

* Revert camera.py changes

* Remove focal_length

* cleanup

Co-authored-by: Willem Melching <willem.melching@gmail.com>
old-commit-hash: 13254cef2f
2022-04-20 08:06:56 -07:00
Adeeb Shihadeh
0c9aa1570b sim: add ignition toggling (#24043)
old-commit-hash: bb36a1c8b2
2022-03-25 14:17:45 -07:00
Jack Huang
d44266bed4 CARLA: fix setting camera EOF (#24034)
* Fix Openpilot in Carla isn't accelerating

The scalars of the timestamp are different in real-world and simulation,
which will cause an infinite loop in selfdrive/modeld/modeld.cc.

* Set eof based on the frame ID

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

* remove global

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: db93275d87
2022-03-25 13:45:08 -07:00
Gijs Koning
cedd8abc05 Rename RGB vision streams to match YUV streams (#23961)
* Renaming VISION_STREAM_RGB_.. to match yuv names like VISION_STREAM_ROAD
VISION_STREAM_RGB_BACK -> VISION_STREAM_RGB_ROAD
VISION_STREAM_RGB_FRONT -> VISION_STREAM_RGB_DRIVER

* little more

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: 57b6fdc17a
2022-03-14 14:03:54 -07: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: 332f568a82
2021-12-24 11:18:39 -08:00
Dean Lee
9b0fcaeb84 rename yuv streams (#23071)
* rename yuv streams

* bump cereal

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: 348d2d2b0d
2021-11-29 18:14:59 -08:00
Willem Melching
70e2e78f52 sim: improve carla performance (#23046)
old-commit-hash: a4ca8e4835
2021-11-28 11:32:37 +01:00
jimw
cf29eacca4 CARLA: send YUV and RGB over visionipc from bridge.py (#23012)
* CARLA: send YUV and RGB over visionipc

* CARLA: send YUV and RGB over visionipc-fix pipfile

* CARLA: send YUV and RGB over visionipc-Camerad class

* relock pipfile

* small bridge cleanup

* use tici camera resolution

* update vof

* HUD_SETTING has no counter

* no loggerd

Co-authored-by: jwolffe <wolffja@gmail.com>
Co-authored-by: Willem Melching <willem.melching@gmail.com>
old-commit-hash: a58d272ae4
2021-11-26 16:58:25 +01:00
jimw
aaae6ac738 sim: send peripheralState message (#22541)
* controlsd: ignore peripheralState for Simulation

* controlsd: use fake peripheralState for Simulation

* controlsd: use fake peripheralState for Simulation

* controlsd: use fake peripheralState for Simulation

* Apply suggestions from code review

* sim: send peripheralState message

* sim: send peripheralState message

* sim: send peripheralState message

* sim: send peripheralState message

Co-authored-by: wolffja <wolffja@ubuntu20.04LTS>
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: 26c5e7b826
2021-10-13 17:16:56 -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: 91987f38d4
2021-10-08 17:54:34 +02:00
Alfonso Hernandez
0f3b5ba1dd Fix throttle scaling in simulator to match gas 1.0 to NIDEC_ACCEL_MAX in Honda CarControllerParams (#22310)
old-commit-hash: 703d0cb832
2021-09-22 09:38:38 -07:00
HaraldSchafer
a73a820338 Change car controller interface from gas/brake to acceleration (#21911)
* retune civic

* seems smooth

* back to normal

* new ref

* fix conflict

* runs

* rm

* accel scale is 4

* toyota should be good

* more cleanup

* fixup

* better naming

* update ref

* deprecated

* sending brake when not enable causes a fault

* rm gas and brake

* unused

* update ref

* acura logic is no more

* wrong before

* revert tuning cleanup

* adress comments

* update ref

* already on master

Co-authored-by: Willem Melching <willem.melching@gmail.com>
old-commit-hash: 1ac89f14aa
2021-08-30 09:32:52 -07:00
HaraldSchafer
7e87930a20 Refactor lateral lag compensation (#21334)
* add T_IDXS

* refactor

* fix test

* unused

* typo

* needs casting

* Update selfdrive/controls/lib/drive_helpers.py

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

* deprecate field

* regen all

* new segs

* add todo

* split back

* clean

* bad names

* do in controls

* add arg

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: 6838e1c82c
2021-06-30 14:19:39 -07:00
orphen
b433129fd6 fix: sim: gracefully shutdown the bridge (#21413)
old-commit-hash: 325cabd4da
2021-06-29 13:45:34 -07:00
Alfonso Hernandez
4f3ad7284c Simulator: Complete GPS message from Carala State Values (#21357)
old-commit-hash: 22b632f407
2021-06-21 13:52:46 +02:00
siggie0815
35f0bcb35a CARLA: save calibration params as capnp (#21144)
old-commit-hash: c798c5f027
2021-06-04 16:05:05 -07:00
Josh Smith
2cae3a3799 Add type hints, small cleanups (#21080)
* improve tools.lib.kbhit and tools.sim.lib.keyboard_ctrl

* unpack more efficiently

* minor improvements

* agnos.py match spec better

* manual_ctrl test missing queue arg

* fix incorrect type annotation

* queues are generic

* varname reuse resulting in incorrect type inference

* bytes().hex() rather than bytes.hex(bytes())

* a bit of type hinting stuff
old-commit-hash: 77321dbac4
2021-06-03 12:21:04 +02:00
Cameron Reikes
5d11f5adc5 sim: get GPS data from CARLA (#20717)
* Send simulated carla GPS to OP

* Use ublox enum from cereal

* Add more fields to carla gnss packet

* use math.degrees

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: fc4f27d20a
2021-05-18 19:52:09 -07:00
iejMac
7780426434 improving tools readme (#20305)
* rough draft

* plotjuggler and carla description

* testing someting

* this is cool

* very short replay and debug desc

* small change

* small change 2

* better word

* low quality mode

* better word

* fixes

* changes

* minor fixes

* ubuntu_setup fix + README changes

* Update tools/README.md

* Update README.md

* Update README.md

* Update README.md

* changes

* Update tools/sim/README.md

* final changes

* final change

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: c4031750f3
2021-03-11 15:28:37 -08:00
iejMac
9c3c7b2f7d tuning simulator parameters (#20304)
* regular and low quality

* low_quality instead of quality

* fix
old-commit-hash: baf07191d2
2021-03-10 21:57:24 -08:00
iejMac
e8326f2555 minor bug fixes in sim (#20286)
* order doensn't matter

* order doensn't matter

* minor fixes

* minor fixes

* not blocking ctrl-c

* removing weather params

* removing type ignore
old-commit-hash: 072cdcad6b
2021-03-09 19:52:43 -08:00
Willem Melching
2e6473611d bridge.py: don't clear params
old-commit-hash: b2b207917e
2021-03-08 15:53:18 +01:00
iejMac
afc0597686 Fix simulator docker: CPU only for now (#20227)
* initial commit

* CPU working in dokcer

* Update selfdrive/manager.py

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

* Update selfdrive/manager.py

* fixes

* fixing env var

* fixes

* building and running in docker

* camerad fix

* camerad fix

* this ACTUALLY works

* removing unused libraries

* updating to CARLA 0.9.11

* removing useless flags

* small changes

* forgot this

* sudo not needed for xhost

* final changes

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: 968ed10200
2021-03-07 23:02:57 -08: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: 312b681a46
2021-02-16 21:39:32 -08:00
Adeeb Shihadeh
966945880b Cereal cleanup (#20003)
* start cleanup

* fan speed

* cleanup dm

* fix cereal

* hwType -> pandaType

* update refs

* update refs

* bump cereal

* freeSpacePercent

* cereal master
old-commit-hash: 000bd226aa
2021-02-03 19:57:30 -08:00
Marcos S
059bddf7fc Carla fixes (#19824)
* use carla provided frame_number

* fix carla comm issues error

* add minimal W-A-S-D keyboard controls

* fix window from carla docker not showing

* carla 0.9.7 uses `frame`, not `frame_number`

* set safetyModel on health for simulator

* safetyModel check now works with simulator

* ignore ubloxRaw and frontFrame when running sim

* Update selfdrive/controls/controlsd.py

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

* added WINDOW flag for optional show carla window

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: c03a95f7f9
2021-01-18 17:16:32 -08:00
Logan Lasiter
9f2d368340 update panda in sim (#2528)
old-commit-hash: ed34ffb1ba
2020-11-11 20:49:54 -08:00
Adeeb Shihadeh
0f2dfbfc52 trim trailing whitespace
old-commit-hash: 818bd8a591
2020-11-05 14:11:41 -08:00
Tom Dörr
370ba02e6c Add Flags to Control Simulator (#2246)
* Add flags

* Update readme
old-commit-hash: c13c6ef76b
2020-09-29 14:00:03 -07:00