Handling user input

Now consider the case in which a user commands an object to move. Examples include driving a car, flying a spaceship, or walking an avatar around. This introduces some new parameters, called the controls, actions, or inputs to the dynamical system. Differential equations that include these new parameters are called control systems [14].

Let $ u = (u_1,u_2,\ldots,u_m)$ be a vector of controls. The state transition equation in (8.26) is simply extended to include $ u$:

$\displaystyle {\dot x}= f(x,u) .$ (8.29)

Figure 8.9: A top-down view of a simple, steerable car. Its position and orientation are given by $ (x,y,\theta )$. The parameter $ \rho $ is the minimum turning radius, which depends on the maximum allowable steering angle $ \phi $. This model can also be used to ``steer'' human avatars, by placing the viewpoint above the center of the rear axle.

Figure 8.9 shows a useful example, which involves driving a car. The control $ u_s$ determines the speed of the car. For example, $ u_s = 1$ drives forward, and $ u_s=-1$ drives in reverse. Setting $ u_s = 10$ drives forward at a much faster rate. The control $ u_\phi$ determines how the front wheels are steered. The state vector is $ (x,z,\theta)$, which corresponds to the position and orientation of the car in the horizontal, $ xz$ plane.

The state transition equation is:

\begin{displaymath}\begin{split}{\dot x}& = u_s \cos\theta  {\dot z}& = u_s \s...
...& = \displaystyle\strut {u_s \over L} \tan u_\phi . \end{split}\end{displaymath} (8.30)

Using Runge-Kutta integration, or a similar numerical method, the future states can be calculated for the car, given that controls $ u_s$ and $ u_\phi$ are applied over time.

This model can also be used to steer the virtual walking of a VR user from first-person perspective. The viewpoint then changes according to $ (x,z,\theta)$, while the height $ y$ remains fixed. For the model in (8.30), the car must drive forward or backward to change its orientation. By changing the third component to $ \theta = u_\omega$, the user could instead specify the angular velocity directly. This would cause the user to rotate in place, as if on a merry-go-round. Many more examples like these appear in Chapter 13 of [165], including bodies that are controlled via accelerations.

It is sometimes helpful conceptually to define the motions in terms of discrete points in time, called stages. Using numerical integration of (8.29), we can think about applying a control $ u$ over time $ \Delta t$ to obtain a new state $ x[k+1]$:

$\displaystyle x[k+1] = F(x[k],u[k]) .$ (8.31)

The function $ F$ is obtained by integrating (8.29) over $ \Delta t$. Thus, if the state is $ x[k]$, and $ u[k]$ is applied, then $ F$ calculates $ x[k+1]$ as the state at the next stage.

Steven M LaValle 2020-01-06