Skip to content

Commit

Permalink
remove solution in localization task
Browse files Browse the repository at this point in the history
  • Loading branch information
gkueppers committed Oct 16, 2023
1 parent 52d0b3a commit 368a7e8
Showing 1 changed file with 2 additions and 34 deletions.
36 changes: 2 additions & 34 deletions section_2_sensor_data_processing/8_localization.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,6 @@
"bag_path = '../bag'\n",
"### START CODE HERE ###\n",
"bag_folder_name = None\n",
"### Solution:\n",
"bag_folder_name = 'localization_evaluation'\n",
"### END CODE HERE ###\n",
"bag_path += '/'+bag_folder_name"
]
Expand Down Expand Up @@ -157,23 +155,13 @@
" \n",
" # append the TrajectoryPoint2D-object to trajectory\n",
" \n",
" ### Solution:\n",
" # set all members of the TrajectoryPoint2D-object based on a nav_msgs::msg::Odometry\n",
" point.from_odometry(msg)\n",
" # append the TrajectoryPoint2D-object to trajectory\n",
" trj.append(point)\n",
" ### END CODE HERE ###\n",
" elif connection.msgtype=='geometry_msgs/msg/PoseStamped':\n",
" ### START CODE HERE ###\n",
" # set all members of the TrajectoryPoint2D-object based on a geometry_msgs::msg::PoseStamped\n",
" \n",
" # append the TrajectoryPoint2D-object to trajectory\n",
" \n",
" ### Solution:\n",
" # set all members of the TrajectoryPoint2D-object based on a geometry_msgs::msg::PoseStamped\n",
" point.from_pose(msg)\n",
" # append the TrajectoryPoint2D-object to trajectory\n",
" trj.append(point)\n",
" ### END CODE HERE ###\n",
" else:\n",
" # print message if topic contains a message of unsupported type\n",
Expand All @@ -200,9 +188,6 @@
"### START CODE HERE ###\n",
"\n",
"\n",
"### Solution:\n",
"gt_trj=read_trajectory(bag_path, '/ground_truth/pose')\n",
"est_trj=read_trajectory(bag_path, '/localization/predicted_pose')\n",
"### END CODE HERE ###"
]
},
Expand All @@ -229,14 +214,9 @@
"source": [
"### START CODE HERE ###\n",
"# Ground-Truth-Trajectory-Data-Frame\n",
"#df_gt = pd.DataFrame({'t': [point.t for point in None], 'x': [point.x for point in None], 'y': [point.y for point in None], 'psi': [point.psi for point in None]})\n",
"# Estimated-Trajectory-Data-Frame\n",
"#df_est = pd.DataFrame({'t': [point.t for point in None], 'x': [point.x for point in None], 'y': [point.y for point in None], 'psi': [point.psi for point in None]})\n",
"### Solution:\n",
"# Ground-Truth-Trajectory-Data-Frame\n",
"df_gt = pd.DataFrame({'t': [point.t for point in gt_trj], 'x': [point.x for point in gt_trj], 'y': [point.y for point in gt_trj], 'psi': [point.psi for point in gt_trj]})\n",
"df_gt = pd.DataFrame({'t': [point.t for point in None], 'x': [point.x for point in None], 'y': [point.y for point in None], 'psi': [point.psi for point in None]})\n",
"# Estimated-Trajectory-Data-Frame\n",
"df_est = pd.DataFrame({'t': [point.t for point in est_trj], 'x': [point.x for point in est_trj], 'y': [point.y for point in est_trj], 'psi': [point.psi for point in est_trj]})\n",
"df_est = pd.DataFrame({'t': [point.t for point in None], 'x': [point.x for point in None], 'y': [point.y for point in None], 'psi': [point.psi for point in None]})\n",
"### END CODE HERE ###"
]
},
Expand All @@ -259,8 +239,6 @@
"source": [
"### START CODE HERE ###\n",
"df = pd.merge_asof(df_est, df_gt, on='t', tolerance=None, direction='nearest', suffixes=['_estimate', '_ground_truth'])\n",
"### Solution:\n",
"df = pd.merge_asof(df_est, df_gt, on='t', tolerance=0.025, direction='nearest', suffixes=['_estimate', '_ground_truth'])\n",
"### END CODE HERE ###"
]
},
Expand Down Expand Up @@ -347,9 +325,6 @@
"### START CODE HERE ###\n",
"\n",
"\n",
"### Solution\n",
"df.plot(x='t', y='psi_ground_truth', ax=ax)\n",
"df.plot(x='t', y='psi_estimate', ax=ax)\n",
"### END CODE HERE ###\n",
"# Set legend labels\n",
"ax.legend(['Ground Truth Trajectory', 'Estimated Trajectory'])\n",
Expand Down Expand Up @@ -397,10 +372,6 @@
"\n",
"\n",
"\n",
"### Solution\n",
"df['dx'] = df['x_ground_truth'] - df['x_estimate']\n",
"df['dy'] = df['y_ground_truth'] - df['y_estimate']\n",
"df['dpsi'] = df['psi_ground_truth'] - df['psi_estimate']\n",
"### END CODE HERE ###"
]
},
Expand Down Expand Up @@ -477,9 +448,6 @@
"\n",
"\n",
"\n",
"### Solution\n",
"df['dlon'] = df['dx']*np.cos(df['psi_ground_truth']*np.pi/180.0) + df['dy']*np.sin(df['psi_ground_truth']*np.pi/180.0)\n",
"df['dlat'] = -df['dx']*np.sin(df['psi_ground_truth']*np.pi/180.0) + df['dy']*np.cos(df['psi_ground_truth']*np.pi/180.0)\n",
"### END CODE HERE ###"
]
},
Expand Down

0 comments on commit 368a7e8

Please sign in to comment.