Search in sources :

Example 1 with SVGGroupParser

use of aima.core.util.math.geom.SVGGroupParser in project aima-java by aimacode.

the class SVGGroupParserTest method setUp.

@Before
public void setUp() {
    testGroup = new ArrayList<IGeometric2D>();
    testGroup.ensureCapacity(10);
    testGroup.add(new Polyline2D(testVertices1, true));
    testGroup.add(new Line2D(15.0d, 15.0d, 200.0d, 100.0d));
    testGroup.add(new Ellipse2D(new Point2D(300.0d, 80.0d), 60.0d, 40.0d));
    testGroup.add(new Circle2D(new Point2D(180.0d, 160.0d), 20.0d));
    testGroup.add(new Rect2D(161.0d, 200.0d, 261.0d, 250.0d));
    testGroup.add(new Polyline2D(testVertices2, true));
    testGroup.add(new Line2D(0.0d, 0.0d, 700.0d, 0.0d));
    testGroup.add(new Line2D(700.0d, 0.0d, 700.0d, 500.0d));
    testGroup.add(new Line2D(700.0d, 500.0d, 0.0d, 500.0d));
    testGroup.add(new Line2D(0.0d, 500.0d, 0.0d, 0.0d));
    testParser = new SVGGroupParser();
}
Also used : IGeometric2D(aima.core.util.math.geom.shapes.IGeometric2D) Polyline2D(aima.core.util.math.geom.shapes.Polyline2D) Point2D(aima.core.util.math.geom.shapes.Point2D) Circle2D(aima.core.util.math.geom.shapes.Circle2D) SVGGroupParser(aima.core.util.math.geom.SVGGroupParser) Line2D(aima.core.util.math.geom.shapes.Line2D) Rect2D(aima.core.util.math.geom.shapes.Rect2D) Ellipse2D(aima.core.util.math.geom.shapes.Ellipse2D) Before(org.junit.Before)

Example 2 with SVGGroupParser

use of aima.core.util.math.geom.SVGGroupParser in project aima-java by aimacode.

the class MonteCarloLocalizationApp method initialize.

/**
	 * Creates a {@link GenericMonteCarloLocalization2DApp} and stores it in {@code app}.<br/>
	 * In addition the corresponding {@link IRobotGui} is created and stored in {@code robotGui}. The function {@code robotGui.destructRobot()} will be called when the application window closes to allow closing any open connections gracefully.
	 */
protected void initialize() {
    SimpleSettingsListener settingsListener = new SimpleSettingsListener(settingsGui);
    settingsListener.createSettings();
    AnglePanel angles = new AnglePanel(RANGE_READING_ANGLES_TITLE);
    settingsGui.registerSpecialSetting(RANGE_READING_ANGLES_KEY, angles);
    MclCartesianPlot2D<SimplePose, SimpleMove, AbstractRangeReading> map = new MclCartesianPlot2D<SimplePose, SimpleMove, AbstractRangeReading>(new SVGGroupParser(), new SVGGroupParser(), new SimplePoseFactory(), new SimpleRangeReadingFactory());
    VirtualRobot robot = new VirtualRobot(map);
    robotGui = new VirtualRobotGui(robot);
    MonteCarloLocalization<SimplePose, Angle, SimpleMove, AbstractRangeReading> mcl = new MonteCarloLocalization<SimplePose, Angle, SimpleMove, AbstractRangeReading>(map, new JavaRandomizer());
    app = new GenericMonteCarloLocalization2DApp<SimplePose, SimpleMove, SimpleRangeReading>(mcl, map, robot, robotGui, settingsGui);
    angles.setChangeListener((ChangeListener) robotGui);
    settingsListener.setMap(map);
    settingsListener.setMcl(mcl);
    settingsListener.setRobot(robot);
}
Also used : SimpleRangeReadingFactory(aima.gui.swing.applications.robotics.simple.SimpleRangeReadingFactory) VirtualRobotGui(aima.gui.swing.applications.robotics.simple.VirtualRobotGui) VirtualRobot(aima.gui.swing.applications.robotics.simple.VirtualRobot) AnglePanel(aima.gui.swing.applications.robotics.components.AnglePanel) SimplePoseFactory(aima.gui.swing.applications.robotics.simple.SimplePoseFactory) JavaRandomizer(aima.core.util.JavaRandomizer) SVGGroupParser(aima.core.util.math.geom.SVGGroupParser) SimpleSettingsListener(aima.gui.swing.applications.robotics.simple.SimpleSettingsListener) SimpleRangeReading(aima.gui.swing.applications.robotics.simple.SimpleRangeReading) Angle(aima.core.robotics.impl.datatypes.Angle) SimplePose(aima.gui.swing.applications.robotics.simple.SimplePose) AbstractRangeReading(aima.core.robotics.impl.datatypes.AbstractRangeReading) MclCartesianPlot2D(aima.core.robotics.impl.map.MclCartesianPlot2D) SimpleMove(aima.gui.swing.applications.robotics.simple.SimpleMove) MonteCarloLocalization(aima.core.robotics.MonteCarloLocalization)

Aggregations

SVGGroupParser (aima.core.util.math.geom.SVGGroupParser)2 MonteCarloLocalization (aima.core.robotics.MonteCarloLocalization)1 AbstractRangeReading (aima.core.robotics.impl.datatypes.AbstractRangeReading)1 Angle (aima.core.robotics.impl.datatypes.Angle)1 MclCartesianPlot2D (aima.core.robotics.impl.map.MclCartesianPlot2D)1 JavaRandomizer (aima.core.util.JavaRandomizer)1 Circle2D (aima.core.util.math.geom.shapes.Circle2D)1 Ellipse2D (aima.core.util.math.geom.shapes.Ellipse2D)1 IGeometric2D (aima.core.util.math.geom.shapes.IGeometric2D)1 Line2D (aima.core.util.math.geom.shapes.Line2D)1 Point2D (aima.core.util.math.geom.shapes.Point2D)1 Polyline2D (aima.core.util.math.geom.shapes.Polyline2D)1 Rect2D (aima.core.util.math.geom.shapes.Rect2D)1 AnglePanel (aima.gui.swing.applications.robotics.components.AnglePanel)1 SimpleMove (aima.gui.swing.applications.robotics.simple.SimpleMove)1 SimplePose (aima.gui.swing.applications.robotics.simple.SimplePose)1 SimplePoseFactory (aima.gui.swing.applications.robotics.simple.SimplePoseFactory)1 SimpleRangeReading (aima.gui.swing.applications.robotics.simple.SimpleRangeReading)1 SimpleRangeReadingFactory (aima.gui.swing.applications.robotics.simple.SimpleRangeReadingFactory)1 SimpleSettingsListener (aima.gui.swing.applications.robotics.simple.SimpleSettingsListener)1