Commit Graph

103 Commits

Author SHA1 Message Date
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
Gijs Koning
7b4b8d3f58 Carla pip dependency and fix for git init (#24258)
* Add carla pip dependency for dev

* Revert other packages in pipfile

* Remove redundant carla install in docker

* Fix CI
Remove broken openpilot_build

* New run command
old-commit-hash: e95a250bca
2022-04-20 05:23:27 -07:00
Adeeb Shihadeh
69bfa59a81 sim: write params to enable in Dockerfile (#24113)
old-commit-hash: d1c3b7a20d
2022-04-04 09:05:20 -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
Adeeb Shihadeh
bd71c594a2 pylint: enforce indentation (W0311) (#24039)
* pylint: enforce indentation (W0311)

* few more
old-commit-hash: 8af20af66d
2022-03-24 23:23:29 -07:00
Gijs Koning
772cbb7753 Update carla script to easier install docker and nvidia-docker (#23986)
* Easier docker and nvidia-docker install in carla script

* Small cleanup

* cleanuo

* cleanup

* More comments

* Remove adding usergroup step
old-commit-hash: 3d8537ab23
2022-03-18 14:07:39 -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
Adeeb Shihadeh
05ba2a5866 sim: fix bridge after default values removed from CANParser
old-commit-hash: 36a3ec04be
2022-01-29 18:22:14 -08:00
Adeeb Shihadeh
1ea1b9072a smaller docker image (#23469)
* save 2gb

* not used

* more cleanup

* little more

* wget too big

* follow

* needed for sim
old-commit-hash: fa3055f280
2022-01-10 11:43:18 -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: 332f568a82
2021-12-24 11:18:39 -08:00
Ewout ter Hoeven
a962365292 Convert format strings strings to f-strings (#23241)
* Convert all text strings to f-strings

Reformats all the text from the old "%-formatted" and .format(...) format to the newer f-string format, as defined in PEP 498. This requires Python 3.6+.

Flynt 0.69 was used to reformat the strings. 120 f-strings were created in 51 files.

F-strings are in general more readable, concise and performant. See also: https://www.python.org/dev/peps/pep-0498/#rationale

* revert pyextra changes

* revert ublox.py

Co-authored-by: Willem Melching <willem.melching@gmail.com>
old-commit-hash: 55390d273f
2021-12-16 14:58:17 +01: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
Adeeb Shihadeh
94d30c6c5f camerad: remove camera frame stream (#23045)
* camerad: remove camera frame stream

* fix release files
old-commit-hash: 8160cf3c1b
2021-11-27 21:58:21 -08: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
Adeeb Shihadeh
17b51d3fd8 sim: fix CAN error and block loggerd
old-commit-hash: 45ced84acf
2021-11-13 12:21:24 -08:00
Adeeb Shihadeh
fc4b12c05c sim: set fingerprint with environment variable (#22679)
old-commit-hash: e556d3d3d3
2021-10-24 21:59:50 -07: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
xia0long
42b4521f7b sim: update CARLA to 0.9.12 (#22497)
* bump carla

* update dockerfile

* no need

* specify version

* some fixups

* fix start_carla

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: a3c26a912a
2021-10-10 15:54:47 -07:00
Adeeb Shihadeh
3ed45d74dd improve sim readme
old-commit-hash: 04271fef55
2021-10-10 15:50:30 -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
Adeeb Shihadeh
782d7023d2 phonelibs -> third_party (#22477)
* git mv to third_party

* find and replace

* fix release tests

* update pre-commit

* update tici bins

* update eon bins

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 5b641379ae
2021-10-07 16:32:44 -07:00
Adeeb Shihadeh
b3fdccfab3 sim: build openpilot with frame stream camera
old-commit-hash: 59c47f0334
2021-10-07 11:31:49 -07:00
Piotrek Rybiec
415de2224c sim: fix race condition in tmux script (#22365)
* carla simulator tmux script enhancement

* real name

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: 8412f607b7
2021-09-28 14:07:41 -07: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
c422cce205 Port lateral planning to ACADOS (#22080)
* lateral acados

* looks good!

* add another solve, needed for init somehow

* use copy

* init correctly

* cleanup sconstruct

* Update files_common

* update cpu usage

* reset when invalid

* fix cpu usage

* cost_set doesnt leak

* new ref

* non leaky reset

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 7081ab4fb7
2021-09-13 19:06:54 -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
HaraldSchafer
34ca4a1a29 Simplify longitudinal tests (#21337)
* first pass

* passes!

* little more cleanup

* little more

* fix sim

* remove more plot stuff

* fix crash check

* fcw

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
old-commit-hash: 234971203b
2021-06-24 21:03:18 -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
Cameron Reikes
78ae1be356 Set standstill bit in sim (#20921)
old-commit-hash: 12ce822252
2021-05-15 21:09:17 -07:00
siggie0815
c3a6cc6aa0 sim: mount working dir to the same dir in the container (#20908)
old-commit-hash: 4b7ea0a032
2021-05-14 20:00:13 -07:00
ChoMinSung
7aed8355db start_openpilot_docker.sh: pass in /dev/input for joystick support (#20563)
old-commit-hash: 780654cb3b
2021-04-06 09:55:18 +02:00
Willem Melching
d0cd4d6de9 sim/build_container.sh: fix container name
old-commit-hash: c563968003
2021-03-23 13:20:59 +01:00
ChoMinSung
a5727d14cb start_openpilot_docker.sh: fix docker container name (#20444)
old-commit-hash: 34342b21a9
2021-03-23 13:20:11 +01:00
iejMac
8aa491994f update simulator README
old-commit-hash: 1830a87d9a
2021-03-17 00:42:32 -07:00
iejMac
10844d3b57 mount openpilot in simulator docker image (#20379)
* mount parameter

* works

* fixes
old-commit-hash: dc1506e382
2021-03-16 22:23:38 -07:00
wolterhv
dfb437648e Specify comma containers come from ghcr.io in docker pull commands. (#20342)
old-commit-hash: 5463469f71
2021-03-14 12:59:05 -07:00
iejMac
9f86db04ea Minimize sim docker image size (#20324)
old-commit-hash: 1e5b04ba2f
2021-03-11 19:04:29 -08: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