Skip to content
Snippets Groups Projects
Commit b26505c5 authored by Bernhard Schiffer's avatar Bernhard Schiffer
Browse files

refactoring code

parent 63c7e383
No related branches found
No related tags found
No related merge requests found
...@@ -10,6 +10,5 @@ ...@@ -10,6 +10,5 @@
!Robotcontroller/ !Robotcontroller/
!Robotcontroller/robotcontroller/ !Robotcontroller/robotcontroller/
!Robotcontroller/robotcontroller/NativeNav.java !Robotcontroller/robotcontroller/NativeNav.java
!Robotcontroller/robotcontroller/NativeNavP2PRouting.java !Robotcontroller/robotcontroller/visibilityGraph
!Robotcontroller/robotcontroller/visualGraph !Robotcontroller/robotcontroller/visibilityGraph/*
!Robotcontroller/robotcontroller/visualGraph/* \ No newline at end of file
\ No newline at end of file
package robotcontroller; package robotcontroller;
import basics.math.Geom; import basics.math.Geom;
import robotcontroller.visibilityGraph.VGAStarRouting;
import robotinterface.Robot; import robotinterface.Robot;
import robotinterface.RobotController; import robotinterface.RobotController;
import robotinterface.RobotGeomUtil; import robotinterface.RobotGeomUtil;
...@@ -92,7 +93,7 @@ public class NativeNav extends RobotController implements MotionSubsystemListene ...@@ -92,7 +93,7 @@ public class NativeNav extends RobotController implements MotionSubsystemListene
// if the robot should be able to turn on the spot in every point // if the robot should be able to turn on the spot in every point
//double drivingBuffer = Robot.robotLengthRotation - Robot.headingDistance + safetyDistance; //double drivingBuffer = Robot.robotLengthRotation - Robot.headingDistance + safetyDistance;
Pos2PosRouting p2p = new NativeNavP2PRouting(drivingBuffer * 1.1, drivingBuffer); Pos2PosRouting p2p = new VGAStarRouting(drivingBuffer * 1.1, drivingBuffer);
driver = new TrajectorySequenceDriver( driver = new TrajectorySequenceDriver(
30, // rotateSpeed, 30, // rotateSpeed,
......
package robotcontroller.visualGraph; package robotcontroller.visibilityGraph;
import basics.points.Point; import basics.points.Point;
import robotinterface.Robot; import robotinterface.Robot;
......
package robotcontroller.visualGraph; package robotcontroller.visibilityGraph;
import basics.points.Point; import basics.points.Point;
import java.util.Comparator;
import java.util.Optional; import java.util.Optional;
public class AStarNode extends Point implements Comparable<AStarNode> { public class AStarNode extends Point implements Comparable<AStarNode> {
......
package robotcontroller.visualGraph; package robotcontroller.visibilityGraph;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
......
package robotcontroller.visualGraph; package robotcontroller.visibilityGraph;
import basics.points.Point; import basics.points.Point;
import basics.points.util.LinkedPoint; import basics.points.util.LinkedPoint;
......
package robotcontroller; package robotcontroller.visibilityGraph;
import basics.math.Geom; import basics.math.Geom;
import basics.points.Point; import basics.points.Point;
import basics.points.PointCloud2D; import basics.points.PointCloud2D;
import basics.points.PointCloudCreator2D; import basics.points.PointCloudCreator2D;
import basics.points.util.LinkedPoint; import basics.points.util.LinkedPoint;
import robotcontroller.visualGraph.AStar; import robotcontroller.visibilityGraph.AStar;
import robotcontroller.visualGraph.Graph; import robotcontroller.visibilityGraph.Graph;
import robotcontroller.visualGraph.RoutingGraph; import robotcontroller.visibilityGraph.RoutingGraph;
import robotinterface.Robot; import robotinterface.Robot;
import robotinterface.debug.DebugPainterOverlay; import robotinterface.debug.DebugPainterOverlay;
import robotlib.nav.Pos2PosRouting; import robotlib.nav.Pos2PosRouting;
...@@ -19,7 +19,7 @@ import java.util.List; ...@@ -19,7 +19,7 @@ import java.util.List;
import java.util.Optional; import java.util.Optional;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import static robotcontroller.visualGraph.util.*; import static robotcontroller.visibilityGraph.util.*;
/** /**
...@@ -27,7 +27,7 @@ import static robotcontroller.visualGraph.util.*; ...@@ -27,7 +27,7 @@ import static robotcontroller.visualGraph.util.*;
* This navigation only iterates a pre-defined list of positions. * This navigation only iterates a pre-defined list of positions.
* Reasonable approaches must consider the obstacle map and dynamically create a reasonable path through free space. * Reasonable approaches must consider the obstacle map and dynamically create a reasonable path through free space.
*/ */
public class NativeNavP2PRouting extends Pos2PosRouting { public class VGAStarRouting extends Pos2PosRouting {
private final double bufferDistance; private final double bufferDistance;
private final double drivingBuffer; private final double drivingBuffer;
...@@ -38,7 +38,7 @@ public class NativeNavP2PRouting extends Pos2PosRouting { ...@@ -38,7 +38,7 @@ public class NativeNavP2PRouting extends Pos2PosRouting {
private Optional<double[][]> route = Optional.empty(); private Optional<double[][]> route = Optional.empty();
public NativeNavP2PRouting(double bufferDistance, double drivingBuffer) { public VGAStarRouting(double bufferDistance, double drivingBuffer) {
this.bufferDistance = bufferDistance; this.bufferDistance = bufferDistance;
this.drivingBuffer = drivingBuffer; this.drivingBuffer = drivingBuffer;
this.obstacleCloud = new PointCloudCreator2D<>(PointCloudCreator2D.TYPE_GRID, 10.0, 20).createEmpty(); this.obstacleCloud = new PointCloudCreator2D<>(PointCloudCreator2D.TYPE_GRID, 10.0, 20).createEmpty();
......
package robotcontroller.visualGraph; package robotcontroller.visibilityGraph;
import basics.points.Point; import basics.points.Point;
import basics.points.PointCloud2D; import basics.points.PointCloud2D;
......
javac -cp .;jars\Basics.jar;jars\Customsim.jar;jars\Driver.jar;jars\Platform.jar;jars\Robotinterface.jar;jars\Robotlib.jar;jars\Simulator.jar; Robotcontroller\robotcontroller\NativeNavP2PRouting.java Robotcontroller\robotcontroller\NativeNav.java Robotcontroller\robotcontroller\visualGraph\*.java javac -cp .;jars\Basics.jar;jars\Customsim.jar;jars\Driver.jar;jars\Platform.jar;jars\Robotinterface.jar;jars\Robotlib.jar;jars\Simulator.jar; Robotcontroller\robotcontroller\NativeNav.java Robotcontroller\robotcontroller\visibilityGraph\*.java
\ No newline at end of file \ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment