diff --git a/.gitignore b/.gitignore index 693c532c54..4bc5fd3a24 100644 --- a/.gitignore +++ b/.gitignore @@ -40,8 +40,7 @@ compile_commands.json compare_runtime*.html persist -board/obj/ -selfdrive/boardd/boardd +selfdrive/pandad/pandad selfdrive/logcatd/logcatd selfdrive/mapd/default_speeds_by_region.json system/proclogd/proclogd diff --git a/Jenkinsfile b/Jenkinsfile index 0a044ff039..321237716b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -192,7 +192,7 @@ node { 'HW + Unit Tests': { deviceStage("tici-hardware", "tici-common", ["UNSAFE=1"], [ ["build", "cd system/manager && ./build.py"], - ["test pandad", "pytest selfdrive/boardd/tests/test_pandad.py"], + ["test pandad", "pytest selfdrive/pandad/tests/test_pandad.py"], ["test power draw", "pytest -s system/hardware/tici/tests/test_power_draw.py"], ["test encoder", "LD_LIBRARY_PATH=/usr/local/lib pytest system/loggerd/tests/test_encoder.py"], ["test pigeond", "pytest system/ubloxd/tests/test_pigeond.py"], @@ -202,7 +202,7 @@ node { 'loopback': { deviceStage("loopback", "tici-loopback", ["UNSAFE=1"], [ ["build openpilot", "cd system/manager && ./build.py"], - ["test boardd loopback", "pytest selfdrive/boardd/tests/test_boardd_loopback.py"], + ["test pandad loopback", "pytest selfdrive/pandad/tests/test_pandad_loopback.py"], ]) }, 'camerad': { @@ -236,9 +236,9 @@ node { 'tizi': { deviceStage("tizi", "tizi", ["UNSAFE=1"], [ ["build openpilot", "cd system/manager && ./build.py"], - ["test boardd loopback", "SINGLE_PANDA=1 pytest selfdrive/boardd/tests/test_boardd_loopback.py"], - ["test boardd spi", "pytest selfdrive/boardd/tests/test_boardd_spi.py"], - ["test pandad", "pytest selfdrive/boardd/tests/test_pandad.py"], + ["test pandad loopback", "SINGLE_PANDA=1 pytest selfdrive/pandad/tests/test_pandad_loopback.py"], + ["test pandad spi", "pytest selfdrive/pandad/tests/test_pandad_spi.py"], + ["test pandad", "pytest selfdrive/pandad/tests/test_pandad.py"], ["test amp", "pytest system/hardware/tici/tests/test_amplifier.py"], ["test hw", "pytest system/hardware/tici/tests/test_hardware.py"], ["test qcomgpsd", "pytest system/qcomgpsd/tests/test_qcomgpsd.py"], diff --git a/RELEASES.md b/RELEASES.md index 971ba7867d..c79f4ae88f 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -634,7 +634,7 @@ Version 0.5.13 (2019-05-31) * Reduce CPU utilization by 20% and improve stability * Temporarily remove mapd functionalities to improve stability * Add openpilot record-only mode for unsupported cars - * Synchronize controlsd to boardd to reduce latency + * Synchronize controlsd to pandad to reduce latency * Remove panda support for Subaru giraffe Version 0.5.12 (2019-05-16) @@ -970,7 +970,7 @@ Version 0.2.8 (2017-02-27) Version 0.2.7 (2017-02-08) =========================== * Better performance and pictures at night - * Fix ptr alignment issue in boardd + * Fix ptr alignment issue in pandad * Fix brake error light, fix crash if too cold Version 0.2.6 (2017-01-31) @@ -1002,7 +1002,7 @@ Version 0.2.2 (2017-01-10) Version 0.2.1 (2016-12-14) =========================== * Performance improvements, removal of more numpy - * Fix boardd process priority + * Fix pandad process priority * Make counter timer reset on use of steering wheel Version 0.2 (2016-12-12) diff --git a/SConstruct b/SConstruct index 1e9f2a6b5a..df34d5af99 100644 --- a/SConstruct +++ b/SConstruct @@ -226,7 +226,7 @@ env = Environment( "#cereal", "#third_party", "#opendbc/can", - "#selfdrive/boardd", + "#selfdrive/pandad", "#common", "#rednose/helpers", ], diff --git a/common/realtime.py b/common/realtime.py index 6b8587ff06..16e9a220e6 100644 --- a/common/realtime.py +++ b/common/realtime.py @@ -23,7 +23,7 @@ class Priority: CTRL_LOW = 51 # plannerd & radard # CORE 3 - # - boardd = 55 + # - pandad = 55 CTRL_HIGH = 53 diff --git a/docs/c_docs.rst b/docs/c_docs.rst index 6e8808ec20..7303c89be8 100644 --- a/docs/c_docs.rst +++ b/docs/c_docs.rst @@ -77,10 +77,10 @@ sensorsd .. autodoxygenindex:: :project: system_sensord_sensors -boardd +pandad ^^^^^^ .. autodoxygenindex:: - :project: selfdrive_boardd + :project: selfdrive_pandad rednose diff --git a/pyproject.toml b/pyproject.toml index 99d6c0472a..5f69948297 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,7 +20,7 @@ markers = [ ] testpaths = [ "common", - "selfdrive/boardd", + "selfdrive/pandad", "selfdrive/car", "selfdrive/controls", "selfdrive/locationd", diff --git a/selfdrive/SConscript b/selfdrive/SConscript index 6b72177d8e..52898f758f 100644 --- a/selfdrive/SConscript +++ b/selfdrive/SConscript @@ -1,4 +1,4 @@ -SConscript(['boardd/SConscript']) +SConscript(['pandad/SConscript']) SConscript(['controls/lib/lateral_mpc_lib/SConscript']) SConscript(['controls/lib/longitudinal_mpc_lib/SConscript']) SConscript(['locationd/SConscript']) diff --git a/selfdrive/boardd/.gitignore b/selfdrive/boardd/.gitignore deleted file mode 100644 index e8daa2ef27..0000000000 --- a/selfdrive/boardd/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -boardd -boardd_api_impl.cpp -tests/test_boardd_usbprotocol diff --git a/selfdrive/boardd/tests/__init__.py b/selfdrive/boardd/tests/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/selfdrive/car/card.py b/selfdrive/car/card.py index 199c425782..330ad40e0d 100755 --- a/selfdrive/car/card.py +++ b/selfdrive/car/card.py @@ -11,7 +11,7 @@ from panda import ALTERNATIVE_EXPERIENCE from openpilot.common.params import Params from openpilot.common.realtime import config_realtime_process, Priority, Ratekeeper, DT_CTRL -from openpilot.selfdrive.boardd.boardd import can_list_to_can_capnp +from openpilot.selfdrive.pandad import can_list_to_can_capnp from openpilot.selfdrive.car.car_helpers import get_car, get_one_can from openpilot.selfdrive.car.interfaces import CarInterfaceBase from openpilot.selfdrive.controls.lib.events import Events @@ -153,7 +153,7 @@ class Car: # Initialize CarInterface, once controls are ready # TODO: this can make us miss at least a few cycles when doing an ECU knockout self.CI.init(self.CP, self.can_sock, self.pm.sock['sendcan']) - # signal boardd to switch to car safety mode + # signal pandad to switch to car safety mode self.params.put_bool_nonblocking("ControlsReady", True) if self.sm.all_alive(['carControl']): diff --git a/selfdrive/car/ecu_addrs.py b/selfdrive/car/ecu_addrs.py index da5e7b4612..e7a9fbcf2c 100755 --- a/selfdrive/car/ecu_addrs.py +++ b/selfdrive/car/ecu_addrs.py @@ -6,7 +6,7 @@ import cereal.messaging as messaging from panda.python.uds import SERVICE_TYPE from openpilot.selfdrive.car import make_can_msg from openpilot.selfdrive.car.fw_query_definitions import EcuAddrBusType -from openpilot.selfdrive.boardd.boardd import can_list_to_can_capnp +from openpilot.selfdrive.pandad import can_list_to_can_capnp from openpilot.common.swaglog import cloudlog diff --git a/selfdrive/car/fw_query_definitions.py b/selfdrive/car/fw_query_definitions.py index ad4dcdc8f1..bb2827571c 100755 --- a/selfdrive/car/fw_query_definitions.py +++ b/selfdrive/car/fw_query_definitions.py @@ -85,7 +85,7 @@ class Request: auxiliary: bool = False # FW responses from these queries will not be used for fingerprinting logging: bool = False - # boardd toggles OBD multiplexing on/off as needed + # pandad toggles OBD multiplexing on/off as needed obd_multiplexing: bool = True diff --git a/selfdrive/car/fw_versions.py b/selfdrive/car/fw_versions.py index fef3c52d34..4bb6413d01 100755 --- a/selfdrive/car/fw_versions.py +++ b/selfdrive/car/fw_versions.py @@ -352,7 +352,7 @@ if __name__ == "__main__": pandaStates_sock = messaging.sub_sock('pandaStates') sendcan = messaging.pub_sock('sendcan') - # Set up params for boardd + # Set up params for pandad params = Params() params.remove("FirmwareQueryDone") params.put_bool("IsOnroad", False) diff --git a/selfdrive/car/isotp_parallel_query.py b/selfdrive/car/isotp_parallel_query.py index 8fdc747e9e..447c7093c5 100644 --- a/selfdrive/car/isotp_parallel_query.py +++ b/selfdrive/car/isotp_parallel_query.py @@ -4,7 +4,7 @@ from functools import partial import cereal.messaging as messaging from openpilot.common.swaglog import cloudlog -from openpilot.selfdrive.boardd.boardd import can_list_to_can_capnp +from openpilot.selfdrive.pandad import can_list_to_can_capnp from openpilot.selfdrive.car.fw_query_definitions import AddrType from panda.python.uds import CanClient, IsoTpMessage, FUNCTIONAL_ADDRS, get_rx_addr_for_tx_addr diff --git a/selfdrive/controls/controlsd.py b/selfdrive/controls/controlsd.py index 1fb7f59496..c8cc76cfc9 100755 --- a/selfdrive/controls/controlsd.py +++ b/selfdrive/controls/controlsd.py @@ -279,7 +279,7 @@ class Controls: else: safety_mismatch = pandaState.safetyModel not in IGNORED_SAFETY_MODES - # safety mismatch allows some time for boardd to set the safety mode and publish it back from panda + # safety mismatch allows some time for pandad to set the safety mode and publish it back from panda if (safety_mismatch and self.sm.frame*DT_CTRL > 10.) or pandaState.safetyRxChecksInvalid or self.mismatch_counter >= 200: self.events.add(EventName.controlsMismatch) diff --git a/selfdrive/controls/tests/test_startup.py b/selfdrive/controls/tests/test_startup.py index fc9f8ab125..14b0788a3d 100644 --- a/selfdrive/controls/tests/test_startup.py +++ b/selfdrive/controls/tests/test_startup.py @@ -4,7 +4,7 @@ from parameterized import parameterized from cereal import log, car import cereal.messaging as messaging from openpilot.common.params import Params -from openpilot.selfdrive.boardd.boardd_api_impl import can_list_to_can_capnp +from openpilot.selfdrive.pandad.pandad_api_impl import can_list_to_can_capnp from openpilot.selfdrive.car.fingerprints import _FINGERPRINTS from openpilot.selfdrive.car.toyota.values import CAR as TOYOTA from openpilot.selfdrive.car.mazda.values import CAR as MAZDA @@ -105,7 +105,7 @@ def test_startup_alert(expected_event, car_model, fw_versions, brand): msgs = [[addr, 0, b'\x00'*length, 0] for addr, length in finger.items()] for _ in range(1000): - # card waits for boardd to echo back that it has changed the multiplexing mode + # card waits for pandad to echo back that it has changed the multiplexing mode if not params.get_bool("ObdMultiplexingChanged"): params.put_bool("ObdMultiplexingChanged", True) diff --git a/selfdrive/debug/clear_dtc.py b/selfdrive/debug/clear_dtc.py index dea21331b7..a931c423a9 100755 --- a/selfdrive/debug/clear_dtc.py +++ b/selfdrive/debug/clear_dtc.py @@ -12,11 +12,11 @@ parser.add_argument('--debug', action='store_true') args = parser.parse_args() try: - check_output(["pidof", "boardd"]) - print("boardd is running, please kill openpilot before running this script! (aborted)") + check_output(["pidof", "pandad"]) + print("pandad is running, please kill openpilot before running this script! (aborted)") sys.exit(1) except CalledProcessError as e: - if e.returncode != 1: # 1 == no process found (boardd not running) + if e.returncode != 1: # 1 == no process found (pandad not running) raise e panda = Panda() diff --git a/selfdrive/debug/cpu_usage_stat.py b/selfdrive/debug/cpu_usage_stat.py index baf44b9082..234dfea3cc 100755 --- a/selfdrive/debug/cpu_usage_stat.py +++ b/selfdrive/debug/cpu_usage_stat.py @@ -9,10 +9,10 @@ System tools like top/htop can only show current cpu usage values, so I write th Calculate minumium/maximum/accumulated_average cpu usage as long term inspections. Monitor multiple processes simuteneously. Sample usage: - root@localhost:/data/openpilot$ python selfdrive/debug/cpu_usage_stat.py boardd,ubloxd - ('Add monitored proc:', './boardd') + root@localhost:/data/openpilot$ python selfdrive/debug/cpu_usage_stat.py pandad,ubloxd + ('Add monitored proc:', './pandad') ('Add monitored proc:', 'python locationd/ubloxd.py') - boardd: 1.96%, min: 1.96%, max: 1.96%, acc: 1.96% + pandad: 1.96%, min: 1.96%, max: 1.96%, acc: 1.96% ubloxd.py: 0.39%, min: 0.39%, max: 0.39%, acc: 0.39% ''' import psutil diff --git a/selfdrive/debug/get_fingerprint.py b/selfdrive/debug/get_fingerprint.py index f7f7a1604f..14f6c0e33c 100755 --- a/selfdrive/debug/get_fingerprint.py +++ b/selfdrive/debug/get_fingerprint.py @@ -4,7 +4,7 @@ # Instructions: # - connect to a Panda -# - run selfdrive/boardd/boardd +# - run selfdrive/pandad/pandad # - launching this script # Note: it's very important that the car is in stock mode, in order to collect a complete fingerprint # - since some messages are published at low frequency, keep this script running for at least 30s, diff --git a/selfdrive/debug/hyundai_enable_radar_points.py b/selfdrive/debug/hyundai_enable_radar_points.py index e5cae0d470..5e7080ef64 100755 --- a/selfdrive/debug/hyundai_enable_radar_points.py +++ b/selfdrive/debug/hyundai_enable_radar_points.py @@ -79,11 +79,11 @@ if __name__ == "__main__": args = parser.parse_args() try: - check_output(["pidof", "boardd"]) - print("boardd is running, please kill openpilot before running this script! (aborted)") + check_output(["pidof", "pandad"]) + print("pandad is running, please kill openpilot before running this script! (aborted)") sys.exit(1) except CalledProcessError as e: - if e.returncode != 1: # 1 == no process found (boardd not running) + if e.returncode != 1: # 1 == no process found (pandad not running) raise e confirm = input("power on the vehicle keeping the engine off (press start button twice) then type OK to continue: ").upper().strip() diff --git a/selfdrive/debug/read_dtc_status.py b/selfdrive/debug/read_dtc_status.py index 9ad5563975..2d27dd2bb2 100755 --- a/selfdrive/debug/read_dtc_status.py +++ b/selfdrive/debug/read_dtc_status.py @@ -13,11 +13,11 @@ parser.add_argument('--debug', action='store_true') args = parser.parse_args() try: - check_output(["pidof", "boardd"]) - print("boardd is running, please kill openpilot before running this script! (aborted)") + check_output(["pidof", "pandad"]) + print("pandad is running, please kill openpilot before running this script! (aborted)") sys.exit(1) except CalledProcessError as e: - if e.returncode != 1: # 1 == no process found (boardd not running) + if e.returncode != 1: # 1 == no process found (pandad not running) raise e panda = Panda() diff --git a/selfdrive/pandad/.gitignore b/selfdrive/pandad/.gitignore new file mode 100644 index 0000000000..f7226cdb87 --- /dev/null +++ b/selfdrive/pandad/.gitignore @@ -0,0 +1,3 @@ +pandad +pandad_api_impl.cpp +tests/test_pandad_usbprotocol diff --git a/selfdrive/boardd/SConscript b/selfdrive/pandad/SConscript similarity index 61% rename from selfdrive/boardd/SConscript rename to selfdrive/pandad/SConscript index 666763d9b0..5e70736515 100644 --- a/selfdrive/boardd/SConscript +++ b/selfdrive/pandad/SConscript @@ -3,9 +3,9 @@ Import('env', 'envCython', 'common', 'cereal', 'messaging') libs = ['usb-1.0', common, cereal, messaging, 'pthread', 'zmq', 'capnp', 'kj'] panda = env.Library('panda', ['panda.cc', 'panda_comms.cc', 'spi.cc']) -env.Program('boardd', ['main.cc', 'boardd.cc'], LIBS=[panda] + libs) +env.Program('pandad', ['main.cc', 'pandad.cc'], LIBS=[panda] + libs) env.Library('libcan_list_to_can_capnp', ['can_list_to_can_capnp.cc']) -envCython.Program('boardd_api_impl.so', 'boardd_api_impl.pyx', LIBS=["can_list_to_can_capnp", 'capnp', 'kj'] + envCython["LIBS"]) +envCython.Program('pandad_api_impl.so', 'pandad_api_impl.pyx', LIBS=["can_list_to_can_capnp", 'capnp', 'kj'] + envCython["LIBS"]) if GetOption('extras'): - env.Program('tests/test_boardd_usbprotocol', ['tests/test_boardd_usbprotocol.cc'], LIBS=[panda] + libs) + env.Program('tests/test_pandad_usbprotocol', ['tests/test_pandad_usbprotocol.cc'], LIBS=[panda] + libs) diff --git a/selfdrive/boardd/boardd.py b/selfdrive/pandad/__init__.py similarity index 81% rename from selfdrive/boardd/boardd.py rename to selfdrive/pandad/__init__.py index 0cdaf5e912..8081a62dd0 100644 --- a/selfdrive/boardd/boardd.py +++ b/selfdrive/pandad/__init__.py @@ -1,5 +1,5 @@ # Cython, now uses scons to build -from openpilot.selfdrive.boardd.boardd_api_impl import can_list_to_can_capnp +from openpilot.selfdrive.pandad.pandad_api_impl import can_list_to_can_capnp assert can_list_to_can_capnp def can_capnp_to_can_list(can, src_filter=None): diff --git a/selfdrive/boardd/can_list_to_can_capnp.cc b/selfdrive/pandad/can_list_to_can_capnp.cc similarity index 95% rename from selfdrive/boardd/can_list_to_can_capnp.cc rename to selfdrive/pandad/can_list_to_can_capnp.cc index 72ca72688a..9fc2648da2 100644 --- a/selfdrive/boardd/can_list_to_can_capnp.cc +++ b/selfdrive/pandad/can_list_to_can_capnp.cc @@ -1,5 +1,5 @@ #include "cereal/messaging/messaging.h" -#include "selfdrive/boardd/panda.h" +#include "selfdrive/pandad/panda.h" void can_list_to_can_capnp_cpp(const std::vector &can_list, std::string &out, bool sendCan, bool valid) { MessageBuilder msg; diff --git a/selfdrive/boardd/main.cc b/selfdrive/pandad/main.cc similarity index 80% rename from selfdrive/boardd/main.cc rename to selfdrive/pandad/main.cc index cb17a584bd..f6f43d372d 100644 --- a/selfdrive/boardd/main.cc +++ b/selfdrive/pandad/main.cc @@ -1,12 +1,12 @@ #include -#include "selfdrive/boardd/boardd.h" +#include "selfdrive/pandad/pandad.h" #include "common/swaglog.h" #include "common/util.h" #include "system/hardware/hw.h" int main(int argc, char *argv[]) { - LOGW("starting boardd"); + LOGW("starting pandad"); if (!Hardware::PC()) { int err; @@ -17,6 +17,6 @@ int main(int argc, char *argv[]) { } std::vector serials(argv + 1, argv + argc); - boardd_main_thread(serials); + pandad_main_thread(serials); return 0; } diff --git a/selfdrive/boardd/panda.cc b/selfdrive/pandad/panda.cc similarity index 99% rename from selfdrive/boardd/panda.cc rename to selfdrive/pandad/panda.cc index a2e5574090..37df4072f2 100644 --- a/selfdrive/boardd/panda.cc +++ b/selfdrive/pandad/panda.cc @@ -1,4 +1,4 @@ -#include "selfdrive/boardd/panda.h" +#include "selfdrive/pandad/panda.h" #include diff --git a/selfdrive/boardd/panda.h b/selfdrive/pandad/panda.h similarity index 98% rename from selfdrive/boardd/panda.h rename to selfdrive/pandad/panda.h index 3002afeba9..7e1e4706d6 100644 --- a/selfdrive/boardd/panda.h +++ b/selfdrive/pandad/panda.h @@ -13,7 +13,7 @@ #include "cereal/gen/cpp/log.capnp.h" #include "panda/board/health.h" #include "panda/board/can_definitions.h" -#include "selfdrive/boardd/panda_comms.h" +#include "selfdrive/pandad/panda_comms.h" #define USB_TX_SOFT_LIMIT (0x100U) #define USBPACKET_MAX_SIZE (0x40) diff --git a/selfdrive/boardd/panda_comms.cc b/selfdrive/pandad/panda_comms.cc similarity index 99% rename from selfdrive/boardd/panda_comms.cc rename to selfdrive/pandad/panda_comms.cc index e2c78abea2..4e8a0a27ba 100644 --- a/selfdrive/boardd/panda_comms.cc +++ b/selfdrive/pandad/panda_comms.cc @@ -1,4 +1,4 @@ -#include "selfdrive/boardd/panda.h" +#include "selfdrive/pandad/panda.h" #include #include diff --git a/selfdrive/boardd/panda_comms.h b/selfdrive/pandad/panda_comms.h similarity index 100% rename from selfdrive/boardd/panda_comms.h rename to selfdrive/pandad/panda_comms.h diff --git a/selfdrive/boardd/boardd.cc b/selfdrive/pandad/pandad.cc similarity index 97% rename from selfdrive/boardd/boardd.cc rename to selfdrive/pandad/pandad.cc index fcbf58999e..095a7893b4 100644 --- a/selfdrive/boardd/boardd.cc +++ b/selfdrive/pandad/pandad.cc @@ -1,4 +1,4 @@ -#include "selfdrive/boardd/boardd.h" +#include "selfdrive/pandad/pandad.h" #include #include @@ -25,7 +25,7 @@ // - The internal panda will always be the first panda // - Consecutive pandas will be sorted based on panda type, and then serial number // Connecting: -// - If a panda connection is dropped, boardd will reconnect to all pandas +// - If a panda connection is dropped, pandad will reconnect to all pandas // - If a panda is added, we will only reconnect when we are offroad // CAN buses: // - Each panda will have it's block of 4 buses. E.g.: the second panda will use @@ -163,7 +163,7 @@ Panda *connect(std::string serial="", uint32_t index=0) { } void can_send_thread(std::vector pandas, bool fake_send) { - util::set_thread_name("boardd_can_send"); + util::set_thread_name("pandad_can_send"); AlignedBuffer aligned_buf; std::unique_ptr context(Context::create()); @@ -198,12 +198,12 @@ void can_send_thread(std::vector pandas, bool fake_send) { } void can_recv_thread(std::vector pandas) { - util::set_thread_name("boardd_can_recv"); + util::set_thread_name("pandad_can_recv"); PubMaster pm({"can"}); // run at 100Hz - RateKeeper rk("boardd_can_recv", 100); + RateKeeper rk("pandad_can_recv", 100); std::vector raw_can_data; while (!do_exit && check_all_connected(pandas)) { @@ -405,7 +405,7 @@ void send_peripheral_state(PubMaster *pm, Panda *panda) { } void panda_state_thread(std::vector pandas, bool spoofing_started) { - util::set_thread_name("boardd_panda_state"); + util::set_thread_name("pandad_panda_state"); Params params; SubMaster sm({"controlsState"}); @@ -495,7 +495,7 @@ void panda_state_thread(std::vector pandas, bool spoofing_started) { void peripheral_control_thread(Panda *panda, bool no_fan_control) { - util::set_thread_name("boardd_peripheral_control"); + util::set_thread_name("pandad_peripheral_control"); SubMaster sm({"deviceState", "driverCameraState"}); @@ -546,8 +546,8 @@ void peripheral_control_thread(Panda *panda, bool no_fan_control) { } } -void boardd_main_thread(std::vector serials) { - LOGW("launching boardd"); +void pandad_main_thread(std::vector serials) { + LOGW("launching pandad"); if (serials.size() == 0) { serials = Panda::list(); diff --git a/selfdrive/boardd/boardd.h b/selfdrive/pandad/pandad.h similarity index 53% rename from selfdrive/boardd/boardd.h rename to selfdrive/pandad/pandad.h index 0646fc6189..9d35949a8f 100644 --- a/selfdrive/boardd/boardd.h +++ b/selfdrive/pandad/pandad.h @@ -3,7 +3,7 @@ #include #include -#include "selfdrive/boardd/panda.h" +#include "selfdrive/pandad/panda.h" bool safety_setter_thread(std::vector pandas); -void boardd_main_thread(std::vector serials); +void pandad_main_thread(std::vector serials); diff --git a/selfdrive/boardd/pandad.py b/selfdrive/pandad/pandad.py similarity index 95% rename from selfdrive/boardd/pandad.py rename to selfdrive/pandad/pandad.py index b4ac2d9548..12accdbf5e 100755 --- a/selfdrive/boardd/pandad.py +++ b/selfdrive/pandad/pandad.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# simple boardd wrapper that updates the panda first +# simple pandad wrapper that updates the panda first import os import usb1 import time @@ -157,10 +157,10 @@ def main() -> NoReturn: first_run = False - # run boardd with all connected serials as arguments - os.environ['MANAGER_DAEMON'] = 'boardd' - os.chdir(os.path.join(BASEDIR, "selfdrive/boardd")) - subprocess.run(["./boardd", *panda_serials], check=True) + # run pandad with all connected serials as arguments + os.environ['MANAGER_DAEMON'] = 'pandad' + os.chdir(os.path.join(BASEDIR, "selfdrive/pandad")) + subprocess.run(["./pandad", *panda_serials], check=True) if __name__ == "__main__": main() diff --git a/selfdrive/boardd/boardd_api_impl.pyx b/selfdrive/pandad/pandad_api_impl.pyx similarity index 100% rename from selfdrive/boardd/boardd_api_impl.pyx rename to selfdrive/pandad/pandad_api_impl.pyx diff --git a/selfdrive/boardd/spi.cc b/selfdrive/pandad/spi.cc similarity index 99% rename from selfdrive/boardd/spi.cc rename to selfdrive/pandad/spi.cc index 66e6a0f0ab..836df59862 100644 --- a/selfdrive/boardd/spi.cc +++ b/selfdrive/pandad/spi.cc @@ -13,7 +13,7 @@ #include "common/timing.h" #include "common/swaglog.h" #include "panda/board/comms_definitions.h" -#include "selfdrive/boardd/panda_comms.h" +#include "selfdrive/pandad/panda_comms.h" #define SPI_SYNC 0x5AU diff --git a/selfdrive/boardd/__init__.py b/selfdrive/pandad/tests/__init__.py similarity index 100% rename from selfdrive/boardd/__init__.py rename to selfdrive/pandad/tests/__init__.py diff --git a/selfdrive/boardd/tests/bootstub.panda.bin b/selfdrive/pandad/tests/bootstub.panda.bin similarity index 100% rename from selfdrive/boardd/tests/bootstub.panda.bin rename to selfdrive/pandad/tests/bootstub.panda.bin diff --git a/selfdrive/boardd/tests/bootstub.panda_h7.bin b/selfdrive/pandad/tests/bootstub.panda_h7.bin similarity index 100% rename from selfdrive/boardd/tests/bootstub.panda_h7.bin rename to selfdrive/pandad/tests/bootstub.panda_h7.bin diff --git a/selfdrive/boardd/tests/bootstub.panda_h7_spiv0.bin b/selfdrive/pandad/tests/bootstub.panda_h7_spiv0.bin similarity index 100% rename from selfdrive/boardd/tests/bootstub.panda_h7_spiv0.bin rename to selfdrive/pandad/tests/bootstub.panda_h7_spiv0.bin diff --git a/selfdrive/boardd/tests/test_pandad.py b/selfdrive/pandad/tests/test_pandad.py similarity index 97% rename from selfdrive/boardd/tests/test_pandad.py rename to selfdrive/pandad/tests/test_pandad.py index 5c74b40ce3..467c7f04c9 100644 --- a/selfdrive/boardd/tests/test_pandad.py +++ b/selfdrive/pandad/tests/test_pandad.py @@ -39,7 +39,7 @@ class TestPandad: managed_processes['pandad'].stop() if len(sm['pandaStates']) == 0 or sm['pandaStates'][0].pandaType == log.PandaState.PandaType.unknown: - raise Exception("boardd failed to start") + raise Exception("pandad failed to start") return dt @@ -101,7 +101,7 @@ class TestPandad: ts.append(dt) # 5s for USB (due to enumeration) - # - 0.2s pandad -> boardd + # - 0.2s pandad -> pandad # - plus some buffer assert 0.1 < (sum(ts)/len(ts)) < (0.5 if self.spi else 5.0) print("startup times", ts, sum(ts) / len(ts)) diff --git a/selfdrive/boardd/tests/test_boardd_loopback.py b/selfdrive/pandad/tests/test_pandad_loopback.py similarity index 93% rename from selfdrive/boardd/tests/test_boardd_loopback.py rename to selfdrive/pandad/tests/test_pandad_loopback.py index 3f5cc5a744..365bb7611b 100644 --- a/selfdrive/boardd/tests/test_boardd_loopback.py +++ b/selfdrive/pandad/tests/test_pandad_loopback.py @@ -11,18 +11,18 @@ from cereal import car, log from openpilot.common.retry import retry from openpilot.common.params import Params from openpilot.common.timeout import Timeout -from openpilot.selfdrive.boardd.boardd import can_list_to_can_capnp +from openpilot.selfdrive.pandad import can_list_to_can_capnp from openpilot.selfdrive.car import make_can_msg from openpilot.system.hardware import TICI from openpilot.selfdrive.test.helpers import phone_only, with_processes @retry(attempts=3) -def setup_boardd(num_pandas): +def setup_pandad(num_pandas): params = Params() params.put_bool("IsOnroad", False) - with Timeout(90, "boardd didn't start"): + with Timeout(90, "pandad didn't start"): sm = messaging.SubMaster(['pandaStates']) while sm.recv_frame['pandaStates'] < 1 or len(sm['pandaStates']) == 0 or \ any(ps.pandaType == log.PandaState.PandaType.unknown for ps in sm['pandaStates']): @@ -32,7 +32,7 @@ def setup_boardd(num_pandas): assert num_pandas == found_pandas, "connected pandas ({found_pandas}) doesn't match expected panda count ({num_pandas}). \ connect another panda for multipanda tests." - # boardd safety setting relies on these params + # pandad safety setting relies on these params cp = car.CarParams.new_message() safety_config = car.CarParams.SafetyConfig.new_message() @@ -72,7 +72,7 @@ class TestBoarddLoopback: @with_processes(['pandad']) def test_loopback(self): num_pandas = 2 if TICI and "SINGLE_PANDA" not in os.environ else 1 - setup_boardd(num_pandas) + setup_pandad(num_pandas) sendcan = messaging.pub_sock('sendcan') can = messaging.sub_sock('can', conflate=False, timeout=100) sm = messaging.SubMaster(['pandaStates']) @@ -80,7 +80,7 @@ class TestBoarddLoopback: n = 200 for i in range(n): - print(f"boardd loopback {i}/{n}") + print(f"pandad loopback {i}/{n}") sent_msgs = send_random_can_messages(sendcan, random.randrange(20, 100), num_pandas) diff --git a/selfdrive/boardd/tests/test_boardd_spi.py b/selfdrive/pandad/tests/test_pandad_spi.py similarity index 96% rename from selfdrive/boardd/tests/test_boardd_spi.py rename to selfdrive/pandad/tests/test_pandad_spi.py index 3bb41155d4..3447ea378b 100644 --- a/selfdrive/boardd/tests/test_boardd_spi.py +++ b/selfdrive/pandad/tests/test_pandad_spi.py @@ -8,7 +8,7 @@ import cereal.messaging as messaging from cereal.services import SERVICE_LIST from openpilot.system.hardware import HARDWARE from openpilot.selfdrive.test.helpers import phone_only, with_processes -from openpilot.selfdrive.boardd.tests.test_boardd_loopback import setup_boardd, send_random_can_messages +from openpilot.selfdrive.pandad.tests.test_pandad_loopback import setup_pandad, send_random_can_messages @pytest.mark.tici @@ -25,7 +25,7 @@ class TestBoarddSpi: @phone_only @with_processes(['pandad']) def test_spi_corruption(self, subtests): - setup_boardd(1) + setup_pandad(1) sendcan = messaging.pub_sock('sendcan') socks = {s: messaging.sub_sock(s, conflate=False, timeout=100) for s in ('can', 'pandaStates', 'peripheralState')} diff --git a/selfdrive/boardd/tests/test_boardd_usbprotocol.cc b/selfdrive/pandad/tests/test_pandad_usbprotocol.cc similarity index 99% rename from selfdrive/boardd/tests/test_boardd_usbprotocol.cc rename to selfdrive/pandad/tests/test_pandad_usbprotocol.cc index aa67e8cf8c..11f7184efd 100644 --- a/selfdrive/boardd/tests/test_boardd_usbprotocol.cc +++ b/selfdrive/pandad/tests/test_pandad_usbprotocol.cc @@ -4,7 +4,7 @@ #include "catch2/catch.hpp" #include "cereal/messaging/messaging.h" #include "common/util.h" -#include "selfdrive/boardd/panda.h" +#include "selfdrive/pandad/panda.h" struct PandaTest : public Panda { PandaTest(uint32_t bus_offset, int can_list_size, cereal::PandaState::PandaType hw_type); diff --git a/selfdrive/test/test_onroad.py b/selfdrive/test/test_onroad.py index 2e2b40d031..bcdf71f8e8 100644 --- a/selfdrive/test/test_onroad.py +++ b/selfdrive/test/test_onroad.py @@ -58,7 +58,7 @@ PROCS = { "./logcatd": 0, "system.micd": 6.0, "system.timed": 0, - "selfdrive.boardd.pandad": 0, + "selfdrive.pandad.pandad": 0, "system.statsd": 0.4, "selfdrive.navd.navd": 0.4, "system.loggerd.uploader": (0.5, 15.0), @@ -67,12 +67,12 @@ PROCS = { PROCS.update({ "tici": { - "./boardd": 4.0, + "./pandad": 4.0, "./ubloxd": 0.02, "system.ubloxd.pigeond": 6.0, }, "tizi": { - "./boardd": 19.0, + "./pandad": 19.0, "system.qcomgpsd.qcomgpsd": 1.0, } }.get(HARDWARE.get_device_type(), {})) diff --git a/system/hardware/tici/hardware.py b/system/hardware/tici/hardware.py index 45d20d976b..57fbf9d631 100644 --- a/system/hardware/tici/hardware.py +++ b/system/hardware/tici/hardware.py @@ -379,7 +379,7 @@ class Tici(HardwareBase): # *** CPU config *** - # offline big cluster, leave core 4 online for boardd + # offline big cluster, leave core 4 online for pandad for i in range(5, 8): val = '0' if powersave_enabled else '1' sudo_write(val, f'/sys/devices/system/cpu/cpu{i}/online') @@ -390,7 +390,7 @@ class Tici(HardwareBase): # *** IRQ config *** - # boardd core + # pandad core affine_irq(4, "spi_geni") # SPI affine_irq(4, "xhci-hcd:usb3") # aux panda USB (or potentially anything else on USB) if "tici" in self.get_device_type(): diff --git a/system/manager/manager.py b/system/manager/manager.py index 93fab3ad17..6d1b8d9c22 100755 --- a/system/manager/manager.py +++ b/system/manager/manager.py @@ -145,7 +145,7 @@ def manager_thread() -> None: elif not started and started_prev: params.clear_all(ParamKeyType.CLEAR_ON_OFFROAD_TRANSITION) - # update onroad params, which drives boardd's safety setter thread + # update onroad params, which drives pandad's safety setter thread if started != started_prev: write_onroad_params(started, params) diff --git a/system/manager/process_config.py b/system/manager/process_config.py index 5e153ffb92..25c5f46497 100644 --- a/system/manager/process_config.py +++ b/system/manager/process_config.py @@ -60,7 +60,7 @@ procs = [ NativeProcess("ui", "selfdrive/ui", ["./ui"], always_run, watchdog_max_dt=(5 if not PC else None)), PythonProcess("soundd", "selfdrive.ui.soundd", only_onroad), NativeProcess("locationd", "selfdrive/locationd", ["./locationd"], only_onroad), - NativeProcess("boardd", "selfdrive/boardd", ["./boardd"], always_run, enabled=False), + NativeProcess("pandad", "selfdrive/pandad", ["./pandad"], always_run, enabled=False), PythonProcess("calibrationd", "selfdrive.locationd.calibrationd", only_onroad), PythonProcess("torqued", "selfdrive.locationd.torqued", only_onroad), PythonProcess("controlsd", "selfdrive.controls.controlsd", only_onroad), @@ -70,7 +70,7 @@ procs = [ PythonProcess("qcomgpsd", "system.qcomgpsd.qcomgpsd", qcomgps, enabled=TICI), #PythonProcess("ugpsd", "system.ugpsd", only_onroad, enabled=TICI), PythonProcess("navd", "selfdrive.navd.navd", only_onroad), - PythonProcess("pandad", "selfdrive.boardd.pandad", always_run), + PythonProcess("pandad", "selfdrive.pandad.pandad", always_run), PythonProcess("paramsd", "selfdrive.locationd.paramsd", only_onroad), NativeProcess("ubloxd", "system/ubloxd", ["./ubloxd"], ublox, enabled=TICI), PythonProcess("pigeond", "system.ubloxd.pigeond", ublox, enabled=TICI), diff --git a/system/qcomgpsd/nmeaport.py b/system/qcomgpsd/nmeaport.py index caff7af646..8b9ab51086 100644 --- a/system/qcomgpsd/nmeaport.py +++ b/system/qcomgpsd/nmeaport.py @@ -127,7 +127,7 @@ def main() -> NoReturn: print("qcomgpsd is running, please kill openpilot before running this script! (aborted)") sys.exit(1) except CalledProcessError as e: - if e.returncode != 1: # 1 == no process found (boardd not running) + if e.returncode != 1: # 1 == no process found (pandad not running) raise e print("power up antenna ...") diff --git a/tools/cabana/SConscript b/tools/cabana/SConscript index 2574e3368b..5bcfdb175a 100644 --- a/tools/cabana/SConscript +++ b/tools/cabana/SConscript @@ -39,4 +39,4 @@ output_json_file = 'tools/cabana/dbc/car_fingerprint_to_dbc.json' generate_dbc = cabana_env.Command('#' + output_json_file, ['dbc/generate_dbc_json.py'], "python3 tools/cabana/dbc/generate_dbc_json.py --out " + output_json_file) -cabana_env.Depends(generate_dbc, ["#common", "#selfdrive/boardd", '#opendbc', "#cereal", Glob("#opendbc/*.dbc")]) +cabana_env.Depends(generate_dbc, ["#common", "#selfdrive/pandad", '#opendbc', "#cereal", Glob("#opendbc/*.dbc")]) diff --git a/tools/cabana/streams/pandastream.h b/tools/cabana/streams/pandastream.h index c50407be1a..3e76247680 100644 --- a/tools/cabana/streams/pandastream.h +++ b/tools/cabana/streams/pandastream.h @@ -7,7 +7,7 @@ #include #include "tools/cabana/streams/livestream.h" -#include "selfdrive/boardd/panda.h" +#include "selfdrive/pandad/panda.h" const uint32_t speeds[] = {10U, 20U, 50U, 100U, 125U, 250U, 500U, 1000U}; const uint32_t data_speeds[] = {10U, 20U, 50U, 100U, 125U, 250U, 500U, 1000U, 2000U, 5000U}; diff --git a/tools/latencylogger/README.md b/tools/latencylogger/README.md index a961f83619..421a6a0b4a 100644 --- a/tools/latencylogger/README.md +++ b/tools/latencylogger/README.md @@ -76,7 +76,7 @@ Frame ID: 1202 Events updated 111.183541 sendcan published 112.981692 controlsState published 113.731994 - boardd + pandad sending sendcan to panda: 250027001751393037323631 81.928119 sendcan sent to panda: 250027001751393037323631 82.164834 sending sendcan to panda: 250027001751393037323631 93.569986 diff --git a/tools/latencylogger/latency_logger.py b/tools/latencylogger/latency_logger.py index 8c6af56b6e..8691149e94 100755 --- a/tools/latencylogger/latency_logger.py +++ b/tools/latencylogger/latency_logger.py @@ -12,7 +12,7 @@ from openpilot.tools.lib.logreader import LogReader DEMO_ROUTE = "9f583b1d93915c31|2022-05-18--10-49-51--0" -SERVICES = ['camerad', 'modeld', 'plannerd', 'controlsd', 'boardd'] +SERVICES = ['camerad', 'modeld', 'plannerd', 'controlsd', 'pandad'] MONOTIME_KEYS = ['modelMonoTime', 'lateralPlanMonoTime'] MSGQ_TO_SERVICE = { 'roadCameraState': 'camerad', @@ -137,7 +137,7 @@ def insert_cloudlogs(lr, timestamps, start_times, end_times): timestamps[int(jmsg['msg']['timestamp']['frame_id'])][service].append((event, time)) continue - if service == "boardd": + if service == "pandad": timestamps[latest_controls_frameid][service].append((event, time)) end_times[latest_controls_frameid][service] = time else: @@ -153,7 +153,7 @@ def insert_cloudlogs(lr, timestamps, start_times, end_times): failed_inserts += 1 if latest_controls_frameid == 0: - print("Warning: failed to bind boardd logs to a frame ID. Add a timestamp cloudlog in controlsd.") + print("Warning: failed to bind pandad logs to a frame ID. Add a timestamp cloudlog in controlsd.") elif failed_inserts > len(timestamps): print(f"Warning: failed to bind {failed_inserts} cloudlog timestamps to a frame ID") diff --git a/tools/replay/can_replay.py b/tools/replay/can_replay.py index c7da8caf71..3ab33a1dfd 100755 --- a/tools/replay/can_replay.py +++ b/tools/replay/can_replay.py @@ -8,7 +8,7 @@ import threading os.environ['FILEREADER_CACHE'] = '1' from openpilot.common.realtime import config_realtime_process, Ratekeeper, DT_CTRL -from openpilot.selfdrive.boardd.boardd import can_capnp_to_can_list +from openpilot.selfdrive.pandad import can_capnp_to_can_list from openpilot.tools.lib.logreader import LogReader from panda import PandaJungle diff --git a/tools/sim/lib/simulated_car.py b/tools/sim/lib/simulated_car.py index 8c15195dcb..6d324e4780 100644 --- a/tools/sim/lib/simulated_car.py +++ b/tools/sim/lib/simulated_car.py @@ -3,7 +3,7 @@ import cereal.messaging as messaging from opendbc.can.packer import CANPacker from opendbc.can.parser import CANParser from openpilot.common.params import Params -from openpilot.selfdrive.boardd.boardd_api_impl import can_list_to_can_capnp +from openpilot.selfdrive.pandad.pandad_api_impl import can_list_to_can_capnp from openpilot.tools.sim.lib.common import SimulatorState from panda.python import Panda