diff --git a/src/CoveragePathPlanner/CoveragePathPlanner.cs b/src/CoveragePathPlanner/CoveragePathPlanner.cs index 710510b..1054677 100644 --- a/src/CoveragePathPlanner/CoveragePathPlanner.cs +++ b/src/CoveragePathPlanner/CoveragePathPlanner.cs @@ -32,7 +32,7 @@ public class CoveragePathPlanner public void AddObstacleCell(int x, int y) { - _obstacles.Add(new Obstacle { X = x, Y = y, Width = 0, Height = 0, IsRectangle = false }); + _obstacles.Add(new Obstacle { X = x, Y = y, Width = 1, Height = 1, IsRectangle = false }); } public List PlanPath() diff --git a/src/Server/RobotControlServer/Routes/RoutePlan.cs b/src/Server/RobotControlServer/Routes/RoutePlan.cs index e95897c..1cbb325 100644 --- a/src/Server/RobotControlServer/Routes/RoutePlan.cs +++ b/src/Server/RobotControlServer/Routes/RoutePlan.cs @@ -27,7 +27,7 @@ public class RoutePlan: IRoute { CoveragePathPlanner planner = new CoveragePathPlanner(500, 500); // Add obstacles cell by cell - foreach (var obj in parsedBody?.objects) + foreach (var obj in $"[{parsedBody?.objects}]".FromJson()) { planner.AddObstacleCell(obj[0], obj[1]); // Get x and y for every coordinate in the parsedbody array }