Browse Source

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

XGJ_zhaoyuan 1 month ago
parent
commit
8ede021bc8
1 changed files with 1 additions and 1 deletions
  1. 1 1
      core/processors/built_in/lst.py

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

@@ -567,7 +567,7 @@ class ZipCSVProcessor:
         # df_vehicle.dropna(subset=[col for col in required_pos if col in df_vehicle.columns], inplace=True)
         # df_vehicle.dropna(subset=[col for col in required_pos if col in df_vehicle.columns], inplace=True)
 
 
         try:
         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.linspace(df_raw["simTime"].tolist()[0], df_raw["simTime"].tolist()[0] + 0.01*(len(df_vehicle)), len(df_vehicle)), 2)
             df_vehicle["simFrame"] = np.arange(1, len(df_vehicle) + 1)
             df_vehicle["simFrame"] = np.arange(1, len(df_vehicle) + 1)
             df_vehicle["playerId"] = int(player_id)
             df_vehicle["playerId"] = int(player_id)
             df_vehicle['playerId'] = pd.to_numeric(df_vehicle['playerId']).astype(int)
             df_vehicle['playerId'] = pd.to_numeric(df_vehicle['playerId']).astype(int)