diff --git a/section_2_sensor_data_processing/8_localization.ipynb b/section_2_sensor_data_processing/8_localization.ipynb index 37f2e9f..ec6da79 100644 --- a/section_2_sensor_data_processing/8_localization.ipynb +++ b/section_2_sensor_data_processing/8_localization.ipynb @@ -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" ] @@ -157,11 +155,6 @@ " \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", @@ -169,11 +162,6 @@ " \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", @@ -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 ###" ] }, @@ -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 ###" ] }, @@ -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 ###" ] }, @@ -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", @@ -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 ###" ] }, @@ -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 ###" ] },