fix: Fix response message for path/plan

This commit is contained in:
2024-06-26 20:52:56 +02:00
parent 350c5daed9
commit 7444574575
10 changed files with 37 additions and 34 deletions

View File

@@ -1,4 +1,4 @@
\documentclass[conference]{IEEEtran}
\documentclass[10pt]{article}
%/ Use case: language and spell checking
\usepackage[utf8]{inputenc}
@@ -28,13 +28,12 @@
\allsectionsfont{\mdseries\scshape}
\title{\titlecap{\scshape Vergelijking van API architecturen voor de API Server van het Project Robotica}}\normalfont
\author{\IEEEauthorblockN{Wessel Tip $<$contact@wessel.gg$>$ (Student nummer 696770, \url{https://wessel.gg/})}
\IEEEauthorblockA{
Technische Informatica --- Project Robotica \\
\title{\titlecap{\scshape Project Robotica}\normalfont}
\author{Wessel Tip $<$contact@wessel.gg$>$ (\url{https://wessel.gg/}) \\
Technische Informatica \\
Hoogeschool Inholland Alkmaar \\
Jaar 2, Semester 2 (Jan. 2024 - Jun. 2024)
}}
}
\begin{document}

View File

@@ -36,34 +36,34 @@
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent"><![CDATA[{
"keyToString": {
".NET Project.Console.executor": "Run",
"ASKED_ADD_EXTERNAL_FILES": "true",
"RunOnceActivity.OpenProjectViewOnStart": "true",
"RunOnceActivity.ShowReadmeOnStart": "true",
"d452b4e4-aa15-4fa9-847f-33d4d7fab23d.executor": "Run",
"git-widget-placeholder": "master",
"ignore.virus.scanning.warn.message": "true",
"node.js.detected.package.eslint": "true",
"node.js.detected.package.tslint": "true",
"node.js.selected.package.eslint": "(autodetect)",
"node.js.selected.package.tslint": "(autodetect)",
"nodejs_package_manager_path": "npm",
"settings.editor.selected.configurable": "HotReloadSettingsPage",
"vue.rearranger.settings.migration": "true"
<component name="PropertiesComponent">{
&quot;keyToString&quot;: {
&quot;.NET Project.Console.executor&quot;: &quot;Run&quot;,
&quot;ASKED_ADD_EXTERNAL_FILES&quot;: &quot;true&quot;,
&quot;RunOnceActivity.OpenProjectViewOnStart&quot;: &quot;true&quot;,
&quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
&quot;d452b4e4-aa15-4fa9-847f-33d4d7fab23d.executor&quot;: &quot;Run&quot;,
&quot;git-widget-placeholder&quot;: &quot;master&quot;,
&quot;ignore.virus.scanning.warn.message&quot;: &quot;true&quot;,
&quot;node.js.detected.package.eslint&quot;: &quot;true&quot;,
&quot;node.js.detected.package.tslint&quot;: &quot;true&quot;,
&quot;node.js.selected.package.eslint&quot;: &quot;(autodetect)&quot;,
&quot;node.js.selected.package.tslint&quot;: &quot;(autodetect)&quot;,
&quot;nodejs_package_manager_path&quot;: &quot;npm&quot;,
&quot;settings.editor.selected.configurable&quot;: &quot;HotReloadSettingsPage&quot;,
&quot;vue.rearranger.settings.migration&quot;: &quot;true&quot;
},
"keyToStringList": {
"DatabaseDriversLRU": [
"cassandra"
&quot;keyToStringList&quot;: {
&quot;DatabaseDriversLRU&quot;: [
&quot;cassandra&quot;
],
"rider.external.source.directories": [
"C:\\Users\\Wessel\\AppData\\Roaming\\JetBrains\\Rider2023.3\\resharper-host\\DecompilerCache",
"C:\\Users\\Wessel\\AppData\\Roaming\\JetBrains\\Rider2023.3\\resharper-host\\SourcesCache",
"C:\\Users\\Wessel\\AppData\\Local\\Symbols\\src"
&quot;rider.external.source.directories&quot;: [
&quot;C:\\Users\\Wessel\\AppData\\Roaming\\JetBrains\\Rider2023.3\\resharper-host\\DecompilerCache&quot;,
&quot;C:\\Users\\Wessel\\AppData\\Roaming\\JetBrains\\Rider2023.3\\resharper-host\\SourcesCache&quot;,
&quot;C:\\Users\\Wessel\\AppData\\Local\\Symbols\\src&quot;
]
}
}]]></component>
}</component>
<component name="RunManager">
<configuration name="Console" type="DotNetProject" factoryName=".NET Project">
<option name="EXE_PATH" value="$PROJECT_DIR$/Console/bin/Debug/net8.0/Console.exe" />
@@ -117,7 +117,8 @@
<workItem from="1717673464254" duration="1428000" />
<workItem from="1718093417281" duration="4387000" />
<workItem from="1718443610193" duration="8513000" />
<workItem from="1719219142765" duration="850000" />
<workItem from="1719219142765" duration="1400000" />
<workItem from="1719253641573" duration="1910000" />
</task>
<servers />
</component>

View File

@@ -36,11 +36,14 @@ public class RoutePlan: IRoute {
}
List<Point> PlanPath = planner.PlanPath(obstacles);
// Don't know if this is needed here or just do List<Point> path = planner.PlanPath(obstacles);?
string path = JsonConvert.SerializeObject(PlanPath);
List<List<int>> points = new List<List<int>>();
foreach(var point in PlanPath) {
// push [x,y] to points
points.Add(new List<int> {point.X, point.Y});
}
// Return success message with the path
return new HttpResponse($"{{\"message\":\"success\",\"path\":\"{path}\"}}");
return new HttpResponse($"{{\"message\":\"success\",\"path\":{points.ToJson()}}}");
} catch (Exception ex) {
// Return error message if failed for any reason
return new HttpResponse($"{{\"message\": \"{ex.Message.Replace("\"", "\\\"")}\"}}", 400);