delay controls start (#20761)

* delay controls start

* shouldn't need this stuff anymore

* only delay board

* bail after 2s

* fix loopback test

* fix process replay

* update refs

* bump cereal

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: f9a961f6fb69f36f8a113246920b2d71e6af8ae1
This commit is contained in:
Adeeb Shihadeh
2021-04-30 13:55:17 -07:00
committed by GitHub
parent 263aa305f8
commit ec7913cbe5
9 changed files with 47 additions and 23 deletions
+7 -3
View File
@@ -63,6 +63,8 @@ void safety_setter_thread() {
// diagnostic only is the default, needed for VIN query
panda->set_safety_model(cereal::CarParams::SafetyModel::ELM327);
Params p = Params();
// switch to SILENT when CarVin param is read
while (true) {
if (do_exit || !panda->connected){
@@ -70,7 +72,7 @@ void safety_setter_thread() {
return;
};
std::string value_vin = Params().get("CarVin");
std::string value_vin = p.get("CarVin");
if (value_vin.size() > 0) {
// sanity check VIN format
assert(value_vin.size() == 17);
@@ -91,8 +93,10 @@ void safety_setter_thread() {
return;
};
params = Params().get("CarParams");
if (params.size() > 0) break;
if (p.getBool("ControlsReady")) {
params = p.get("CarParams");
if (params.size() > 0) break;
}
util::sleep_for(100);
}
LOGW("got %d bytes CarParams", params.size());
@@ -48,6 +48,7 @@ def test_boardd_loopback():
cp = car.CarParams.new_message()
cp.safetyModel = car.CarParams.SafetyModel.allOutput
Params().put("CarVin", b"0"*17)
Params().put_bool("ControlsReady", True)
Params().put("CarParams", cp.to_bytes())
sendcan = messaging.pub_sock('sendcan')