mirror of
https://github.com/Wessel/Roommapper.git
synced 2026-07-20 23:13:57 +02:00
add test to mapper
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
namespace RobotController
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
src/CoveragePathPlanner/bin/Debug/net8.0/CoveragePathPlanner.dll
Normal file
BIN
src/CoveragePathPlanner/bin/Debug/net8.0/CoveragePathPlanner.dll
Normal file
Binary file not shown.
BIN
src/CoveragePathPlanner/bin/Debug/net8.0/CoveragePathPlanner.pdb
Normal file
BIN
src/CoveragePathPlanner/bin/Debug/net8.0/CoveragePathPlanner.pdb
Normal file
Binary file not shown.
Reference in New Issue
Block a user