Skip to content
This repository has been archived by the owner on Jan 25, 2021. It is now read-only.

created map waypoint generator. #4

Open
wants to merge 1 commit into
base: enhance-log-analysis
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 44 additions & 3 deletions log-analysis/Training_analysis.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,47 @@
"road_poly"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Create Boarders\n",
"one_poly = plt.Polygon(l_inner_border, closed=True, fill=None, edgecolor=\"black\")\n",
"two_poly = plt.Polygon(l_outer_border, closed=True, fill=None, edgecolor=\"black\")\n",
"fig, ax = plt.subplots()\n",
"ax.add_patch(one_poly)\n",
"ax.add_patch(two_poly)\n",
"\n",
"# Get number of waypoints\n",
"number_of_waypoints = str(l_center_line.shape[0])\n",
"\n",
"# Plot waypoints\n",
"\n",
"for i, point in enumerate(l_center_line):\n",
" waypoint = (point[0], point[1])\n",
" #check if it the 10th waypoint\n",
" if i % 10 == 0 or i == int(number_of_waypoints) - 1:\n",
" #check if it is the first or last waypoint. they are the same\n",
" if i == 0 or i == int(number_of_waypoints) - 1:\n",
" plt.scatter(point[0], point[1], color='Green', marker=\"*\")\n",
" if i == 0:\n",
" plt.annotate(i,(point[0], point[1]), textcoords=\"offset points\", xytext=(0,3),\n",
" ha=\"right\")\n",
" else:\n",
" plt.scatter(point[0], point[1], color='red', marker=\".\")\n",
" plt.annotate(i,(point[0], point[1]), textcoords=\"offset points\", xytext=(3,5),\n",
" ha=\"center\")\n",
" else:\n",
" plt.scatter(point[0], point[1], color='blue', marker=\".\")\n",
" #print(\"Waypoint \" + str(i) + \": \" + str(waypoint))\n",
"\n",
"# Saves image to running directory\n",
"plt.savefig('waypoints.png', dpi=250)\n",
"plt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down Expand Up @@ -2594,14 +2635,14 @@
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.8"
"pygments_lexer": "ipython2",
"version": "2.7.15+"
}
},
"nbformat": 4,
Expand Down