Commit Graph

58 Commits

Author SHA1 Message Date
Justin Newberry
a6b17fb1f6 Simulator: fix keyboard ctrl messing with pytest (#30827)
fix
2023-12-20 15:10:11 -08:00
Justin Newberry
8017c25f0b Simulator: only send camera frames at rate that they are generated (#30802)
only send frames at rate that they are generated
2023-12-19 10:45:07 -08:00
Justin Newberry
977dd033c4 Simulator: fix safety param (#30738)
fix param
2023-12-14 19:34:06 -08:00
Kacper Rączy
43e1409fd2 metadrive: fix wasd steer signs (#30623)
* Swap AD signs

* Fix type annotation

* fix user torque

---------

Co-authored-by: Justin Newberry <justin@comma.ai>
2023-12-12 14:09:07 -08:00
Justin Newberry
11ec5bf25e Simulator: remove carla (#30690)
* no carla

* no arg and stylize metadrive
2023-12-11 20:38:37 -08:00
Shane Smiskol
97da129e11 ruff: check newline (#30668)
* check newline

* nothing catches this
2023-12-09 13:24:18 -08:00
Justin Newberry
bb9dda9764 simulator: set valid flags (#30656)
sim set valid
2023-12-08 16:31:30 -08:00
Logan Lasiter
5b2bcf6bf2 adding --local-partial-types mypy opt (#30491) 2023-11-18 22:47:11 -08:00
Justin Newberry
ba90bdf7d9 Simulator: blinkers and lane changes (#30107)
blinkers and lane changes
2023-09-29 16:32:45 -07:00
Justin Newberry
84609f365b Simulator: update documentation for metadrive (#30002)
* update sim docs

* update docs
2023-09-29 12:44:12 -07:00
Justin Newberry
9d3dbd245a Metadrive: move to a separate process (#30103)
* split bridge into two files

* fix metadrive

* wip

* fix tests too

* separate process

* sepeprate process

* finish moving to another process

* remove spammy output
2023-09-29 11:45:14 -07:00
Justin Newberry
2792e5f2db Simulation: engage on startup, print help message (#30044) 2023-09-27 07:21:46 -07:00
Justin Newberry
0857f4bb85 Simulator: add reset hotkey (#29995)
add sim reset
2023-09-20 17:28:41 -07:00
Justin Newberry
e02519bb71 Simulator: add metadrive as optional simulator (#29935)
* Add metadrive sim

* use monotonic

* don't use cuda if it's not available

* Cleanup metadrive patches

* PR suggestions

* fix typo
2023-09-20 10:35:57 -07:00
Justin Newberry
bee40de703 Simulator: fix controlsd mismatch (#29976)
fix controls mismatch
2023-09-19 12:51:54 -07:00
Justin Newberry
7f6718a7cb Simulator: cleanup in preparation for metadrive (#29903)
* sim bridge cleanup

* fix carla

* remove that exception

* pr cleanup

* update car in a thread

* more cleanup

* import sorting

* handle exits better
2023-09-15 14:02:09 -07:00
Justin Newberry
1ee6ed4b16 Linter: remove pylint (#29611)
remove pylint
2023-08-24 16:30:54 -07:00
Adeeb Shihadeh
a9626f95b6 add openpilot prefix to imports (#29498)
* add openpilot prefix to imports

* more

* more

* fix docs

* fix linter

* bump submodules

* fix patched tests

* update dynamic imports

* debug

* Revert "debug"

This reverts commit db5e13b9911cc74438bee123bc3430da6c31b24b.

* fix pm test
2023-08-20 20:49:55 -07:00
Shane Smiskol
84fbf1c2e9 simulator: fix CANParser input args (#29343)
* we weren't testing?

* fix
2023-08-11 14:12:33 -07:00
Harald Schäfer
c5c9d5b921 Fix CARLA simulation (#28541)
* logmessaged conflicts with onnxrunner

* More fixes, now engages

* Fix can properly

* Otherwise it faults

* Put check back

* remove more hacks

* remove more hacks

* Not relevant anymore

* Narrow camera default
2023-06-13 22:54:37 -07:00
Adeeb Shihadeh
49044b5399 remove old tools script 2022-08-07 17:10:14 -07:00
Adeeb Shihadeh
0ca62bf7df let can packer handle counter (#25240)
* let can packer handle counter

* diff is expected

* update refs

* clean that up

* bump opendbc

* fix sim
2022-07-21 20:54:53 -07:00
Adeeb Shihadeh
569a39ff76 CANParser: invalid until valid (#24945)
* CANParser: invalid until valid

* bump opendbc

* bump opendbc

* fix counter in sim
2022-06-22 15:38:38 -07:00
Maxime Desroches
5add0c6159 simulator: run simulator test in ci (#24691)
* run simulator test in ci

* block navd process

* block ui

* fix jenkins

* build docker

* remove tty

* remove tty for carla

* detach carla_sim

* more retries

* only build once

* add more time for bridge

* cleanup

* use qt offscreen

* expose to docker

* block ui

* use new dockerimage

* fix

* from ubuntu20.04

* install curl

* add ssh

* add locales

* noninteractive

* syntax

* use base

* smaller image

* add git + git lfs

* kill carla

* run in parallel

* fix missing agents

* default agent?

* little cleanup

* default doesn't work

* not in ci

* fix path

* fix path

* new msg

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
2022-06-11 15:32:12 -07:00
Gijs Koning
ee433dfa57 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
2022-04-29 07:15:05 -07:00
Adeeb Shihadeh
bb36a1c8b2 sim: add ignition toggling (#24043) 2022-03-25 14:17:45 -07:00
Adeeb Shihadeh
8af20af66d pylint: enforce indentation (W0311) (#24039)
* pylint: enforce indentation (W0311)

* few more
2022-03-24 23:23:29 -07:00
Adeeb Shihadeh
36a3ec04be sim: fix bridge after default values removed from CANParser 2022-01-29 18:22:14 -08:00
Ewout ter Hoeven
55390d273f 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>
2021-12-16 14:58:17 +01:00
jimw
a58d272ae4 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>
2021-11-26 16:58:25 +01:00
Adeeb Shihadeh
45ced84acf sim: fix CAN error and block loggerd 2021-11-13 12:21:24 -08:00
Adeeb Shihadeh
e556d3d3d3 sim: set fingerprint with environment variable (#22679) 2021-10-24 21:59:50 -07:00
orphen
325cabd4da fix: sim: gracefully shutdown the bridge (#21413) 2021-06-29 13:45:34 -07:00
HaraldSchafer
234971203b 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>
2021-06-24 21:03:18 -07:00
Josh Smith
77321dbac4 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
2021-06-03 12:21:04 +02:00
Cameron Reikes
12ce822252 Set standstill bit in sim (#20921) 2021-05-15 21:09:17 -07:00
iejMac
072cdcad6b 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
2021-03-09 19:52:43 -08:00
Adeeb Shihadeh
fe7f3f0ec6 remove gpsd (#20027) 2021-02-10 16:39:39 -08:00
Marcos S
c03a95f7f9 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>
2021-01-18 17:16:32 -08:00
Adeeb Shihadeh
cc1bca542d update simulator to ubuntu 20.04 (#2463)
* fix sim build in 20.04

* run ci

* fix docker build

* restore ci cofnig

Co-authored-by: Willem Melching <willem.melching@gmail.com>
2020-11-18 13:10:37 -08:00
Vivek Aithal
c5dfbe7a72 dockerize carla + openpilot (#2011)
* dockerize carla + openpilot

* separate dockerfile

* bring back CI dockerfile

* cleanup bridge

* add op docker build and start script

* build container in CI

* fix camerad hack

* remove most magic numbers from bridge.py

* openpilot-sim docker build and run scripts

* fix dmonitoring hacks

* revert controlsd hacks

* clean up build scripts

* singular

* fix path

* fix image name

* modify sim readme

* sim readme and start script changes

* dockerfile with working opengl

* working opengl + passing panda build_st in docker

* fix bug in sim docker file

* bugfix sim docker file

* bugfix all op-sim docker issues

* modify readme + run script

* IT DRIVES

* clean this up

* more cleanup

* cleanup docker stuff

* more cleanup

* start with openpilot-base

* install carla python package

* Script is not in lib

* chmod

* everything should be running in docker now, the code may not be nice though

* works locally...

* rhdChecked is deprecated

* Checkout using git lfs when building sim container

* try to pass the tests

* pull latest docker

* gps should not throw an error on openpilot launch in bridge.py

* fixed a coding style error

* Only start ubloxd in car

* fixed more style problems

* revert typo

* Use enviromental variable to prevent errors in a simulator

* Remove unused import

* Attempt to fix missing enviromental variable

* fix typo

* less work for users, auto tmux engagement

* less work for users, auto tmux engagement

* fix check for nvidia

* clean up nvidia check

* remove typo, shorted dockerfile

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
Co-authored-by: Willem Melching <willem.melching@gmail.com>
Co-authored-by: Bruce Wayne <batman@workstation-eu-gregor.eu.local>
Co-authored-by: Gregor Kikelj <gregor1234567890@gmail.com>
2020-09-10 12:14:49 +02:00
Adeeb Shihadeh
20162f7a4a fix counter mismatch in sim 2020-08-06 13:23:20 -07:00
Willem Melching
843a64c72f Make pylint more strict (#1626)
* make pylint more strict

* cleanup in progress

* done cleaning up

* no opendbc
2020-06-02 16:29:32 -07:00
Adeeb Shihadeh
27754a277c enable E261 in flake8: two spaces before inline comment 2020-05-31 14:07:29 -07:00
Adeeb Shihadeh
efd5dffb1e enable flake8 E231: missing whitespace after comma 2020-05-31 12:49:11 -07:00
Adeeb
d9bf9f0a40 Enable more flake8 checks (#1602)
* enable some more flake8 checks

* some more quick ones

* bump opendbc

* e401

* e711 e712

* e115 e116

* e222

* e301

* remove that

* e129

* e701 e702

* e125 e131

* e227

* e306

* e262

* W503

* e713

* e704

* e731

* bump opendbc

* fix some e722
2020-05-30 20:14:58 -07:00
Willem Melching
ba2ac1207a Running pre-commit in CI (#1590)
* Running pre-commit in CI

* fix dockerfile syntax

* dont run on submodule repo folders

* Fix some import errors in ci

* more stuff

* That should be the last one
2020-05-28 15:40:48 -07:00
Willem Melching
3d08dcc3b2 Run mypy commit hook (#1591)
* run mypy commit hook

* fix mypy errors
2020-05-28 15:05:04 -07:00
Willem Melching
29aaa44740 flake8 in pre-commit(#1583) 2020-05-27 20:33:05 -07:00
Willem Melching
bd06434243 pre-commit pylint (#1580)
* "The commit-hook project sounds interesting though. I would definitely merge something that runs flake8 and pylint on the modified files!"
-  pd0wm, https://github.com/commaai/openpilot/pull/1575#issuecomment-634974344

* add pylint to pre-commit and make everything pass

* Remove uncommented stuff

Co-authored-by: J <user@4800.lan>
2020-05-27 20:00:14 -07:00