Skip to content

Commit

Permalink
Removed thresholds in log analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
carlo98 committed Dec 17, 2021
1 parent b43deee commit 9bf3493
Showing 1 changed file with 3 additions and 24 deletions.
27 changes: 3 additions & 24 deletions shared/Log Analysis.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -154,30 +154,7 @@
"outputs": [],
"source": [
"folder_path = \"test_logs/\" + str(run_id)\n",
"file_list_start = os.listdir(folder_path)"
]
},
{
"cell_type": "markdown",
"id": "44b7438a",
"metadata": {},
"source": [
"## Clean anomalies based on threshold on last height"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "f4c3b78c",
"metadata": {},
"outputs": [],
"source": [
"file_list = []\n",
"for file in file_list_start:\n",
" with open(folder_path + \"/\" + file, \"rb\") as file_pkl:\n",
" data = pickle.load(file_pkl)\n",
" if len(data[1]) == 2 and np.abs(data[0]['z'][-1]) < 0.15: # Threshold height, otherwise not landed (vz not trained)\n",
" file_list.append(file)"
"file_list = os.listdir(folder_path)"
]
},
{
Expand Down Expand Up @@ -212,6 +189,8 @@
"for i in range(len(last_pos)):\n",
" if last_pos[i][0] <= 0.3 and last_pos[i][1] <= 0.3:\n",
" success_cont += 1\n",
" if len(data[1]) == 3 and last_pos[i][2] > 0.3: # Checking also vz, if available\n",
" success_cont -= 1\n",
"sr = 100 * success_cont / len(last_pos)\n",
"\n",
"print(\"Success Rate: {}\".format(sr))\n",
Expand Down

0 comments on commit 9bf3493

Please sign in to comment.