Przeglądaj źródła

修复双车场景下时间戳和playerid号对不上的问题

XGJ_zhaoyuan 1 miesiąc temu
rodzic
commit
65f21e2862
1 zmienionych plików z 2 dodań i 2 usunięć
  1. 2 2
      core/processors/built_in/lst.py

+ 2 - 2
core/processors/built_in/lst.py

@@ -425,7 +425,7 @@ class ZipCSVProcessor:
 
             # Fill potential NaNs introduced by reindexing or missing data
             # Choose appropriate fill strategy (e.g., 0, forward fill, or leave as NaN)
-            df_merged.fillna(0.0, inplace=True)  # Example: fill with 0.0
+            # df_merged.fillna(0.0, inplace=True)  # Example: fill with 0.0
 
             # Save the final merged DataFrame
             df_merged.to_csv(output_path, index=False, encoding="utf-8")
@@ -567,7 +567,7 @@ class ZipCSVProcessor:
         # df_vehicle.dropna(subset=[col for col in required_pos if col in df_vehicle.columns], inplace=True)
 
         try:
-            df_vehicle["simTime"] = np.round(np.arange(df_raw["simTime"].tolist()[0], df_raw["simTime"].tolist()[0] + 0.01*(len(df_vehicle) - 1), 0.01), 2)
+            df_vehicle["simTime"] = np.round(np.arange(df_raw["simTime"].tolist()[0], df_raw["simTime"].tolist()[0] + 0.01*(len(df_vehicle)), 0.01), 2)
             df_vehicle["simFrame"] = np.arange(1, len(df_vehicle) + 1)
             df_vehicle["playerId"] = int(player_id)
             df_vehicle['playerId'] = pd.to_numeric(df_vehicle['playerId']).astype(int)