From 2803d26b142423bf4e099d1bb72300cb90ab2cc4 Mon Sep 17 00:00:00 2001 From: Joost Wooning Date: Tue, 20 Apr 2021 16:02:57 +0200 Subject: [PATCH] params put in locationd async (#20713) * params put in locationd async * remove reference in thread call old-commit-hash: ed8acfa28447472c282c1c94c929ababb4632305 --- selfdrive/locationd/locationd.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/selfdrive/locationd/locationd.cc b/selfdrive/locationd/locationd.cc index fa2e85f8e..427c29c41 100755 --- a/selfdrive/locationd/locationd.cc +++ b/selfdrive/locationd/locationd.cc @@ -365,7 +365,10 @@ int Localizer::locationd_thread() { VectorXd posGeo = this->get_position_geodetic(); std::string lastGPSPosJSON = util::string_format( "{\"latitude\": %.15f, \"longitude\": %.15f, \"altitude\": %.15f}", posGeo(0), posGeo(1), posGeo(2)); - params.put("LastGPSPosition", lastGPSPosJSON); // TODO write async + + std::thread([¶ms] (const std::string gpsjson) { + params.put("LastGPSPosition", gpsjson); + }, lastGPSPosJSON).detach(); } } }