Search in sources :

Example 1 with SimpleSettingsListener

use of aima.gui.swing.applications.robotics.simple.SimpleSettingsListener 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

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 SVGGroupParser (aima.core.util.math.geom.SVGGroupParser)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 VirtualRobot (aima.gui.swing.applications.robotics.simple.VirtualRobot)1 VirtualRobotGui (aima.gui.swing.applications.robotics.simple.VirtualRobotGui)1