Java Reference
In-Depth Information
environment. It maintains the list of obstacles and implements the methods
to load their description from the XML input file.
package moro;
import java.util.*;
import java.awt.*;
public class Environment extends JPanel {
ArrayList obstacles # new ArrayList();
Robot robot;
// Construct the application
public Environment() {
robot # new Robot(50, 350, 270, this );
public boolean loadMap(File mapFile) {}
public void paintComponent(Graphics g) {}
The test case consists in the visualization of the operational environment in
the graphical user interface (see Figure 10.12). The test should verify the
correct correspondence between the XML description and the geometric
representation of the simulated environment and the correct positioning of
the robot in the environment.
Prototype 2: Dynamic behaviour
The second prototype deals with the dynamic behaviour of the robot's
In Section 10.2 we described the robot system as a slave component that
offers mobility and sensing services to the remote controller. We identify the
onboard controller with class Robot . The robot receives commands from the
remote controller and delegates their execution to the appropriate devices.
The laser and the mobile platform execute their tasks autonomously. The
remote controller might request the execution of a sequence of commands,
such as translation and rotation commands to move the robot along a
complex path. Thus, the robot's devices should maintain a list of commands
and execute them one at a time.
In the previous chapter we saw an example of a discrete event dynamic
system. The event-based model is well suited to the simulation of the work
Search WWH ::

Custom Search