Graphical State Space Programming (GSSP) Tutorials
Home -> GSSP Tutorials -> Section 2.4 Waypoints

Section 2.4 Waypoints

Waypoints are another basic building block of GSSP. When programming robots we often want to give a sequence of commands like the following.

  1. Go to an (X,Y) position of (15,15) and take a picture
  2. Rise to an altitude of 30 m and blink light
  3. Increase speed to 6 m/s and then start recording video

Notice that in each step of this sequence of commands, we want the robot to first affect some writable state-variable to some specific value, and then perform an action. Another way to put this is, in each step, we want the robot to go to some position in the state space, and then perform some action.

In GSSP, we use a waypoint to graphically represent a position in the state space. Consider the Speed-Altitude plane in the following figure.

There are three waypoints in the figure. The lines joining them indicate that they are of the same waypoint set. Each waypoint in a waypoint set is given a number, which indicates the order of the waypoints. If we tell the robot to execute this set of waypoints, then the robot will first affect its Altitude to 10 m and Speed to 10 m/s, and then affect its Altitude to 30 m and Speed to 20 m/s, and then affect its Altitude to 20 m and Speed to 40 m/s.

We can attach code to each waypoint so that whenever the robot reaches a waypoint, the corresponding code is executed. This allows us to write programs like the example at the beginning of this section.

Waypoints can be multi-dimensional, just like regions. The waypoints in the figure are two-dimensional because their positions are specified using two state-variables. The number of dimensions of a waypoint can also range from zero to any positive integer. Waypoints differ from regions in that waypoints can only be created for writable state-variables, whereas regions can be created for any state-variable.