The Pose2D class represents a 2D position and orientation, including x and y coordinates and a heading. It is used to represent the Chassis's position and heading.
| Pose2D Pose2D::interpolate |
( |
Pose2D |
other, |
|
|
double |
fractionThis |
|
) |
| |
Finds a new Pose2D that is a specific fraction of the way between this Pose2D and another. For example, if this Pose2D is x = 1, y = 4, rotation = PI/2, and the other Pose2D is x = 3, y = 3, rotation = PI/6, then interpolating with fractionThis = 1/4 would be x = 2.5, y = 3.25, rotation = PI/4.
- Parameters
-
| other | The Pose2D to interpolate from |
| fractionThis | What fraction (0 to 1) of the way from the other Pose2D to this Pose2D; 1 would just return this Pose2D, and 0 would return the other Pose2D |
- Returns
- The Pose2D that is the specified fraction between this and the other Pose2D