One thing to take away from this is that we often

do not have direct access to the state of the robot.

We cannot tell the robot directly to go

to a specific position in x and y.

We can however, devise a sequence of control inputs,

u sub n that will allow us to reach said

xy position according to the kinematic equations.

The sequence of control inputs will

correspond to a trajectory that the robot will follow.

Now that we've seen an example of

some kinematic equations, you might be asking,

"How do we actually calculate

a trajectory for a given sequence of inputs?"

The kinematic equations we've given

you essentially amount to

a system of continuous time differential equations.

For trajectory generation purposes,

we'll be focusing on the discrete analog of

these equations as discussed in course one.

By focusing on the discrete model,

it allows us to easily and efficiently propagate

trajectories for a given sequence of control inputs.

Many methods exist for discretizing

continuous time differential equations and we use

a simple zero-order hold here and have provided you

with additional resources in

the supplemental materials if you'd like to see more.

A consequence of the discretization

of these equations is that we can

implement the sum over all of

the updates in the sequence recursively,

which allows us to build up

the full trajectory iteratively

for a given sequence of inputs.

This saves in computational effort

because rather than recomputing

a sum over all previous updates

for each point in the trajectory,

we can incrementally compute the next point of

the trajectory using only the previously computed point.

This is shown as the final right-hand side

for each of the state variable equations.

We will be using this recursive solution

throughout this module.

If we now apply this discretization and

step through an entire control input sequence,

we will get an accurate approximation

of the trajectory that the robot will follow.

While this is useful for trajectory planning,

it is also useful for motion prediction,

where we know a kinematic model of

a different agent in the driving scenario

and we have an educated guess

on the control inputs they will take.

From this, we can estimate

their future trajectory which can help us

plan our motion to avoid collisions.

As an example, suppose we take

a constant velocity input as well as

a constant steering angle to our bicycle model.

As shown here in the animation,

this results in the robot traversing the arc with

constant speed while it's heading

slowly changes with each time step.

If we instead vary the steering angle

along the path according to some steering function,

we can perform more complex maneuvers,

which are critical for such tasks as obstacle avoidance.

This is essentially the crux

of the local planning problem,

calculating the required control inputs

to safely navigate to a given goal point.

In the animation, we can see that driving with

a constant steering angle as we did

before would result in a collision.

To remedy this, we have given the robot a sequence of

different steering angle inputs

in order to avoid the obstacle.

We're now ready to start planning paths

through environments with obstacles.

In this video, we reviewed the difference between

kinematic and dynamic models as

well as the bicycle model

that we introduced in course one.

From there, we discussed how to

compute trajectories for a given model

and set of control inputs using

our trajectory propagation algorithm.

This algorithm will come in handy when we develop

the rest of our motion planner in this module.

Hopefully, this video has given you

some insight on how to take

a robot's kinematic model and generate

a trajectory for it given arbitrary inputs.

In our next video,

we will discuss some efficient collision checking

methods that we can use

when evaluating different plan paths

for safety. See you there.