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);
}
Aggregations