add test to mapper

This commit is contained in:
zwarenelle
2024-06-09 19:37:52 +02:00
parent 6c2e20ec00
commit 06660a2fa1
6 changed files with 40 additions and 16 deletions

View File

@@ -1,4 +1,5 @@
using RobotController;
using System.Drawing;
namespace Mapper
{
@@ -10,6 +11,22 @@ namespace Mapper
{
this.bottomLeft = bottomLeft;
this.bottomRight = bottomRight;
Console.Write(testPathPlanner);
}
public List<Point> testPathPlanner()
{
CoveragePathPlanner planner = new CoveragePathPlanner(500, 500);
List<Obstacle> obstacles = new List<Obstacle>
{
new Obstacle { X = 100, Y = 100, Width = 50, Height = 50 },
new Obstacle { X = 200, Y = 200, Width = 100, Height = 100 },
new Obstacle { X = 300, Y = 300, Width = 150, Height = 150 }
};
return planner.PlanPath(obstacles);
}
}
}

View File

@@ -1,5 +1,3 @@
namespace RobotController
{
using System;
using System.Collections.Generic;
using System.Linq;

View File

@@ -115,20 +115,6 @@ public class CoveragePathPlanner
return Math.Abs(cell.X - (_width - 1)) + Math.Abs(cell.Y - (_height - 1));
}
public List<Point> test()
{
CoveragePathPlanner planner = new CoveragePathPlanner(500, 500);
List<Obstacle> obstacles = new List<Obstacle>
{
new Obstacle { X = 100, Y = 100, Width = 50, Height = 50 },
new Obstacle { X = 200, Y = 200, Width = 100, Height = 100 },
new Obstacle { X = 300, Y = 300, Width = 150, Height = 150 }
};
return planner.PlanPath(obstacles);
}
}
public class Obstacle

View File

@@ -0,0 +1,23 @@
{
"runtimeTarget": {
"name": ".NETCoreApp,Version=v8.0",
"signature": ""
},
"compilationOptions": {},
"targets": {
".NETCoreApp,Version=v8.0": {
"CoveragePathPlanner/1.0.0": {
"runtime": {
"CoveragePathPlanner.dll": {}
}
}
}
},
"libraries": {
"CoveragePathPlanner/1.0.0": {
"type": "project",
"serviceable": false,
"sha512": ""
}
}
}