From 641ec502a4d9b6839fcc9a5259dceb0936278cd6 Mon Sep 17 00:00:00 2001 From: Shane Date: Fri, 21 Jun 2019 00:04:55 -0500 Subject: [PATCH 1/3] add a_rel to data logging --- selfdrive/controls/lib/long_mpc.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/selfdrive/controls/lib/long_mpc.py b/selfdrive/controls/lib/long_mpc.py index c06e64d7fb4913..bbb9215fe330bd 100644 --- a/selfdrive/controls/lib/long_mpc.py +++ b/selfdrive/controls/lib/long_mpc.py @@ -236,13 +236,14 @@ def update(self, CS, lead, v_cruise_setpoint): x_lead = lead.dRel v_lead = max(0.0, lead.vLead) a_lead = lead.aLeadK + a_rel = lead.aRel if (v_lead < 0.1 or -a_lead / 2.0 > v_lead): v_lead = 0.0 a_lead = 0.0 if self.mpc_id == 1 and not CS.carState.cruiseState.enabled: - self.df_data.append([v_ego, a_ego, v_lead, x_lead, a_lead, gas, brake, time.time()]) + self.df_data.append([v_ego, a_ego, v_lead, x_lead, a_lead, a_rel, gas, brake, time.time()]) if self.df_frame >= 200: # every 5 seconds, write to file try: with open("/data/openpilot/selfdrive/data_collection/df-data", "a") as f: From 643ecf02a2a983fd720928162e11b4ed3d7e74bb Mon Sep 17 00:00:00 2001 From: Shane Date: Fri, 21 Jun 2019 00:06:29 -0500 Subject: [PATCH 2/3] add identifier to easily figure out if new data --- selfdrive/data_collection/df_uploader.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/selfdrive/data_collection/df_uploader.py b/selfdrive/data_collection/df_uploader.py index 23b7e590b97f70..568421eb337041 100644 --- a/selfdrive/data_collection/df_uploader.py +++ b/selfdrive/data_collection/df_uploader.py @@ -28,7 +28,7 @@ def upload_data(): car = json.loads(car) username+="-{}".format(car[0]) - filename = "df-data.{}".format(random.randint(1,99999)) + filename = "df-data.{}.a".format(random.randint(1,99999)) ftp = ftplib.FTP("smiskol.com") ftp.login("eon", "87pYEYF4vFpwvgXU") From 20549cddde00e1689d0023f0206f5c2b11dfea0a Mon Sep 17 00:00:00 2001 From: Shane Date: Fri, 21 Jun 2019 00:06:40 -0500 Subject: [PATCH 3/3] remove because useless --- selfdrive/data_collection/df_uploader.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/selfdrive/data_collection/df_uploader.py b/selfdrive/data_collection/df_uploader.py index 568421eb337041..23b7e590b97f70 100644 --- a/selfdrive/data_collection/df_uploader.py +++ b/selfdrive/data_collection/df_uploader.py @@ -28,7 +28,7 @@ def upload_data(): car = json.loads(car) username+="-{}".format(car[0]) - filename = "df-data.{}.a".format(random.randint(1,99999)) + filename = "df-data.{}".format(random.randint(1,99999)) ftp = ftplib.FTP("smiskol.com") ftp.login("eon", "87pYEYF4vFpwvgXU")