Package Summary
Tags | No category tags. |
Version | 1.1.0 |
License | Apache License 2.0 |
Build type | AMENT_CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/autowarefoundation/autoware_core.git |
VCS Type | git |
VCS Version | main |
Last Updated | 2025-06-12 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | UNRELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Yukinari Hisaki
- Takayuki Murooka
- Kosuke Takeuchi
- Mamoru Sobue
Authors
- Yukinari Hisaki
Autoware Trajectory
This package provides classes to manage/manipulate Trajectory.
Overview
Interpolators
The interpolator class interpolates given bases
and values
. Following interpolators are implemented.
- Linear
- AkimaSpline
- CubicSpline
- NearestNeighbor
- Stairstep
The builder internally executes interpolation and return the result in the form of expected<T, E>
. If successful, it contains the interpolator object.
```cpp title=”./examples/example_readme.cpp:53:68” –8<– common/autoware_trajectory/examples/example_readme.cpp:53:68 –8<–
Otherwise it contains the error object representing the failure reason. In the below snippet, cubic spline interpolation fails because the number of input points is 3, which is below the `minimum_required_points() = 4` of `CubicSpline`.
```cpp title="./examples/example_readme.cpp:109:119"
--8<--
common/autoware_trajectory/examples/example_readme.cpp:109:119
--8<--
In such cases the result expected
object contains InterpolationFailure
type with an error message like “base size 3 is less than minimum required 4”.
Trajectory class
The Trajectory class provides mathematical continuous representation and object oriented interface for discrete array of following point types
-
geometry_msgs::Point
-
geometry_msgs::Pose
-
autoware_planning_msgs::PathPoint
-
autoware_planning_msgs::PathPointWithLaneId
-
autoware_planning_msgs::TrajectoryPoint
by interpolating the given underlying points. Once built, arbitrary point on the curve is continuously parametrized by a single s
coordinate.
```cpp title=”./examples/example_readme.cpp:549:561” –8<– common/autoware_trajectory/examples/example_readme.cpp:549:561 –8<–

[View in Drawio]({{ drawio("/common/autoware_trajectory/images/overview/trajectory.drawio.svg") }})
## Nomenclature
This section introduces strict definition of several words used in this package to clarify the description of API and help the developers understand and grasp the geometric meaning of algorithms.
| Word | Meaning | Illustration |
| --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `curve` | `curve` is an oriented bounded curve denoted as `(x(s), y(s), z(s))` with additional properties, parameterized by `s` (`s = 0` at the start). | <br>[View in Drawio]({{ drawio("/common/autoware_trajectory/images/nomenclature/curve.drawio.svg") }})<br>There are 5 `underlying` points<br>$\mathrm{P0} = (0, 0, 0)$<br>$\mathrm{P1} = (1/ \sqrt{2}, 1/ \sqrt{2}, 0)$<br>$\mathrm{P2} = (1/ \sqrt{2}, 1+1/ \sqrt{2}, 0)$<br>$\mathrm{P3} = (2/ \sqrt{2}, 1+2/ \sqrt{2}, 0)$<br>$\mathrm{P4} = (2/ \sqrt{2} + 1/ \sqrt{6}, 1+2/ \sqrt{2} + 1 / \sqrt{3}, 1 / \sqrt{2})$<br>and the `arc length` between each interval is $1, 2, 1, 1$ respectively, so $\mathrm{start} = 0$ and $\mathrm{end} = 5$. |
| `underlying` | `underlying` points of a curve refers to the list of 3D points from which the curve was interpolated. | |
| `arc length`[m] | `arc length` denotes the approximate **3D** length of of a curve and is computed based on the discrete `underlying` points. | |
| `s`[m] | `s` denotes the **3D** `arc length` coordinate starting from the base point (mostly the start point) of the curve and a point is identified by `trajectory(s)`.<br>Due to this definition, the actual _curve length_ and `arc length` have subtle difference as illustrated. | <br>[View in Drawio]({{ drawio("/common/autoware_trajectory/images/nomenclature/approximation.drawio.svg") }})<br>The point for $s = 0.5$ is the purple dot, but the _curve length_ from $\mathrm{P0}$ to this point does not equal to $0.5$.<br>The exact _curve length_ is $\int \sqrt{(\frac{dx}{dt})^2 + (\frac{dy}{dt})^2 + (\frac{dz}{dt})^2} dt$, which cannot be obtained in an analytical closed form. |
| `curvature` | `curvature` is computed **using only X-Y 2D coordinate**. This is based on the normal and natural assumption that _roads are flat_. Mathematically, it asserts that [Gaussian curvature](https://en.wikipedia.org/wiki/Gaussian_curvature) of road is uniformly 0.<br>The sign of curvature is positive if the center of turning circle is on the left side, otherwise negative. | <br>[View in Drawio]({{ drawio("/common/autoware_trajectory/images/nomenclature/curvature.drawio.svg") }}) |
| `k_points_minimum_dist_threshold` | This is a constant threshold that is used to check if two points or values are same and to avoid zero division. | |
| `almost-same` | The pair of two points $P_{1}$ and $P_{2}$, or the pair of two base values $s_{1}$ and $s_{2}$ are called `almost-same` if their distance or difference are less than `k_points_minimum_dist_threshold` | |
## API
### Interpolators
| Class | method/function | description |
| ---------------- | ----------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| Common Functions | `minimum_required_points()` | return the number of points required for each concrete interpolator |
| | `compute(double s) -> T` | compute the interpolated value at given base $s$. $s$ is clamped to the underlying base range. |
| | `compute(vector<double> s) -> vector<T>` | compute the interpolated values at for each base values in $s$. |
| | `compute_first_derivative(double s) -> double` | compute the first derivative of at given base $s$. $s$ is clamped. |
| | `compute_second_derivative(double s) -> double` | compute the second derivative of at given base $s$. $s$ is clamped. |
`AkimaSpline` requires at least **5** points to interpolate.
```cpp title="./examples/example_readme.cpp:142:152"
--8<--
common/autoware_trajectory/examples/example_readme.cpp:142:152
--8<--
CubicSpline
requires at least 4 points to interpolate.
```cpp title=”./examples/example_readme.cpp:192:201” –8<– common/autoware_trajectory/examples/example_readme.cpp:192:201
File truncated at 100 lines see the full file
Changelog for package autoware_trajectory
1.1.0 (2025-05-01)
-
fix(autoware_trajectory): avoid nan in align_orientation_with_trajectory_direction (#398)
- fix(autoware_trajectory): avoid nan in align_orientation_with_trajectory_direction
- tidy
* remove eps ---------
-
chore(autoware_trajectory): relax the warning condition of boundary check (#393)
- chore(autoware_trajectory): relax the warning condition of boundary check
* tidy
-
feat(trajectory): define distance threshold and refine restore() without API breakage(in experimental) (#376)
- feat(trajectory): define distance threshold and refine restore
* fix spell ---------
-
feat(autoware_trajectory): add get_contained_lane_ids function (#369)
- add get_contained_lane_ids
- add unit test
* remove assert ---------
-
feat(trajectory): add pretty_build() function for Planning/Control component node (#332)
-
refactor(autoware_trajectory)!: move everything to namespace experimetal (#371) refactor(autoware_trajectory)!: move everything to namespace experimental
-
feat(trajectory): improve shift function and their documents (#337)
- feat(trajectory): add populate function
- update curvature figure for approximation desc
- update align_orientation_with_trajectory_direction fig
- finished trajectory classes
- refactored shift
- add comment
* update error message ---------
-
fix(autoware_trajectory): fix base_addition callback to work when Trajectory is moved (#370)
-
fix(autoware_trajectory): check vector size check before accessing (#365)
- fix(autoware_trajectory): check vector size check before accessing
- update
* minor fix ---------Co-authored-by: Mamoru Sobue <<hilo.soblin@gmail.com>>
-
feat(autoware_trajectory): improve performance of get_underlying_base (#298)
-
feat(trajectory): add API documentation for trajectory class, add some utillity (#295)
-
feat(trajectory): add API description, nomenclature, illustration, rename functions to align with nomenclature (#292)
- feat(trajectory): add API description, nomenclature, illustration, rename functions to align with nomenclature
* resurrect get_internal_base ---------
-
chore: include iostream and link yaml-cpp for Jazzy (#351)
-
Contributors: Mamoru Sobue, Tim Clephas, Yukinari Hisaki
1.0.0 (2025-03-31)
- feat(trajectory): remove default ctor and collect default setting in
File truncated at 100 lines see the full file
Wiki Tutorials
Package Dependencies
System Dependencies
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged autoware_trajectory at Robotics Stack Exchange
Package Summary
Tags | No category tags. |
Version | 1.1.0 |
License | Apache License 2.0 |
Build type | AMENT_CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/autowarefoundation/autoware_core.git |
VCS Type | git |
VCS Version | main |
Last Updated | 2025-06-12 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | UNRELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Yukinari Hisaki
- Takayuki Murooka
- Kosuke Takeuchi
- Mamoru Sobue
Authors
- Yukinari Hisaki
Autoware Trajectory
This package provides classes to manage/manipulate Trajectory.
Overview
Interpolators
The interpolator class interpolates given bases
and values
. Following interpolators are implemented.
- Linear
- AkimaSpline
- CubicSpline
- NearestNeighbor
- Stairstep
The builder internally executes interpolation and return the result in the form of expected<T, E>
. If successful, it contains the interpolator object.
```cpp title=”./examples/example_readme.cpp:53:68” –8<– common/autoware_trajectory/examples/example_readme.cpp:53:68 –8<–
Otherwise it contains the error object representing the failure reason. In the below snippet, cubic spline interpolation fails because the number of input points is 3, which is below the `minimum_required_points() = 4` of `CubicSpline`.
```cpp title="./examples/example_readme.cpp:109:119"
--8<--
common/autoware_trajectory/examples/example_readme.cpp:109:119
--8<--
In such cases the result expected
object contains InterpolationFailure
type with an error message like “base size 3 is less than minimum required 4”.
Trajectory class
The Trajectory class provides mathematical continuous representation and object oriented interface for discrete array of following point types
-
geometry_msgs::Point
-
geometry_msgs::Pose
-
autoware_planning_msgs::PathPoint
-
autoware_planning_msgs::PathPointWithLaneId
-
autoware_planning_msgs::TrajectoryPoint
by interpolating the given underlying points. Once built, arbitrary point on the curve is continuously parametrized by a single s
coordinate.
```cpp title=”./examples/example_readme.cpp:549:561” –8<– common/autoware_trajectory/examples/example_readme.cpp:549:561 –8<–

[View in Drawio]({{ drawio("/common/autoware_trajectory/images/overview/trajectory.drawio.svg") }})
## Nomenclature
This section introduces strict definition of several words used in this package to clarify the description of API and help the developers understand and grasp the geometric meaning of algorithms.
| Word | Meaning | Illustration |
| --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `curve` | `curve` is an oriented bounded curve denoted as `(x(s), y(s), z(s))` with additional properties, parameterized by `s` (`s = 0` at the start). | <br>[View in Drawio]({{ drawio("/common/autoware_trajectory/images/nomenclature/curve.drawio.svg") }})<br>There are 5 `underlying` points<br>$\mathrm{P0} = (0, 0, 0)$<br>$\mathrm{P1} = (1/ \sqrt{2}, 1/ \sqrt{2}, 0)$<br>$\mathrm{P2} = (1/ \sqrt{2}, 1+1/ \sqrt{2}, 0)$<br>$\mathrm{P3} = (2/ \sqrt{2}, 1+2/ \sqrt{2}, 0)$<br>$\mathrm{P4} = (2/ \sqrt{2} + 1/ \sqrt{6}, 1+2/ \sqrt{2} + 1 / \sqrt{3}, 1 / \sqrt{2})$<br>and the `arc length` between each interval is $1, 2, 1, 1$ respectively, so $\mathrm{start} = 0$ and $\mathrm{end} = 5$. |
| `underlying` | `underlying` points of a curve refers to the list of 3D points from which the curve was interpolated. | |
| `arc length`[m] | `arc length` denotes the approximate **3D** length of of a curve and is computed based on the discrete `underlying` points. | |
| `s`[m] | `s` denotes the **3D** `arc length` coordinate starting from the base point (mostly the start point) of the curve and a point is identified by `trajectory(s)`.<br>Due to this definition, the actual _curve length_ and `arc length` have subtle difference as illustrated. | <br>[View in Drawio]({{ drawio("/common/autoware_trajectory/images/nomenclature/approximation.drawio.svg") }})<br>The point for $s = 0.5$ is the purple dot, but the _curve length_ from $\mathrm{P0}$ to this point does not equal to $0.5$.<br>The exact _curve length_ is $\int \sqrt{(\frac{dx}{dt})^2 + (\frac{dy}{dt})^2 + (\frac{dz}{dt})^2} dt$, which cannot be obtained in an analytical closed form. |
| `curvature` | `curvature` is computed **using only X-Y 2D coordinate**. This is based on the normal and natural assumption that _roads are flat_. Mathematically, it asserts that [Gaussian curvature](https://en.wikipedia.org/wiki/Gaussian_curvature) of road is uniformly 0.<br>The sign of curvature is positive if the center of turning circle is on the left side, otherwise negative. | <br>[View in Drawio]({{ drawio("/common/autoware_trajectory/images/nomenclature/curvature.drawio.svg") }}) |
| `k_points_minimum_dist_threshold` | This is a constant threshold that is used to check if two points or values are same and to avoid zero division. | |
| `almost-same` | The pair of two points $P_{1}$ and $P_{2}$, or the pair of two base values $s_{1}$ and $s_{2}$ are called `almost-same` if their distance or difference are less than `k_points_minimum_dist_threshold` | |
## API
### Interpolators
| Class | method/function | description |
| ---------------- | ----------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| Common Functions | `minimum_required_points()` | return the number of points required for each concrete interpolator |
| | `compute(double s) -> T` | compute the interpolated value at given base $s$. $s$ is clamped to the underlying base range. |
| | `compute(vector<double> s) -> vector<T>` | compute the interpolated values at for each base values in $s$. |
| | `compute_first_derivative(double s) -> double` | compute the first derivative of at given base $s$. $s$ is clamped. |
| | `compute_second_derivative(double s) -> double` | compute the second derivative of at given base $s$. $s$ is clamped. |
`AkimaSpline` requires at least **5** points to interpolate.
```cpp title="./examples/example_readme.cpp:142:152"
--8<--
common/autoware_trajectory/examples/example_readme.cpp:142:152
--8<--
CubicSpline
requires at least 4 points to interpolate.
```cpp title=”./examples/example_readme.cpp:192:201” –8<– common/autoware_trajectory/examples/example_readme.cpp:192:201
File truncated at 100 lines see the full file
Changelog for package autoware_trajectory
1.1.0 (2025-05-01)
-
fix(autoware_trajectory): avoid nan in align_orientation_with_trajectory_direction (#398)
- fix(autoware_trajectory): avoid nan in align_orientation_with_trajectory_direction
- tidy
* remove eps ---------
-
chore(autoware_trajectory): relax the warning condition of boundary check (#393)
- chore(autoware_trajectory): relax the warning condition of boundary check
* tidy
-
feat(trajectory): define distance threshold and refine restore() without API breakage(in experimental) (#376)
- feat(trajectory): define distance threshold and refine restore
* fix spell ---------
-
feat(autoware_trajectory): add get_contained_lane_ids function (#369)
- add get_contained_lane_ids
- add unit test
* remove assert ---------
-
feat(trajectory): add pretty_build() function for Planning/Control component node (#332)
-
refactor(autoware_trajectory)!: move everything to namespace experimetal (#371) refactor(autoware_trajectory)!: move everything to namespace experimental
-
feat(trajectory): improve shift function and their documents (#337)
- feat(trajectory): add populate function
- update curvature figure for approximation desc
- update align_orientation_with_trajectory_direction fig
- finished trajectory classes
- refactored shift
- add comment
* update error message ---------
-
fix(autoware_trajectory): fix base_addition callback to work when Trajectory is moved (#370)
-
fix(autoware_trajectory): check vector size check before accessing (#365)
- fix(autoware_trajectory): check vector size check before accessing
- update
* minor fix ---------Co-authored-by: Mamoru Sobue <<hilo.soblin@gmail.com>>
-
feat(autoware_trajectory): improve performance of get_underlying_base (#298)
-
feat(trajectory): add API documentation for trajectory class, add some utillity (#295)
-
feat(trajectory): add API description, nomenclature, illustration, rename functions to align with nomenclature (#292)
- feat(trajectory): add API description, nomenclature, illustration, rename functions to align with nomenclature
* resurrect get_internal_base ---------
-
chore: include iostream and link yaml-cpp for Jazzy (#351)
-
Contributors: Mamoru Sobue, Tim Clephas, Yukinari Hisaki
1.0.0 (2025-03-31)
- feat(trajectory): remove default ctor and collect default setting in
File truncated at 100 lines see the full file
Wiki Tutorials
Package Dependencies
System Dependencies
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged autoware_trajectory at Robotics Stack Exchange
Package Summary
Tags | No category tags. |
Version | 1.1.0 |
License | Apache License 2.0 |
Build type | AMENT_CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/autowarefoundation/autoware_core.git |
VCS Type | git |
VCS Version | main |
Last Updated | 2025-06-12 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | UNRELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Yukinari Hisaki
- Takayuki Murooka
- Kosuke Takeuchi
- Mamoru Sobue
Authors
- Yukinari Hisaki
Autoware Trajectory
This package provides classes to manage/manipulate Trajectory.
Overview
Interpolators
The interpolator class interpolates given bases
and values
. Following interpolators are implemented.
- Linear
- AkimaSpline
- CubicSpline
- NearestNeighbor
- Stairstep
The builder internally executes interpolation and return the result in the form of expected<T, E>
. If successful, it contains the interpolator object.
```cpp title=”./examples/example_readme.cpp:53:68” –8<– common/autoware_trajectory/examples/example_readme.cpp:53:68 –8<–
Otherwise it contains the error object representing the failure reason. In the below snippet, cubic spline interpolation fails because the number of input points is 3, which is below the `minimum_required_points() = 4` of `CubicSpline`.
```cpp title="./examples/example_readme.cpp:109:119"
--8<--
common/autoware_trajectory/examples/example_readme.cpp:109:119
--8<--
In such cases the result expected
object contains InterpolationFailure
type with an error message like “base size 3 is less than minimum required 4”.
Trajectory class
The Trajectory class provides mathematical continuous representation and object oriented interface for discrete array of following point types
-
geometry_msgs::Point
-
geometry_msgs::Pose
-
autoware_planning_msgs::PathPoint
-
autoware_planning_msgs::PathPointWithLaneId
-
autoware_planning_msgs::TrajectoryPoint
by interpolating the given underlying points. Once built, arbitrary point on the curve is continuously parametrized by a single s
coordinate.
```cpp title=”./examples/example_readme.cpp:549:561” –8<– common/autoware_trajectory/examples/example_readme.cpp:549:561 –8<–

[View in Drawio]({{ drawio("/common/autoware_trajectory/images/overview/trajectory.drawio.svg") }})
## Nomenclature
This section introduces strict definition of several words used in this package to clarify the description of API and help the developers understand and grasp the geometric meaning of algorithms.
| Word | Meaning | Illustration |
| --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `curve` | `curve` is an oriented bounded curve denoted as `(x(s), y(s), z(s))` with additional properties, parameterized by `s` (`s = 0` at the start). | <br>[View in Drawio]({{ drawio("/common/autoware_trajectory/images/nomenclature/curve.drawio.svg") }})<br>There are 5 `underlying` points<br>$\mathrm{P0} = (0, 0, 0)$<br>$\mathrm{P1} = (1/ \sqrt{2}, 1/ \sqrt{2}, 0)$<br>$\mathrm{P2} = (1/ \sqrt{2}, 1+1/ \sqrt{2}, 0)$<br>$\mathrm{P3} = (2/ \sqrt{2}, 1+2/ \sqrt{2}, 0)$<br>$\mathrm{P4} = (2/ \sqrt{2} + 1/ \sqrt{6}, 1+2/ \sqrt{2} + 1 / \sqrt{3}, 1 / \sqrt{2})$<br>and the `arc length` between each interval is $1, 2, 1, 1$ respectively, so $\mathrm{start} = 0$ and $\mathrm{end} = 5$. |
| `underlying` | `underlying` points of a curve refers to the list of 3D points from which the curve was interpolated. | |
| `arc length`[m] | `arc length` denotes the approximate **3D** length of of a curve and is computed based on the discrete `underlying` points. | |
| `s`[m] | `s` denotes the **3D** `arc length` coordinate starting from the base point (mostly the start point) of the curve and a point is identified by `trajectory(s)`.<br>Due to this definition, the actual _curve length_ and `arc length` have subtle difference as illustrated. | <br>[View in Drawio]({{ drawio("/common/autoware_trajectory/images/nomenclature/approximation.drawio.svg") }})<br>The point for $s = 0.5$ is the purple dot, but the _curve length_ from $\mathrm{P0}$ to this point does not equal to $0.5$.<br>The exact _curve length_ is $\int \sqrt{(\frac{dx}{dt})^2 + (\frac{dy}{dt})^2 + (\frac{dz}{dt})^2} dt$, which cannot be obtained in an analytical closed form. |
| `curvature` | `curvature` is computed **using only X-Y 2D coordinate**. This is based on the normal and natural assumption that _roads are flat_. Mathematically, it asserts that [Gaussian curvature](https://en.wikipedia.org/wiki/Gaussian_curvature) of road is uniformly 0.<br>The sign of curvature is positive if the center of turning circle is on the left side, otherwise negative. | <br>[View in Drawio]({{ drawio("/common/autoware_trajectory/images/nomenclature/curvature.drawio.svg") }}) |
| `k_points_minimum_dist_threshold` | This is a constant threshold that is used to check if two points or values are same and to avoid zero division. | |
| `almost-same` | The pair of two points $P_{1}$ and $P_{2}$, or the pair of two base values $s_{1}$ and $s_{2}$ are called `almost-same` if their distance or difference are less than `k_points_minimum_dist_threshold` | |
## API
### Interpolators
| Class | method/function | description |
| ---------------- | ----------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| Common Functions | `minimum_required_points()` | return the number of points required for each concrete interpolator |
| | `compute(double s) -> T` | compute the interpolated value at given base $s$. $s$ is clamped to the underlying base range. |
| | `compute(vector<double> s) -> vector<T>` | compute the interpolated values at for each base values in $s$. |
| | `compute_first_derivative(double s) -> double` | compute the first derivative of at given base $s$. $s$ is clamped. |
| | `compute_second_derivative(double s) -> double` | compute the second derivative of at given base $s$. $s$ is clamped. |
`AkimaSpline` requires at least **5** points to interpolate.
```cpp title="./examples/example_readme.cpp:142:152"
--8<--
common/autoware_trajectory/examples/example_readme.cpp:142:152
--8<--
CubicSpline
requires at least 4 points to interpolate.
```cpp title=”./examples/example_readme.cpp:192:201” –8<– common/autoware_trajectory/examples/example_readme.cpp:192:201
File truncated at 100 lines see the full file
Changelog for package autoware_trajectory
1.1.0 (2025-05-01)
-
fix(autoware_trajectory): avoid nan in align_orientation_with_trajectory_direction (#398)
- fix(autoware_trajectory): avoid nan in align_orientation_with_trajectory_direction
- tidy
* remove eps ---------
-
chore(autoware_trajectory): relax the warning condition of boundary check (#393)
- chore(autoware_trajectory): relax the warning condition of boundary check
* tidy
-
feat(trajectory): define distance threshold and refine restore() without API breakage(in experimental) (#376)
- feat(trajectory): define distance threshold and refine restore
* fix spell ---------
-
feat(autoware_trajectory): add get_contained_lane_ids function (#369)
- add get_contained_lane_ids
- add unit test
* remove assert ---------
-
feat(trajectory): add pretty_build() function for Planning/Control component node (#332)
-
refactor(autoware_trajectory)!: move everything to namespace experimetal (#371) refactor(autoware_trajectory)!: move everything to namespace experimental
-
feat(trajectory): improve shift function and their documents (#337)
- feat(trajectory): add populate function
- update curvature figure for approximation desc
- update align_orientation_with_trajectory_direction fig
- finished trajectory classes
- refactored shift
- add comment
* update error message ---------
-
fix(autoware_trajectory): fix base_addition callback to work when Trajectory is moved (#370)
-
fix(autoware_trajectory): check vector size check before accessing (#365)
- fix(autoware_trajectory): check vector size check before accessing
- update
* minor fix ---------Co-authored-by: Mamoru Sobue <<hilo.soblin@gmail.com>>
-
feat(autoware_trajectory): improve performance of get_underlying_base (#298)
-
feat(trajectory): add API documentation for trajectory class, add some utillity (#295)
-
feat(trajectory): add API description, nomenclature, illustration, rename functions to align with nomenclature (#292)
- feat(trajectory): add API description, nomenclature, illustration, rename functions to align with nomenclature
* resurrect get_internal_base ---------
-
chore: include iostream and link yaml-cpp for Jazzy (#351)
-
Contributors: Mamoru Sobue, Tim Clephas, Yukinari Hisaki
1.0.0 (2025-03-31)
- feat(trajectory): remove default ctor and collect default setting in
File truncated at 100 lines see the full file
Wiki Tutorials
Package Dependencies
System Dependencies
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged autoware_trajectory at Robotics Stack Exchange
Package Summary
Tags | No category tags. |
Version | 1.1.0 |
License | Apache License 2.0 |
Build type | AMENT_CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/autowarefoundation/autoware_core.git |
VCS Type | git |
VCS Version | main |
Last Updated | 2025-06-12 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | UNRELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Yukinari Hisaki
- Takayuki Murooka
- Kosuke Takeuchi
- Mamoru Sobue
Authors
- Yukinari Hisaki
Autoware Trajectory
This package provides classes to manage/manipulate Trajectory.
Overview
Interpolators
The interpolator class interpolates given bases
and values
. Following interpolators are implemented.
- Linear
- AkimaSpline
- CubicSpline
- NearestNeighbor
- Stairstep
The builder internally executes interpolation and return the result in the form of expected<T, E>
. If successful, it contains the interpolator object.
```cpp title=”./examples/example_readme.cpp:53:68” –8<– common/autoware_trajectory/examples/example_readme.cpp:53:68 –8<–
Otherwise it contains the error object representing the failure reason. In the below snippet, cubic spline interpolation fails because the number of input points is 3, which is below the `minimum_required_points() = 4` of `CubicSpline`.
```cpp title="./examples/example_readme.cpp:109:119"
--8<--
common/autoware_trajectory/examples/example_readme.cpp:109:119
--8<--
In such cases the result expected
object contains InterpolationFailure
type with an error message like “base size 3 is less than minimum required 4”.
Trajectory class
The Trajectory class provides mathematical continuous representation and object oriented interface for discrete array of following point types
-
geometry_msgs::Point
-
geometry_msgs::Pose
-
autoware_planning_msgs::PathPoint
-
autoware_planning_msgs::PathPointWithLaneId
-
autoware_planning_msgs::TrajectoryPoint
by interpolating the given underlying points. Once built, arbitrary point on the curve is continuously parametrized by a single s
coordinate.
```cpp title=”./examples/example_readme.cpp:549:561” –8<– common/autoware_trajectory/examples/example_readme.cpp:549:561 –8<–

[View in Drawio]({{ drawio("/common/autoware_trajectory/images/overview/trajectory.drawio.svg") }})
## Nomenclature
This section introduces strict definition of several words used in this package to clarify the description of API and help the developers understand and grasp the geometric meaning of algorithms.
| Word | Meaning | Illustration |
| --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `curve` | `curve` is an oriented bounded curve denoted as `(x(s), y(s), z(s))` with additional properties, parameterized by `s` (`s = 0` at the start). | <br>[View in Drawio]({{ drawio("/common/autoware_trajectory/images/nomenclature/curve.drawio.svg") }})<br>There are 5 `underlying` points<br>$\mathrm{P0} = (0, 0, 0)$<br>$\mathrm{P1} = (1/ \sqrt{2}, 1/ \sqrt{2}, 0)$<br>$\mathrm{P2} = (1/ \sqrt{2}, 1+1/ \sqrt{2}, 0)$<br>$\mathrm{P3} = (2/ \sqrt{2}, 1+2/ \sqrt{2}, 0)$<br>$\mathrm{P4} = (2/ \sqrt{2} + 1/ \sqrt{6}, 1+2/ \sqrt{2} + 1 / \sqrt{3}, 1 / \sqrt{2})$<br>and the `arc length` between each interval is $1, 2, 1, 1$ respectively, so $\mathrm{start} = 0$ and $\mathrm{end} = 5$. |
| `underlying` | `underlying` points of a curve refers to the list of 3D points from which the curve was interpolated. | |
| `arc length`[m] | `arc length` denotes the approximate **3D** length of of a curve and is computed based on the discrete `underlying` points. | |
| `s`[m] | `s` denotes the **3D** `arc length` coordinate starting from the base point (mostly the start point) of the curve and a point is identified by `trajectory(s)`.<br>Due to this definition, the actual _curve length_ and `arc length` have subtle difference as illustrated. | <br>[View in Drawio]({{ drawio("/common/autoware_trajectory/images/nomenclature/approximation.drawio.svg") }})<br>The point for $s = 0.5$ is the purple dot, but the _curve length_ from $\mathrm{P0}$ to this point does not equal to $0.5$.<br>The exact _curve length_ is $\int \sqrt{(\frac{dx}{dt})^2 + (\frac{dy}{dt})^2 + (\frac{dz}{dt})^2} dt$, which cannot be obtained in an analytical closed form. |
| `curvature` | `curvature` is computed **using only X-Y 2D coordinate**. This is based on the normal and natural assumption that _roads are flat_. Mathematically, it asserts that [Gaussian curvature](https://en.wikipedia.org/wiki/Gaussian_curvature) of road is uniformly 0.<br>The sign of curvature is positive if the center of turning circle is on the left side, otherwise negative. | <br>[View in Drawio]({{ drawio("/common/autoware_trajectory/images/nomenclature/curvature.drawio.svg") }}) |
| `k_points_minimum_dist_threshold` | This is a constant threshold that is used to check if two points or values are same and to avoid zero division. | |
| `almost-same` | The pair of two points $P_{1}$ and $P_{2}$, or the pair of two base values $s_{1}$ and $s_{2}$ are called `almost-same` if their distance or difference are less than `k_points_minimum_dist_threshold` | |
## API
### Interpolators
| Class | method/function | description |
| ---------------- | ----------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| Common Functions | `minimum_required_points()` | return the number of points required for each concrete interpolator |
| | `compute(double s) -> T` | compute the interpolated value at given base $s$. $s$ is clamped to the underlying base range. |
| | `compute(vector<double> s) -> vector<T>` | compute the interpolated values at for each base values in $s$. |
| | `compute_first_derivative(double s) -> double` | compute the first derivative of at given base $s$. $s$ is clamped. |
| | `compute_second_derivative(double s) -> double` | compute the second derivative of at given base $s$. $s$ is clamped. |
`AkimaSpline` requires at least **5** points to interpolate.
```cpp title="./examples/example_readme.cpp:142:152"
--8<--
common/autoware_trajectory/examples/example_readme.cpp:142:152
--8<--
CubicSpline
requires at least 4 points to interpolate.
```cpp title=”./examples/example_readme.cpp:192:201” –8<– common/autoware_trajectory/examples/example_readme.cpp:192:201
File truncated at 100 lines see the full file
Changelog for package autoware_trajectory
1.1.0 (2025-05-01)
-
fix(autoware_trajectory): avoid nan in align_orientation_with_trajectory_direction (#398)
- fix(autoware_trajectory): avoid nan in align_orientation_with_trajectory_direction
- tidy
* remove eps ---------
-
chore(autoware_trajectory): relax the warning condition of boundary check (#393)
- chore(autoware_trajectory): relax the warning condition of boundary check
* tidy
-
feat(trajectory): define distance threshold and refine restore() without API breakage(in experimental) (#376)
- feat(trajectory): define distance threshold and refine restore
* fix spell ---------
-
feat(autoware_trajectory): add get_contained_lane_ids function (#369)
- add get_contained_lane_ids
- add unit test
* remove assert ---------
-
feat(trajectory): add pretty_build() function for Planning/Control component node (#332)
-
refactor(autoware_trajectory)!: move everything to namespace experimetal (#371) refactor(autoware_trajectory)!: move everything to namespace experimental
-
feat(trajectory): improve shift function and their documents (#337)
- feat(trajectory): add populate function
- update curvature figure for approximation desc
- update align_orientation_with_trajectory_direction fig
- finished trajectory classes
- refactored shift
- add comment
* update error message ---------
-
fix(autoware_trajectory): fix base_addition callback to work when Trajectory is moved (#370)
-
fix(autoware_trajectory): check vector size check before accessing (#365)
- fix(autoware_trajectory): check vector size check before accessing
- update
* minor fix ---------Co-authored-by: Mamoru Sobue <<hilo.soblin@gmail.com>>
-
feat(autoware_trajectory): improve performance of get_underlying_base (#298)
-
feat(trajectory): add API documentation for trajectory class, add some utillity (#295)
-
feat(trajectory): add API description, nomenclature, illustration, rename functions to align with nomenclature (#292)
- feat(trajectory): add API description, nomenclature, illustration, rename functions to align with nomenclature
* resurrect get_internal_base ---------
-
chore: include iostream and link yaml-cpp for Jazzy (#351)
-
Contributors: Mamoru Sobue, Tim Clephas, Yukinari Hisaki
1.0.0 (2025-03-31)
- feat(trajectory): remove default ctor and collect default setting in
File truncated at 100 lines see the full file
Wiki Tutorials
Package Dependencies
System Dependencies
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged autoware_trajectory at Robotics Stack Exchange
Package Summary
Tags | No category tags. |
Version | 1.1.0 |
License | Apache License 2.0 |
Build type | AMENT_CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/autowarefoundation/autoware_core.git |
VCS Type | git |
VCS Version | main |
Last Updated | 2025-06-12 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | UNRELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Yukinari Hisaki
- Takayuki Murooka
- Kosuke Takeuchi
- Mamoru Sobue
Authors
- Yukinari Hisaki
Autoware Trajectory
This package provides classes to manage/manipulate Trajectory.
Overview
Interpolators
The interpolator class interpolates given bases
and values
. Following interpolators are implemented.
- Linear
- AkimaSpline
- CubicSpline
- NearestNeighbor
- Stairstep
The builder internally executes interpolation and return the result in the form of expected<T, E>
. If successful, it contains the interpolator object.
```cpp title=”./examples/example_readme.cpp:53:68” –8<– common/autoware_trajectory/examples/example_readme.cpp:53:68 –8<–
Otherwise it contains the error object representing the failure reason. In the below snippet, cubic spline interpolation fails because the number of input points is 3, which is below the `minimum_required_points() = 4` of `CubicSpline`.
```cpp title="./examples/example_readme.cpp:109:119"
--8<--
common/autoware_trajectory/examples/example_readme.cpp:109:119
--8<--
In such cases the result expected
object contains InterpolationFailure
type with an error message like “base size 3 is less than minimum required 4”.
Trajectory class
The Trajectory class provides mathematical continuous representation and object oriented interface for discrete array of following point types
-
geometry_msgs::Point
-
geometry_msgs::Pose
-
autoware_planning_msgs::PathPoint
-
autoware_planning_msgs::PathPointWithLaneId
-
autoware_planning_msgs::TrajectoryPoint
by interpolating the given underlying points. Once built, arbitrary point on the curve is continuously parametrized by a single s
coordinate.
```cpp title=”./examples/example_readme.cpp:549:561” –8<– common/autoware_trajectory/examples/example_readme.cpp:549:561 –8<–

[View in Drawio]({{ drawio("/common/autoware_trajectory/images/overview/trajectory.drawio.svg") }})
## Nomenclature
This section introduces strict definition of several words used in this package to clarify the description of API and help the developers understand and grasp the geometric meaning of algorithms.
| Word | Meaning | Illustration |
| --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `curve` | `curve` is an oriented bounded curve denoted as `(x(s), y(s), z(s))` with additional properties, parameterized by `s` (`s = 0` at the start). | <br>[View in Drawio]({{ drawio("/common/autoware_trajectory/images/nomenclature/curve.drawio.svg") }})<br>There are 5 `underlying` points<br>$\mathrm{P0} = (0, 0, 0)$<br>$\mathrm{P1} = (1/ \sqrt{2}, 1/ \sqrt{2}, 0)$<br>$\mathrm{P2} = (1/ \sqrt{2}, 1+1/ \sqrt{2}, 0)$<br>$\mathrm{P3} = (2/ \sqrt{2}, 1+2/ \sqrt{2}, 0)$<br>$\mathrm{P4} = (2/ \sqrt{2} + 1/ \sqrt{6}, 1+2/ \sqrt{2} + 1 / \sqrt{3}, 1 / \sqrt{2})$<br>and the `arc length` between each interval is $1, 2, 1, 1$ respectively, so $\mathrm{start} = 0$ and $\mathrm{end} = 5$. |
| `underlying` | `underlying` points of a curve refers to the list of 3D points from which the curve was interpolated. | |
| `arc length`[m] | `arc length` denotes the approximate **3D** length of of a curve and is computed based on the discrete `underlying` points. | |
| `s`[m] | `s` denotes the **3D** `arc length` coordinate starting from the base point (mostly the start point) of the curve and a point is identified by `trajectory(s)`.<br>Due to this definition, the actual _curve length_ and `arc length` have subtle difference as illustrated. | <br>[View in Drawio]({{ drawio("/common/autoware_trajectory/images/nomenclature/approximation.drawio.svg") }})<br>The point for $s = 0.5$ is the purple dot, but the _curve length_ from $\mathrm{P0}$ to this point does not equal to $0.5$.<br>The exact _curve length_ is $\int \sqrt{(\frac{dx}{dt})^2 + (\frac{dy}{dt})^2 + (\frac{dz}{dt})^2} dt$, which cannot be obtained in an analytical closed form. |
| `curvature` | `curvature` is computed **using only X-Y 2D coordinate**. This is based on the normal and natural assumption that _roads are flat_. Mathematically, it asserts that [Gaussian curvature](https://en.wikipedia.org/wiki/Gaussian_curvature) of road is uniformly 0.<br>The sign of curvature is positive if the center of turning circle is on the left side, otherwise negative. | <br>[View in Drawio]({{ drawio("/common/autoware_trajectory/images/nomenclature/curvature.drawio.svg") }}) |
| `k_points_minimum_dist_threshold` | This is a constant threshold that is used to check if two points or values are same and to avoid zero division. | |
| `almost-same` | The pair of two points $P_{1}$ and $P_{2}$, or the pair of two base values $s_{1}$ and $s_{2}$ are called `almost-same` if their distance or difference are less than `k_points_minimum_dist_threshold` | |
## API
### Interpolators
| Class | method/function | description |
| ---------------- | ----------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| Common Functions | `minimum_required_points()` | return the number of points required for each concrete interpolator |
| | `compute(double s) -> T` | compute the interpolated value at given base $s$. $s$ is clamped to the underlying base range. |
| | `compute(vector<double> s) -> vector<T>` | compute the interpolated values at for each base values in $s$. |
| | `compute_first_derivative(double s) -> double` | compute the first derivative of at given base $s$. $s$ is clamped. |
| | `compute_second_derivative(double s) -> double` | compute the second derivative of at given base $s$. $s$ is clamped. |
`AkimaSpline` requires at least **5** points to interpolate.
```cpp title="./examples/example_readme.cpp:142:152"
--8<--
common/autoware_trajectory/examples/example_readme.cpp:142:152
--8<--
CubicSpline
requires at least 4 points to interpolate.
```cpp title=”./examples/example_readme.cpp:192:201” –8<– common/autoware_trajectory/examples/example_readme.cpp:192:201
File truncated at 100 lines see the full file
Changelog for package autoware_trajectory
1.1.0 (2025-05-01)
-
fix(autoware_trajectory): avoid nan in align_orientation_with_trajectory_direction (#398)
- fix(autoware_trajectory): avoid nan in align_orientation_with_trajectory_direction
- tidy
* remove eps ---------
-
chore(autoware_trajectory): relax the warning condition of boundary check (#393)
- chore(autoware_trajectory): relax the warning condition of boundary check
* tidy
-
feat(trajectory): define distance threshold and refine restore() without API breakage(in experimental) (#376)
- feat(trajectory): define distance threshold and refine restore
* fix spell ---------
-
feat(autoware_trajectory): add get_contained_lane_ids function (#369)
- add get_contained_lane_ids
- add unit test
* remove assert ---------
-
feat(trajectory): add pretty_build() function for Planning/Control component node (#332)
-
refactor(autoware_trajectory)!: move everything to namespace experimetal (#371) refactor(autoware_trajectory)!: move everything to namespace experimental
-
feat(trajectory): improve shift function and their documents (#337)
- feat(trajectory): add populate function
- update curvature figure for approximation desc
- update align_orientation_with_trajectory_direction fig
- finished trajectory classes
- refactored shift
- add comment
* update error message ---------
-
fix(autoware_trajectory): fix base_addition callback to work when Trajectory is moved (#370)
-
fix(autoware_trajectory): check vector size check before accessing (#365)
- fix(autoware_trajectory): check vector size check before accessing
- update
* minor fix ---------Co-authored-by: Mamoru Sobue <<hilo.soblin@gmail.com>>
-
feat(autoware_trajectory): improve performance of get_underlying_base (#298)
-
feat(trajectory): add API documentation for trajectory class, add some utillity (#295)
-
feat(trajectory): add API description, nomenclature, illustration, rename functions to align with nomenclature (#292)
- feat(trajectory): add API description, nomenclature, illustration, rename functions to align with nomenclature
* resurrect get_internal_base ---------
-
chore: include iostream and link yaml-cpp for Jazzy (#351)
-
Contributors: Mamoru Sobue, Tim Clephas, Yukinari Hisaki
1.0.0 (2025-03-31)
- feat(trajectory): remove default ctor and collect default setting in
File truncated at 100 lines see the full file
Wiki Tutorials
Package Dependencies
System Dependencies
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged autoware_trajectory at Robotics Stack Exchange
Package Summary
Tags | No category tags. |
Version | 1.1.0 |
License | Apache License 2.0 |
Build type | AMENT_CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/autowarefoundation/autoware_core.git |
VCS Type | git |
VCS Version | main |
Last Updated | 2025-06-12 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | UNRELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Yukinari Hisaki
- Takayuki Murooka
- Kosuke Takeuchi
- Mamoru Sobue
Authors
- Yukinari Hisaki
Autoware Trajectory
This package provides classes to manage/manipulate Trajectory.
Overview
Interpolators
The interpolator class interpolates given bases
and values
. Following interpolators are implemented.
- Linear
- AkimaSpline
- CubicSpline
- NearestNeighbor
- Stairstep
The builder internally executes interpolation and return the result in the form of expected<T, E>
. If successful, it contains the interpolator object.
```cpp title=”./examples/example_readme.cpp:53:68” –8<– common/autoware_trajectory/examples/example_readme.cpp:53:68 –8<–
Otherwise it contains the error object representing the failure reason. In the below snippet, cubic spline interpolation fails because the number of input points is 3, which is below the `minimum_required_points() = 4` of `CubicSpline`.
```cpp title="./examples/example_readme.cpp:109:119"
--8<--
common/autoware_trajectory/examples/example_readme.cpp:109:119
--8<--
In such cases the result expected
object contains InterpolationFailure
type with an error message like “base size 3 is less than minimum required 4”.
Trajectory class
The Trajectory class provides mathematical continuous representation and object oriented interface for discrete array of following point types
-
geometry_msgs::Point
-
geometry_msgs::Pose
-
autoware_planning_msgs::PathPoint
-
autoware_planning_msgs::PathPointWithLaneId
-
autoware_planning_msgs::TrajectoryPoint
by interpolating the given underlying points. Once built, arbitrary point on the curve is continuously parametrized by a single s
coordinate.
```cpp title=”./examples/example_readme.cpp:549:561” –8<– common/autoware_trajectory/examples/example_readme.cpp:549:561 –8<–

[View in Drawio]({{ drawio("/common/autoware_trajectory/images/overview/trajectory.drawio.svg") }})
## Nomenclature
This section introduces strict definition of several words used in this package to clarify the description of API and help the developers understand and grasp the geometric meaning of algorithms.
| Word | Meaning | Illustration |
| --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `curve` | `curve` is an oriented bounded curve denoted as `(x(s), y(s), z(s))` with additional properties, parameterized by `s` (`s = 0` at the start). | <br>[View in Drawio]({{ drawio("/common/autoware_trajectory/images/nomenclature/curve.drawio.svg") }})<br>There are 5 `underlying` points<br>$\mathrm{P0} = (0, 0, 0)$<br>$\mathrm{P1} = (1/ \sqrt{2}, 1/ \sqrt{2}, 0)$<br>$\mathrm{P2} = (1/ \sqrt{2}, 1+1/ \sqrt{2}, 0)$<br>$\mathrm{P3} = (2/ \sqrt{2}, 1+2/ \sqrt{2}, 0)$<br>$\mathrm{P4} = (2/ \sqrt{2} + 1/ \sqrt{6}, 1+2/ \sqrt{2} + 1 / \sqrt{3}, 1 / \sqrt{2})$<br>and the `arc length` between each interval is $1, 2, 1, 1$ respectively, so $\mathrm{start} = 0$ and $\mathrm{end} = 5$. |
| `underlying` | `underlying` points of a curve refers to the list of 3D points from which the curve was interpolated. | |
| `arc length`[m] | `arc length` denotes the approximate **3D** length of of a curve and is computed based on the discrete `underlying` points. | |
| `s`[m] | `s` denotes the **3D** `arc length` coordinate starting from the base point (mostly the start point) of the curve and a point is identified by `trajectory(s)`.<br>Due to this definition, the actual _curve length_ and `arc length` have subtle difference as illustrated. | <br>[View in Drawio]({{ drawio("/common/autoware_trajectory/images/nomenclature/approximation.drawio.svg") }})<br>The point for $s = 0.5$ is the purple dot, but the _curve length_ from $\mathrm{P0}$ to this point does not equal to $0.5$.<br>The exact _curve length_ is $\int \sqrt{(\frac{dx}{dt})^2 + (\frac{dy}{dt})^2 + (\frac{dz}{dt})^2} dt$, which cannot be obtained in an analytical closed form. |
| `curvature` | `curvature` is computed **using only X-Y 2D coordinate**. This is based on the normal and natural assumption that _roads are flat_. Mathematically, it asserts that [Gaussian curvature](https://en.wikipedia.org/wiki/Gaussian_curvature) of road is uniformly 0.<br>The sign of curvature is positive if the center of turning circle is on the left side, otherwise negative. | <br>[View in Drawio]({{ drawio("/common/autoware_trajectory/images/nomenclature/curvature.drawio.svg") }}) |
| `k_points_minimum_dist_threshold` | This is a constant threshold that is used to check if two points or values are same and to avoid zero division. | |
| `almost-same` | The pair of two points $P_{1}$ and $P_{2}$, or the pair of two base values $s_{1}$ and $s_{2}$ are called `almost-same` if their distance or difference are less than `k_points_minimum_dist_threshold` | |
## API
### Interpolators
| Class | method/function | description |
| ---------------- | ----------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| Common Functions | `minimum_required_points()` | return the number of points required for each concrete interpolator |
| | `compute(double s) -> T` | compute the interpolated value at given base $s$. $s$ is clamped to the underlying base range. |
| | `compute(vector<double> s) -> vector<T>` | compute the interpolated values at for each base values in $s$. |
| | `compute_first_derivative(double s) -> double` | compute the first derivative of at given base $s$. $s$ is clamped. |
| | `compute_second_derivative(double s) -> double` | compute the second derivative of at given base $s$. $s$ is clamped. |
`AkimaSpline` requires at least **5** points to interpolate.
```cpp title="./examples/example_readme.cpp:142:152"
--8<--
common/autoware_trajectory/examples/example_readme.cpp:142:152
--8<--
CubicSpline
requires at least 4 points to interpolate.
```cpp title=”./examples/example_readme.cpp:192:201” –8<– common/autoware_trajectory/examples/example_readme.cpp:192:201
File truncated at 100 lines see the full file
Changelog for package autoware_trajectory
1.1.0 (2025-05-01)
-
fix(autoware_trajectory): avoid nan in align_orientation_with_trajectory_direction (#398)
- fix(autoware_trajectory): avoid nan in align_orientation_with_trajectory_direction
- tidy
* remove eps ---------
-
chore(autoware_trajectory): relax the warning condition of boundary check (#393)
- chore(autoware_trajectory): relax the warning condition of boundary check
* tidy
-
feat(trajectory): define distance threshold and refine restore() without API breakage(in experimental) (#376)
- feat(trajectory): define distance threshold and refine restore
* fix spell ---------
-
feat(autoware_trajectory): add get_contained_lane_ids function (#369)
- add get_contained_lane_ids
- add unit test
* remove assert ---------
-
feat(trajectory): add pretty_build() function for Planning/Control component node (#332)
-
refactor(autoware_trajectory)!: move everything to namespace experimetal (#371) refactor(autoware_trajectory)!: move everything to namespace experimental
-
feat(trajectory): improve shift function and their documents (#337)
- feat(trajectory): add populate function
- update curvature figure for approximation desc
- update align_orientation_with_trajectory_direction fig
- finished trajectory classes
- refactored shift
- add comment
* update error message ---------
-
fix(autoware_trajectory): fix base_addition callback to work when Trajectory is moved (#370)
-
fix(autoware_trajectory): check vector size check before accessing (#365)
- fix(autoware_trajectory): check vector size check before accessing
- update
* minor fix ---------Co-authored-by: Mamoru Sobue <<hilo.soblin@gmail.com>>
-
feat(autoware_trajectory): improve performance of get_underlying_base (#298)
-
feat(trajectory): add API documentation for trajectory class, add some utillity (#295)
-
feat(trajectory): add API description, nomenclature, illustration, rename functions to align with nomenclature (#292)
- feat(trajectory): add API description, nomenclature, illustration, rename functions to align with nomenclature
* resurrect get_internal_base ---------
-
chore: include iostream and link yaml-cpp for Jazzy (#351)
-
Contributors: Mamoru Sobue, Tim Clephas, Yukinari Hisaki
1.0.0 (2025-03-31)
- feat(trajectory): remove default ctor and collect default setting in
File truncated at 100 lines see the full file
Wiki Tutorials
Package Dependencies
System Dependencies
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged autoware_trajectory at Robotics Stack Exchange
Package Summary
Tags | No category tags. |
Version | 1.1.0 |
License | Apache License 2.0 |
Build type | AMENT_CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/autowarefoundation/autoware_core.git |
VCS Type | git |
VCS Version | main |
Last Updated | 2025-06-12 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | UNRELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Yukinari Hisaki
- Takayuki Murooka
- Kosuke Takeuchi
- Mamoru Sobue
Authors
- Yukinari Hisaki
Autoware Trajectory
This package provides classes to manage/manipulate Trajectory.
Overview
Interpolators
The interpolator class interpolates given bases
and values
. Following interpolators are implemented.
- Linear
- AkimaSpline
- CubicSpline
- NearestNeighbor
- Stairstep
The builder internally executes interpolation and return the result in the form of expected<T, E>
. If successful, it contains the interpolator object.
```cpp title=”./examples/example_readme.cpp:53:68” –8<– common/autoware_trajectory/examples/example_readme.cpp:53:68 –8<–
Otherwise it contains the error object representing the failure reason. In the below snippet, cubic spline interpolation fails because the number of input points is 3, which is below the `minimum_required_points() = 4` of `CubicSpline`.
```cpp title="./examples/example_readme.cpp:109:119"
--8<--
common/autoware_trajectory/examples/example_readme.cpp:109:119
--8<--
In such cases the result expected
object contains InterpolationFailure
type with an error message like “base size 3 is less than minimum required 4”.
Trajectory class
The Trajectory class provides mathematical continuous representation and object oriented interface for discrete array of following point types
-
geometry_msgs::Point
-
geometry_msgs::Pose
-
autoware_planning_msgs::PathPoint
-
autoware_planning_msgs::PathPointWithLaneId
-
autoware_planning_msgs::TrajectoryPoint
by interpolating the given underlying points. Once built, arbitrary point on the curve is continuously parametrized by a single s
coordinate.
```cpp title=”./examples/example_readme.cpp:549:561” –8<– common/autoware_trajectory/examples/example_readme.cpp:549:561 –8<–

[View in Drawio]({{ drawio("/common/autoware_trajectory/images/overview/trajectory.drawio.svg") }})
## Nomenclature
This section introduces strict definition of several words used in this package to clarify the description of API and help the developers understand and grasp the geometric meaning of algorithms.
| Word | Meaning | Illustration |
| --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `curve` | `curve` is an oriented bounded curve denoted as `(x(s), y(s), z(s))` with additional properties, parameterized by `s` (`s = 0` at the start). | <br>[View in Drawio]({{ drawio("/common/autoware_trajectory/images/nomenclature/curve.drawio.svg") }})<br>There are 5 `underlying` points<br>$\mathrm{P0} = (0, 0, 0)$<br>$\mathrm{P1} = (1/ \sqrt{2}, 1/ \sqrt{2}, 0)$<br>$\mathrm{P2} = (1/ \sqrt{2}, 1+1/ \sqrt{2}, 0)$<br>$\mathrm{P3} = (2/ \sqrt{2}, 1+2/ \sqrt{2}, 0)$<br>$\mathrm{P4} = (2/ \sqrt{2} + 1/ \sqrt{6}, 1+2/ \sqrt{2} + 1 / \sqrt{3}, 1 / \sqrt{2})$<br>and the `arc length` between each interval is $1, 2, 1, 1$ respectively, so $\mathrm{start} = 0$ and $\mathrm{end} = 5$. |
| `underlying` | `underlying` points of a curve refers to the list of 3D points from which the curve was interpolated. | |
| `arc length`[m] | `arc length` denotes the approximate **3D** length of of a curve and is computed based on the discrete `underlying` points. | |
| `s`[m] | `s` denotes the **3D** `arc length` coordinate starting from the base point (mostly the start point) of the curve and a point is identified by `trajectory(s)`.<br>Due to this definition, the actual _curve length_ and `arc length` have subtle difference as illustrated. | <br>[View in Drawio]({{ drawio("/common/autoware_trajectory/images/nomenclature/approximation.drawio.svg") }})<br>The point for $s = 0.5$ is the purple dot, but the _curve length_ from $\mathrm{P0}$ to this point does not equal to $0.5$.<br>The exact _curve length_ is $\int \sqrt{(\frac{dx}{dt})^2 + (\frac{dy}{dt})^2 + (\frac{dz}{dt})^2} dt$, which cannot be obtained in an analytical closed form. |
| `curvature` | `curvature` is computed **using only X-Y 2D coordinate**. This is based on the normal and natural assumption that _roads are flat_. Mathematically, it asserts that [Gaussian curvature](https://en.wikipedia.org/wiki/Gaussian_curvature) of road is uniformly 0.<br>The sign of curvature is positive if the center of turning circle is on the left side, otherwise negative. | <br>[View in Drawio]({{ drawio("/common/autoware_trajectory/images/nomenclature/curvature.drawio.svg") }}) |
| `k_points_minimum_dist_threshold` | This is a constant threshold that is used to check if two points or values are same and to avoid zero division. | |
| `almost-same` | The pair of two points $P_{1}$ and $P_{2}$, or the pair of two base values $s_{1}$ and $s_{2}$ are called `almost-same` if their distance or difference are less than `k_points_minimum_dist_threshold` | |
## API
### Interpolators
| Class | method/function | description |
| ---------------- | ----------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| Common Functions | `minimum_required_points()` | return the number of points required for each concrete interpolator |
| | `compute(double s) -> T` | compute the interpolated value at given base $s$. $s$ is clamped to the underlying base range. |
| | `compute(vector<double> s) -> vector<T>` | compute the interpolated values at for each base values in $s$. |
| | `compute_first_derivative(double s) -> double` | compute the first derivative of at given base $s$. $s$ is clamped. |
| | `compute_second_derivative(double s) -> double` | compute the second derivative of at given base $s$. $s$ is clamped. |
`AkimaSpline` requires at least **5** points to interpolate.
```cpp title="./examples/example_readme.cpp:142:152"
--8<--
common/autoware_trajectory/examples/example_readme.cpp:142:152
--8<--
CubicSpline
requires at least 4 points to interpolate.
```cpp title=”./examples/example_readme.cpp:192:201” –8<– common/autoware_trajectory/examples/example_readme.cpp:192:201
File truncated at 100 lines see the full file
Changelog for package autoware_trajectory
1.1.0 (2025-05-01)
-
fix(autoware_trajectory): avoid nan in align_orientation_with_trajectory_direction (#398)
- fix(autoware_trajectory): avoid nan in align_orientation_with_trajectory_direction
- tidy
* remove eps ---------
-
chore(autoware_trajectory): relax the warning condition of boundary check (#393)
- chore(autoware_trajectory): relax the warning condition of boundary check
* tidy
-
feat(trajectory): define distance threshold and refine restore() without API breakage(in experimental) (#376)
- feat(trajectory): define distance threshold and refine restore
* fix spell ---------
-
feat(autoware_trajectory): add get_contained_lane_ids function (#369)
- add get_contained_lane_ids
- add unit test
* remove assert ---------
-
feat(trajectory): add pretty_build() function for Planning/Control component node (#332)
-
refactor(autoware_trajectory)!: move everything to namespace experimetal (#371) refactor(autoware_trajectory)!: move everything to namespace experimental
-
feat(trajectory): improve shift function and their documents (#337)
- feat(trajectory): add populate function
- update curvature figure for approximation desc
- update align_orientation_with_trajectory_direction fig
- finished trajectory classes
- refactored shift
- add comment
* update error message ---------
-
fix(autoware_trajectory): fix base_addition callback to work when Trajectory is moved (#370)
-
fix(autoware_trajectory): check vector size check before accessing (#365)
- fix(autoware_trajectory): check vector size check before accessing
- update
* minor fix ---------Co-authored-by: Mamoru Sobue <<hilo.soblin@gmail.com>>
-
feat(autoware_trajectory): improve performance of get_underlying_base (#298)
-
feat(trajectory): add API documentation for trajectory class, add some utillity (#295)
-
feat(trajectory): add API description, nomenclature, illustration, rename functions to align with nomenclature (#292)
- feat(trajectory): add API description, nomenclature, illustration, rename functions to align with nomenclature
* resurrect get_internal_base ---------
-
chore: include iostream and link yaml-cpp for Jazzy (#351)
-
Contributors: Mamoru Sobue, Tim Clephas, Yukinari Hisaki
1.0.0 (2025-03-31)
- feat(trajectory): remove default ctor and collect default setting in
File truncated at 100 lines see the full file
Wiki Tutorials
Package Dependencies
System Dependencies
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged autoware_trajectory at Robotics Stack Exchange
Package Summary
Tags | No category tags. |
Version | 1.1.0 |
License | Apache License 2.0 |
Build type | AMENT_CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/autowarefoundation/autoware_core.git |
VCS Type | git |
VCS Version | main |
Last Updated | 2025-06-12 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | UNRELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Yukinari Hisaki
- Takayuki Murooka
- Kosuke Takeuchi
- Mamoru Sobue
Authors
- Yukinari Hisaki
Autoware Trajectory
This package provides classes to manage/manipulate Trajectory.
Overview
Interpolators
The interpolator class interpolates given bases
and values
. Following interpolators are implemented.
- Linear
- AkimaSpline
- CubicSpline
- NearestNeighbor
- Stairstep
The builder internally executes interpolation and return the result in the form of expected<T, E>
. If successful, it contains the interpolator object.
```cpp title=”./examples/example_readme.cpp:53:68” –8<– common/autoware_trajectory/examples/example_readme.cpp:53:68 –8<–
Otherwise it contains the error object representing the failure reason. In the below snippet, cubic spline interpolation fails because the number of input points is 3, which is below the `minimum_required_points() = 4` of `CubicSpline`.
```cpp title="./examples/example_readme.cpp:109:119"
--8<--
common/autoware_trajectory/examples/example_readme.cpp:109:119
--8<--
In such cases the result expected
object contains InterpolationFailure
type with an error message like “base size 3 is less than minimum required 4”.
Trajectory class
The Trajectory class provides mathematical continuous representation and object oriented interface for discrete array of following point types
-
geometry_msgs::Point
-
geometry_msgs::Pose
-
autoware_planning_msgs::PathPoint
-
autoware_planning_msgs::PathPointWithLaneId
-
autoware_planning_msgs::TrajectoryPoint
by interpolating the given underlying points. Once built, arbitrary point on the curve is continuously parametrized by a single s
coordinate.
```cpp title=”./examples/example_readme.cpp:549:561” –8<– common/autoware_trajectory/examples/example_readme.cpp:549:561 –8<–

[View in Drawio]({{ drawio("/common/autoware_trajectory/images/overview/trajectory.drawio.svg") }})
## Nomenclature
This section introduces strict definition of several words used in this package to clarify the description of API and help the developers understand and grasp the geometric meaning of algorithms.
| Word | Meaning | Illustration |
| --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `curve` | `curve` is an oriented bounded curve denoted as `(x(s), y(s), z(s))` with additional properties, parameterized by `s` (`s = 0` at the start). | <br>[View in Drawio]({{ drawio("/common/autoware_trajectory/images/nomenclature/curve.drawio.svg") }})<br>There are 5 `underlying` points<br>$\mathrm{P0} = (0, 0, 0)$<br>$\mathrm{P1} = (1/ \sqrt{2}, 1/ \sqrt{2}, 0)$<br>$\mathrm{P2} = (1/ \sqrt{2}, 1+1/ \sqrt{2}, 0)$<br>$\mathrm{P3} = (2/ \sqrt{2}, 1+2/ \sqrt{2}, 0)$<br>$\mathrm{P4} = (2/ \sqrt{2} + 1/ \sqrt{6}, 1+2/ \sqrt{2} + 1 / \sqrt{3}, 1 / \sqrt{2})$<br>and the `arc length` between each interval is $1, 2, 1, 1$ respectively, so $\mathrm{start} = 0$ and $\mathrm{end} = 5$. |
| `underlying` | `underlying` points of a curve refers to the list of 3D points from which the curve was interpolated. | |
| `arc length`[m] | `arc length` denotes the approximate **3D** length of of a curve and is computed based on the discrete `underlying` points. | |
| `s`[m] | `s` denotes the **3D** `arc length` coordinate starting from the base point (mostly the start point) of the curve and a point is identified by `trajectory(s)`.<br>Due to this definition, the actual _curve length_ and `arc length` have subtle difference as illustrated. | <br>[View in Drawio]({{ drawio("/common/autoware_trajectory/images/nomenclature/approximation.drawio.svg") }})<br>The point for $s = 0.5$ is the purple dot, but the _curve length_ from $\mathrm{P0}$ to this point does not equal to $0.5$.<br>The exact _curve length_ is $\int \sqrt{(\frac{dx}{dt})^2 + (\frac{dy}{dt})^2 + (\frac{dz}{dt})^2} dt$, which cannot be obtained in an analytical closed form. |
| `curvature` | `curvature` is computed **using only X-Y 2D coordinate**. This is based on the normal and natural assumption that _roads are flat_. Mathematically, it asserts that [Gaussian curvature](https://en.wikipedia.org/wiki/Gaussian_curvature) of road is uniformly 0.<br>The sign of curvature is positive if the center of turning circle is on the left side, otherwise negative. | <br>[View in Drawio]({{ drawio("/common/autoware_trajectory/images/nomenclature/curvature.drawio.svg") }}) |
| `k_points_minimum_dist_threshold` | This is a constant threshold that is used to check if two points or values are same and to avoid zero division. | |
| `almost-same` | The pair of two points $P_{1}$ and $P_{2}$, or the pair of two base values $s_{1}$ and $s_{2}$ are called `almost-same` if their distance or difference are less than `k_points_minimum_dist_threshold` | |
## API
### Interpolators
| Class | method/function | description |
| ---------------- | ----------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| Common Functions | `minimum_required_points()` | return the number of points required for each concrete interpolator |
| | `compute(double s) -> T` | compute the interpolated value at given base $s$. $s$ is clamped to the underlying base range. |
| | `compute(vector<double> s) -> vector<T>` | compute the interpolated values at for each base values in $s$. |
| | `compute_first_derivative(double s) -> double` | compute the first derivative of at given base $s$. $s$ is clamped. |
| | `compute_second_derivative(double s) -> double` | compute the second derivative of at given base $s$. $s$ is clamped. |
`AkimaSpline` requires at least **5** points to interpolate.
```cpp title="./examples/example_readme.cpp:142:152"
--8<--
common/autoware_trajectory/examples/example_readme.cpp:142:152
--8<--
CubicSpline
requires at least 4 points to interpolate.
```cpp title=”./examples/example_readme.cpp:192:201” –8<– common/autoware_trajectory/examples/example_readme.cpp:192:201
File truncated at 100 lines see the full file
Changelog for package autoware_trajectory
1.1.0 (2025-05-01)
-
fix(autoware_trajectory): avoid nan in align_orientation_with_trajectory_direction (#398)
- fix(autoware_trajectory): avoid nan in align_orientation_with_trajectory_direction
- tidy
* remove eps ---------
-
chore(autoware_trajectory): relax the warning condition of boundary check (#393)
- chore(autoware_trajectory): relax the warning condition of boundary check
* tidy
-
feat(trajectory): define distance threshold and refine restore() without API breakage(in experimental) (#376)
- feat(trajectory): define distance threshold and refine restore
* fix spell ---------
-
feat(autoware_trajectory): add get_contained_lane_ids function (#369)
- add get_contained_lane_ids
- add unit test
* remove assert ---------
-
feat(trajectory): add pretty_build() function for Planning/Control component node (#332)
-
refactor(autoware_trajectory)!: move everything to namespace experimetal (#371) refactor(autoware_trajectory)!: move everything to namespace experimental
-
feat(trajectory): improve shift function and their documents (#337)
- feat(trajectory): add populate function
- update curvature figure for approximation desc
- update align_orientation_with_trajectory_direction fig
- finished trajectory classes
- refactored shift
- add comment
* update error message ---------
-
fix(autoware_trajectory): fix base_addition callback to work when Trajectory is moved (#370)
-
fix(autoware_trajectory): check vector size check before accessing (#365)
- fix(autoware_trajectory): check vector size check before accessing
- update
* minor fix ---------Co-authored-by: Mamoru Sobue <<hilo.soblin@gmail.com>>
-
feat(autoware_trajectory): improve performance of get_underlying_base (#298)
-
feat(trajectory): add API documentation for trajectory class, add some utillity (#295)
-
feat(trajectory): add API description, nomenclature, illustration, rename functions to align with nomenclature (#292)
- feat(trajectory): add API description, nomenclature, illustration, rename functions to align with nomenclature
* resurrect get_internal_base ---------
-
chore: include iostream and link yaml-cpp for Jazzy (#351)
-
Contributors: Mamoru Sobue, Tim Clephas, Yukinari Hisaki
1.0.0 (2025-03-31)
- feat(trajectory): remove default ctor and collect default setting in
File truncated at 100 lines see the full file
Wiki Tutorials
Package Dependencies
System Dependencies
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged autoware_trajectory at Robotics Stack Exchange
Package Summary
Tags | No category tags. |
Version | 1.1.0 |
License | Apache License 2.0 |
Build type | AMENT_CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/autowarefoundation/autoware_core.git |
VCS Type | git |
VCS Version | main |
Last Updated | 2025-06-12 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | UNRELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Yukinari Hisaki
- Takayuki Murooka
- Kosuke Takeuchi
- Mamoru Sobue
Authors
- Yukinari Hisaki
Autoware Trajectory
This package provides classes to manage/manipulate Trajectory.
Overview
Interpolators
The interpolator class interpolates given bases
and values
. Following interpolators are implemented.
- Linear
- AkimaSpline
- CubicSpline
- NearestNeighbor
- Stairstep
The builder internally executes interpolation and return the result in the form of expected<T, E>
. If successful, it contains the interpolator object.
```cpp title=”./examples/example_readme.cpp:53:68” –8<– common/autoware_trajectory/examples/example_readme.cpp:53:68 –8<–
Otherwise it contains the error object representing the failure reason. In the below snippet, cubic spline interpolation fails because the number of input points is 3, which is below the `minimum_required_points() = 4` of `CubicSpline`.
```cpp title="./examples/example_readme.cpp:109:119"
--8<--
common/autoware_trajectory/examples/example_readme.cpp:109:119
--8<--
In such cases the result expected
object contains InterpolationFailure
type with an error message like “base size 3 is less than minimum required 4”.
Trajectory class
The Trajectory class provides mathematical continuous representation and object oriented interface for discrete array of following point types
-
geometry_msgs::Point
-
geometry_msgs::Pose
-
autoware_planning_msgs::PathPoint
-
autoware_planning_msgs::PathPointWithLaneId
-
autoware_planning_msgs::TrajectoryPoint
by interpolating the given underlying points. Once built, arbitrary point on the curve is continuously parametrized by a single s
coordinate.
```cpp title=”./examples/example_readme.cpp:549:561” –8<– common/autoware_trajectory/examples/example_readme.cpp:549:561 –8<–

[View in Drawio]({{ drawio("/common/autoware_trajectory/images/overview/trajectory.drawio.svg") }})
## Nomenclature
This section introduces strict definition of several words used in this package to clarify the description of API and help the developers understand and grasp the geometric meaning of algorithms.
| Word | Meaning | Illustration |
| --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `curve` | `curve` is an oriented bounded curve denoted as `(x(s), y(s), z(s))` with additional properties, parameterized by `s` (`s = 0` at the start). | <br>[View in Drawio]({{ drawio("/common/autoware_trajectory/images/nomenclature/curve.drawio.svg") }})<br>There are 5 `underlying` points<br>$\mathrm{P0} = (0, 0, 0)$<br>$\mathrm{P1} = (1/ \sqrt{2}, 1/ \sqrt{2}, 0)$<br>$\mathrm{P2} = (1/ \sqrt{2}, 1+1/ \sqrt{2}, 0)$<br>$\mathrm{P3} = (2/ \sqrt{2}, 1+2/ \sqrt{2}, 0)$<br>$\mathrm{P4} = (2/ \sqrt{2} + 1/ \sqrt{6}, 1+2/ \sqrt{2} + 1 / \sqrt{3}, 1 / \sqrt{2})$<br>and the `arc length` between each interval is $1, 2, 1, 1$ respectively, so $\mathrm{start} = 0$ and $\mathrm{end} = 5$. |
| `underlying` | `underlying` points of a curve refers to the list of 3D points from which the curve was interpolated. | |
| `arc length`[m] | `arc length` denotes the approximate **3D** length of of a curve and is computed based on the discrete `underlying` points. | |
| `s`[m] | `s` denotes the **3D** `arc length` coordinate starting from the base point (mostly the start point) of the curve and a point is identified by `trajectory(s)`.<br>Due to this definition, the actual _curve length_ and `arc length` have subtle difference as illustrated. | <br>[View in Drawio]({{ drawio("/common/autoware_trajectory/images/nomenclature/approximation.drawio.svg") }})<br>The point for $s = 0.5$ is the purple dot, but the _curve length_ from $\mathrm{P0}$ to this point does not equal to $0.5$.<br>The exact _curve length_ is $\int \sqrt{(\frac{dx}{dt})^2 + (\frac{dy}{dt})^2 + (\frac{dz}{dt})^2} dt$, which cannot be obtained in an analytical closed form. |
| `curvature` | `curvature` is computed **using only X-Y 2D coordinate**. This is based on the normal and natural assumption that _roads are flat_. Mathematically, it asserts that [Gaussian curvature](https://en.wikipedia.org/wiki/Gaussian_curvature) of road is uniformly 0.<br>The sign of curvature is positive if the center of turning circle is on the left side, otherwise negative. | <br>[View in Drawio]({{ drawio("/common/autoware_trajectory/images/nomenclature/curvature.drawio.svg") }}) |
| `k_points_minimum_dist_threshold` | This is a constant threshold that is used to check if two points or values are same and to avoid zero division. | |
| `almost-same` | The pair of two points $P_{1}$ and $P_{2}$, or the pair of two base values $s_{1}$ and $s_{2}$ are called `almost-same` if their distance or difference are less than `k_points_minimum_dist_threshold` | |
## API
### Interpolators
| Class | method/function | description |
| ---------------- | ----------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| Common Functions | `minimum_required_points()` | return the number of points required for each concrete interpolator |
| | `compute(double s) -> T` | compute the interpolated value at given base $s$. $s$ is clamped to the underlying base range. |
| | `compute(vector<double> s) -> vector<T>` | compute the interpolated values at for each base values in $s$. |
| | `compute_first_derivative(double s) -> double` | compute the first derivative of at given base $s$. $s$ is clamped. |
| | `compute_second_derivative(double s) -> double` | compute the second derivative of at given base $s$. $s$ is clamped. |
`AkimaSpline` requires at least **5** points to interpolate.
```cpp title="./examples/example_readme.cpp:142:152"
--8<--
common/autoware_trajectory/examples/example_readme.cpp:142:152
--8<--
CubicSpline
requires at least 4 points to interpolate.
```cpp title=”./examples/example_readme.cpp:192:201” –8<– common/autoware_trajectory/examples/example_readme.cpp:192:201
File truncated at 100 lines see the full file
Changelog for package autoware_trajectory
1.1.0 (2025-05-01)
-
fix(autoware_trajectory): avoid nan in align_orientation_with_trajectory_direction (#398)
- fix(autoware_trajectory): avoid nan in align_orientation_with_trajectory_direction
- tidy
* remove eps ---------
-
chore(autoware_trajectory): relax the warning condition of boundary check (#393)
- chore(autoware_trajectory): relax the warning condition of boundary check
* tidy
-
feat(trajectory): define distance threshold and refine restore() without API breakage(in experimental) (#376)
- feat(trajectory): define distance threshold and refine restore
* fix spell ---------
-
feat(autoware_trajectory): add get_contained_lane_ids function (#369)
- add get_contained_lane_ids
- add unit test
* remove assert ---------
-
feat(trajectory): add pretty_build() function for Planning/Control component node (#332)
-
refactor(autoware_trajectory)!: move everything to namespace experimetal (#371) refactor(autoware_trajectory)!: move everything to namespace experimental
-
feat(trajectory): improve shift function and their documents (#337)
- feat(trajectory): add populate function
- update curvature figure for approximation desc
- update align_orientation_with_trajectory_direction fig
- finished trajectory classes
- refactored shift
- add comment
* update error message ---------
-
fix(autoware_trajectory): fix base_addition callback to work when Trajectory is moved (#370)
-
fix(autoware_trajectory): check vector size check before accessing (#365)
- fix(autoware_trajectory): check vector size check before accessing
- update
* minor fix ---------Co-authored-by: Mamoru Sobue <<hilo.soblin@gmail.com>>
-
feat(autoware_trajectory): improve performance of get_underlying_base (#298)
-
feat(trajectory): add API documentation for trajectory class, add some utillity (#295)
-
feat(trajectory): add API description, nomenclature, illustration, rename functions to align with nomenclature (#292)
- feat(trajectory): add API description, nomenclature, illustration, rename functions to align with nomenclature
* resurrect get_internal_base ---------
-
chore: include iostream and link yaml-cpp for Jazzy (#351)
-
Contributors: Mamoru Sobue, Tim Clephas, Yukinari Hisaki
1.0.0 (2025-03-31)
- feat(trajectory): remove default ctor and collect default setting in
File truncated at 100 lines see the full file
Wiki Tutorials
Package Dependencies
System Dependencies
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged autoware_trajectory at Robotics Stack Exchange
Package Summary
Tags | No category tags. |
Version | 1.1.0 |
License | Apache License 2.0 |
Build type | AMENT_CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/autowarefoundation/autoware_core.git |
VCS Type | git |
VCS Version | main |
Last Updated | 2025-06-12 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | UNRELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Yukinari Hisaki
- Takayuki Murooka
- Kosuke Takeuchi
- Mamoru Sobue
Authors
- Yukinari Hisaki
Autoware Trajectory
This package provides classes to manage/manipulate Trajectory.
Overview
Interpolators
The interpolator class interpolates given bases
and values
. Following interpolators are implemented.
- Linear
- AkimaSpline
- CubicSpline
- NearestNeighbor
- Stairstep
The builder internally executes interpolation and return the result in the form of expected<T, E>
. If successful, it contains the interpolator object.
```cpp title=”./examples/example_readme.cpp:53:68” –8<– common/autoware_trajectory/examples/example_readme.cpp:53:68 –8<–
Otherwise it contains the error object representing the failure reason. In the below snippet, cubic spline interpolation fails because the number of input points is 3, which is below the `minimum_required_points() = 4` of `CubicSpline`.
```cpp title="./examples/example_readme.cpp:109:119"
--8<--
common/autoware_trajectory/examples/example_readme.cpp:109:119
--8<--
In such cases the result expected
object contains InterpolationFailure
type with an error message like “base size 3 is less than minimum required 4”.
Trajectory class
The Trajectory class provides mathematical continuous representation and object oriented interface for discrete array of following point types
-
geometry_msgs::Point
-
geometry_msgs::Pose
-
autoware_planning_msgs::PathPoint
-
autoware_planning_msgs::PathPointWithLaneId
-
autoware_planning_msgs::TrajectoryPoint
by interpolating the given underlying points. Once built, arbitrary point on the curve is continuously parametrized by a single s
coordinate.
```cpp title=”./examples/example_readme.cpp:549:561” –8<– common/autoware_trajectory/examples/example_readme.cpp:549:561 –8<–

[View in Drawio]({{ drawio("/common/autoware_trajectory/images/overview/trajectory.drawio.svg") }})
## Nomenclature
This section introduces strict definition of several words used in this package to clarify the description of API and help the developers understand and grasp the geometric meaning of algorithms.
| Word | Meaning | Illustration |
| --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `curve` | `curve` is an oriented bounded curve denoted as `(x(s), y(s), z(s))` with additional properties, parameterized by `s` (`s = 0` at the start). | <br>[View in Drawio]({{ drawio("/common/autoware_trajectory/images/nomenclature/curve.drawio.svg") }})<br>There are 5 `underlying` points<br>$\mathrm{P0} = (0, 0, 0)$<br>$\mathrm{P1} = (1/ \sqrt{2}, 1/ \sqrt{2}, 0)$<br>$\mathrm{P2} = (1/ \sqrt{2}, 1+1/ \sqrt{2}, 0)$<br>$\mathrm{P3} = (2/ \sqrt{2}, 1+2/ \sqrt{2}, 0)$<br>$\mathrm{P4} = (2/ \sqrt{2} + 1/ \sqrt{6}, 1+2/ \sqrt{2} + 1 / \sqrt{3}, 1 / \sqrt{2})$<br>and the `arc length` between each interval is $1, 2, 1, 1$ respectively, so $\mathrm{start} = 0$ and $\mathrm{end} = 5$. |
| `underlying` | `underlying` points of a curve refers to the list of 3D points from which the curve was interpolated. | |
| `arc length`[m] | `arc length` denotes the approximate **3D** length of of a curve and is computed based on the discrete `underlying` points. | |
| `s`[m] | `s` denotes the **3D** `arc length` coordinate starting from the base point (mostly the start point) of the curve and a point is identified by `trajectory(s)`.<br>Due to this definition, the actual _curve length_ and `arc length` have subtle difference as illustrated. | <br>[View in Drawio]({{ drawio("/common/autoware_trajectory/images/nomenclature/approximation.drawio.svg") }})<br>The point for $s = 0.5$ is the purple dot, but the _curve length_ from $\mathrm{P0}$ to this point does not equal to $0.5$.<br>The exact _curve length_ is $\int \sqrt{(\frac{dx}{dt})^2 + (\frac{dy}{dt})^2 + (\frac{dz}{dt})^2} dt$, which cannot be obtained in an analytical closed form. |
| `curvature` | `curvature` is computed **using only X-Y 2D coordinate**. This is based on the normal and natural assumption that _roads are flat_. Mathematically, it asserts that [Gaussian curvature](https://en.wikipedia.org/wiki/Gaussian_curvature) of road is uniformly 0.<br>The sign of curvature is positive if the center of turning circle is on the left side, otherwise negative. | <br>[View in Drawio]({{ drawio("/common/autoware_trajectory/images/nomenclature/curvature.drawio.svg") }}) |
| `k_points_minimum_dist_threshold` | This is a constant threshold that is used to check if two points or values are same and to avoid zero division. | |
| `almost-same` | The pair of two points $P_{1}$ and $P_{2}$, or the pair of two base values $s_{1}$ and $s_{2}$ are called `almost-same` if their distance or difference are less than `k_points_minimum_dist_threshold` | |
## API
### Interpolators
| Class | method/function | description |
| ---------------- | ----------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| Common Functions | `minimum_required_points()` | return the number of points required for each concrete interpolator |
| | `compute(double s) -> T` | compute the interpolated value at given base $s$. $s$ is clamped to the underlying base range. |
| | `compute(vector<double> s) -> vector<T>` | compute the interpolated values at for each base values in $s$. |
| | `compute_first_derivative(double s) -> double` | compute the first derivative of at given base $s$. $s$ is clamped. |
| | `compute_second_derivative(double s) -> double` | compute the second derivative of at given base $s$. $s$ is clamped. |
`AkimaSpline` requires at least **5** points to interpolate.
```cpp title="./examples/example_readme.cpp:142:152"
--8<--
common/autoware_trajectory/examples/example_readme.cpp:142:152
--8<--
CubicSpline
requires at least 4 points to interpolate.
```cpp title=”./examples/example_readme.cpp:192:201” –8<– common/autoware_trajectory/examples/example_readme.cpp:192:201
File truncated at 100 lines see the full file
Changelog for package autoware_trajectory
1.1.0 (2025-05-01)
-
fix(autoware_trajectory): avoid nan in align_orientation_with_trajectory_direction (#398)
- fix(autoware_trajectory): avoid nan in align_orientation_with_trajectory_direction
- tidy
* remove eps ---------
-
chore(autoware_trajectory): relax the warning condition of boundary check (#393)
- chore(autoware_trajectory): relax the warning condition of boundary check
* tidy
-
feat(trajectory): define distance threshold and refine restore() without API breakage(in experimental) (#376)
- feat(trajectory): define distance threshold and refine restore
* fix spell ---------
-
feat(autoware_trajectory): add get_contained_lane_ids function (#369)
- add get_contained_lane_ids
- add unit test
* remove assert ---------
-
feat(trajectory): add pretty_build() function for Planning/Control component node (#332)
-
refactor(autoware_trajectory)!: move everything to namespace experimetal (#371) refactor(autoware_trajectory)!: move everything to namespace experimental
-
feat(trajectory): improve shift function and their documents (#337)
- feat(trajectory): add populate function
- update curvature figure for approximation desc
- update align_orientation_with_trajectory_direction fig
- finished trajectory classes
- refactored shift
- add comment
* update error message ---------
-
fix(autoware_trajectory): fix base_addition callback to work when Trajectory is moved (#370)
-
fix(autoware_trajectory): check vector size check before accessing (#365)
- fix(autoware_trajectory): check vector size check before accessing
- update
* minor fix ---------Co-authored-by: Mamoru Sobue <<hilo.soblin@gmail.com>>
-
feat(autoware_trajectory): improve performance of get_underlying_base (#298)
-
feat(trajectory): add API documentation for trajectory class, add some utillity (#295)
-
feat(trajectory): add API description, nomenclature, illustration, rename functions to align with nomenclature (#292)
- feat(trajectory): add API description, nomenclature, illustration, rename functions to align with nomenclature
* resurrect get_internal_base ---------
-
chore: include iostream and link yaml-cpp for Jazzy (#351)
-
Contributors: Mamoru Sobue, Tim Clephas, Yukinari Hisaki
1.0.0 (2025-03-31)
- feat(trajectory): remove default ctor and collect default setting in
File truncated at 100 lines see the full file
Wiki Tutorials
Package Dependencies
System Dependencies
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged autoware_trajectory at Robotics Stack Exchange
Package Summary
Tags | No category tags. |
Version | 1.1.0 |
License | Apache License 2.0 |
Build type | AMENT_CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/autowarefoundation/autoware_core.git |
VCS Type | git |
VCS Version | main |
Last Updated | 2025-06-12 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | UNRELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Yukinari Hisaki
- Takayuki Murooka
- Kosuke Takeuchi
- Mamoru Sobue
Authors
- Yukinari Hisaki
Autoware Trajectory
This package provides classes to manage/manipulate Trajectory.
Overview
Interpolators
The interpolator class interpolates given bases
and values
. Following interpolators are implemented.
- Linear
- AkimaSpline
- CubicSpline
- NearestNeighbor
- Stairstep
The builder internally executes interpolation and return the result in the form of expected<T, E>
. If successful, it contains the interpolator object.
```cpp title=”./examples/example_readme.cpp:53:68” –8<– common/autoware_trajectory/examples/example_readme.cpp:53:68 –8<–
Otherwise it contains the error object representing the failure reason. In the below snippet, cubic spline interpolation fails because the number of input points is 3, which is below the `minimum_required_points() = 4` of `CubicSpline`.
```cpp title="./examples/example_readme.cpp:109:119"
--8<--
common/autoware_trajectory/examples/example_readme.cpp:109:119
--8<--
In such cases the result expected
object contains InterpolationFailure
type with an error message like “base size 3 is less than minimum required 4”.
Trajectory class
The Trajectory class provides mathematical continuous representation and object oriented interface for discrete array of following point types
-
geometry_msgs::Point
-
geometry_msgs::Pose
-
autoware_planning_msgs::PathPoint
-
autoware_planning_msgs::PathPointWithLaneId
-
autoware_planning_msgs::TrajectoryPoint
by interpolating the given underlying points. Once built, arbitrary point on the curve is continuously parametrized by a single s
coordinate.
```cpp title=”./examples/example_readme.cpp:549:561” –8<– common/autoware_trajectory/examples/example_readme.cpp:549:561 –8<–

[View in Drawio]({{ drawio("/common/autoware_trajectory/images/overview/trajectory.drawio.svg") }})
## Nomenclature
This section introduces strict definition of several words used in this package to clarify the description of API and help the developers understand and grasp the geometric meaning of algorithms.
| Word | Meaning | Illustration |
| --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `curve` | `curve` is an oriented bounded curve denoted as `(x(s), y(s), z(s))` with additional properties, parameterized by `s` (`s = 0` at the start). | <br>[View in Drawio]({{ drawio("/common/autoware_trajectory/images/nomenclature/curve.drawio.svg") }})<br>There are 5 `underlying` points<br>$\mathrm{P0} = (0, 0, 0)$<br>$\mathrm{P1} = (1/ \sqrt{2}, 1/ \sqrt{2}, 0)$<br>$\mathrm{P2} = (1/ \sqrt{2}, 1+1/ \sqrt{2}, 0)$<br>$\mathrm{P3} = (2/ \sqrt{2}, 1+2/ \sqrt{2}, 0)$<br>$\mathrm{P4} = (2/ \sqrt{2} + 1/ \sqrt{6}, 1+2/ \sqrt{2} + 1 / \sqrt{3}, 1 / \sqrt{2})$<br>and the `arc length` between each interval is $1, 2, 1, 1$ respectively, so $\mathrm{start} = 0$ and $\mathrm{end} = 5$. |
| `underlying` | `underlying` points of a curve refers to the list of 3D points from which the curve was interpolated. | |
| `arc length`[m] | `arc length` denotes the approximate **3D** length of of a curve and is computed based on the discrete `underlying` points. | |
| `s`[m] | `s` denotes the **3D** `arc length` coordinate starting from the base point (mostly the start point) of the curve and a point is identified by `trajectory(s)`.<br>Due to this definition, the actual _curve length_ and `arc length` have subtle difference as illustrated. | <br>[View in Drawio]({{ drawio("/common/autoware_trajectory/images/nomenclature/approximation.drawio.svg") }})<br>The point for $s = 0.5$ is the purple dot, but the _curve length_ from $\mathrm{P0}$ to this point does not equal to $0.5$.<br>The exact _curve length_ is $\int \sqrt{(\frac{dx}{dt})^2 + (\frac{dy}{dt})^2 + (\frac{dz}{dt})^2} dt$, which cannot be obtained in an analytical closed form. |
| `curvature` | `curvature` is computed **using only X-Y 2D coordinate**. This is based on the normal and natural assumption that _roads are flat_. Mathematically, it asserts that [Gaussian curvature](https://en.wikipedia.org/wiki/Gaussian_curvature) of road is uniformly 0.<br>The sign of curvature is positive if the center of turning circle is on the left side, otherwise negative. | <br>[View in Drawio]({{ drawio("/common/autoware_trajectory/images/nomenclature/curvature.drawio.svg") }}) |
| `k_points_minimum_dist_threshold` | This is a constant threshold that is used to check if two points or values are same and to avoid zero division. | |
| `almost-same` | The pair of two points $P_{1}$ and $P_{2}$, or the pair of two base values $s_{1}$ and $s_{2}$ are called `almost-same` if their distance or difference are less than `k_points_minimum_dist_threshold` | |
## API
### Interpolators
| Class | method/function | description |
| ---------------- | ----------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| Common Functions | `minimum_required_points()` | return the number of points required for each concrete interpolator |
| | `compute(double s) -> T` | compute the interpolated value at given base $s$. $s$ is clamped to the underlying base range. |
| | `compute(vector<double> s) -> vector<T>` | compute the interpolated values at for each base values in $s$. |
| | `compute_first_derivative(double s) -> double` | compute the first derivative of at given base $s$. $s$ is clamped. |
| | `compute_second_derivative(double s) -> double` | compute the second derivative of at given base $s$. $s$ is clamped. |
`AkimaSpline` requires at least **5** points to interpolate.
```cpp title="./examples/example_readme.cpp:142:152"
--8<--
common/autoware_trajectory/examples/example_readme.cpp:142:152
--8<--
CubicSpline
requires at least 4 points to interpolate.
```cpp title=”./examples/example_readme.cpp:192:201” –8<– common/autoware_trajectory/examples/example_readme.cpp:192:201
File truncated at 100 lines see the full file
Changelog for package autoware_trajectory
1.1.0 (2025-05-01)
-
fix(autoware_trajectory): avoid nan in align_orientation_with_trajectory_direction (#398)
- fix(autoware_trajectory): avoid nan in align_orientation_with_trajectory_direction
- tidy
* remove eps ---------
-
chore(autoware_trajectory): relax the warning condition of boundary check (#393)
- chore(autoware_trajectory): relax the warning condition of boundary check
* tidy
-
feat(trajectory): define distance threshold and refine restore() without API breakage(in experimental) (#376)
- feat(trajectory): define distance threshold and refine restore
* fix spell ---------
-
feat(autoware_trajectory): add get_contained_lane_ids function (#369)
- add get_contained_lane_ids
- add unit test
* remove assert ---------
-
feat(trajectory): add pretty_build() function for Planning/Control component node (#332)
-
refactor(autoware_trajectory)!: move everything to namespace experimetal (#371) refactor(autoware_trajectory)!: move everything to namespace experimental
-
feat(trajectory): improve shift function and their documents (#337)
- feat(trajectory): add populate function
- update curvature figure for approximation desc
- update align_orientation_with_trajectory_direction fig
- finished trajectory classes
- refactored shift
- add comment
* update error message ---------
-
fix(autoware_trajectory): fix base_addition callback to work when Trajectory is moved (#370)
-
fix(autoware_trajectory): check vector size check before accessing (#365)
- fix(autoware_trajectory): check vector size check before accessing
- update
* minor fix ---------Co-authored-by: Mamoru Sobue <<hilo.soblin@gmail.com>>
-
feat(autoware_trajectory): improve performance of get_underlying_base (#298)
-
feat(trajectory): add API documentation for trajectory class, add some utillity (#295)
-
feat(trajectory): add API description, nomenclature, illustration, rename functions to align with nomenclature (#292)
- feat(trajectory): add API description, nomenclature, illustration, rename functions to align with nomenclature
* resurrect get_internal_base ---------
-
chore: include iostream and link yaml-cpp for Jazzy (#351)
-
Contributors: Mamoru Sobue, Tim Clephas, Yukinari Hisaki
1.0.0 (2025-03-31)
- feat(trajectory): remove default ctor and collect default setting in
File truncated at 100 lines see the full file
Wiki Tutorials
Package Dependencies
System Dependencies
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged autoware_trajectory at Robotics Stack Exchange
Package Summary
Tags | No category tags. |
Version | 1.1.0 |
License | Apache License 2.0 |
Build type | AMENT_CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/autowarefoundation/autoware_core.git |
VCS Type | git |
VCS Version | main |
Last Updated | 2025-06-12 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | UNRELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Yukinari Hisaki
- Takayuki Murooka
- Kosuke Takeuchi
- Mamoru Sobue
Authors
- Yukinari Hisaki
Autoware Trajectory
This package provides classes to manage/manipulate Trajectory.
Overview
Interpolators
The interpolator class interpolates given bases
and values
. Following interpolators are implemented.
- Linear
- AkimaSpline
- CubicSpline
- NearestNeighbor
- Stairstep
The builder internally executes interpolation and return the result in the form of expected<T, E>
. If successful, it contains the interpolator object.
```cpp title=”./examples/example_readme.cpp:53:68” –8<– common/autoware_trajectory/examples/example_readme.cpp:53:68 –8<–
Otherwise it contains the error object representing the failure reason. In the below snippet, cubic spline interpolation fails because the number of input points is 3, which is below the `minimum_required_points() = 4` of `CubicSpline`.
```cpp title="./examples/example_readme.cpp:109:119"
--8<--
common/autoware_trajectory/examples/example_readme.cpp:109:119
--8<--
In such cases the result expected
object contains InterpolationFailure
type with an error message like “base size 3 is less than minimum required 4”.
Trajectory class
The Trajectory class provides mathematical continuous representation and object oriented interface for discrete array of following point types
-
geometry_msgs::Point
-
geometry_msgs::Pose
-
autoware_planning_msgs::PathPoint
-
autoware_planning_msgs::PathPointWithLaneId
-
autoware_planning_msgs::TrajectoryPoint
by interpolating the given underlying points. Once built, arbitrary point on the curve is continuously parametrized by a single s
coordinate.
```cpp title=”./examples/example_readme.cpp:549:561” –8<– common/autoware_trajectory/examples/example_readme.cpp:549:561 –8<–

[View in Drawio]({{ drawio("/common/autoware_trajectory/images/overview/trajectory.drawio.svg") }})
## Nomenclature
This section introduces strict definition of several words used in this package to clarify the description of API and help the developers understand and grasp the geometric meaning of algorithms.
| Word | Meaning | Illustration |
| --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `curve` | `curve` is an oriented bounded curve denoted as `(x(s), y(s), z(s))` with additional properties, parameterized by `s` (`s = 0` at the start). | <br>[View in Drawio]({{ drawio("/common/autoware_trajectory/images/nomenclature/curve.drawio.svg") }})<br>There are 5 `underlying` points<br>$\mathrm{P0} = (0, 0, 0)$<br>$\mathrm{P1} = (1/ \sqrt{2}, 1/ \sqrt{2}, 0)$<br>$\mathrm{P2} = (1/ \sqrt{2}, 1+1/ \sqrt{2}, 0)$<br>$\mathrm{P3} = (2/ \sqrt{2}, 1+2/ \sqrt{2}, 0)$<br>$\mathrm{P4} = (2/ \sqrt{2} + 1/ \sqrt{6}, 1+2/ \sqrt{2} + 1 / \sqrt{3}, 1 / \sqrt{2})$<br>and the `arc length` between each interval is $1, 2, 1, 1$ respectively, so $\mathrm{start} = 0$ and $\mathrm{end} = 5$. |
| `underlying` | `underlying` points of a curve refers to the list of 3D points from which the curve was interpolated. | |
| `arc length`[m] | `arc length` denotes the approximate **3D** length of of a curve and is computed based on the discrete `underlying` points. | |
| `s`[m] | `s` denotes the **3D** `arc length` coordinate starting from the base point (mostly the start point) of the curve and a point is identified by `trajectory(s)`.<br>Due to this definition, the actual _curve length_ and `arc length` have subtle difference as illustrated. | <br>[View in Drawio]({{ drawio("/common/autoware_trajectory/images/nomenclature/approximation.drawio.svg") }})<br>The point for $s = 0.5$ is the purple dot, but the _curve length_ from $\mathrm{P0}$ to this point does not equal to $0.5$.<br>The exact _curve length_ is $\int \sqrt{(\frac{dx}{dt})^2 + (\frac{dy}{dt})^2 + (\frac{dz}{dt})^2} dt$, which cannot be obtained in an analytical closed form. |
| `curvature` | `curvature` is computed **using only X-Y 2D coordinate**. This is based on the normal and natural assumption that _roads are flat_. Mathematically, it asserts that [Gaussian curvature](https://en.wikipedia.org/wiki/Gaussian_curvature) of road is uniformly 0.<br>The sign of curvature is positive if the center of turning circle is on the left side, otherwise negative. | <br>[View in Drawio]({{ drawio("/common/autoware_trajectory/images/nomenclature/curvature.drawio.svg") }}) |
| `k_points_minimum_dist_threshold` | This is a constant threshold that is used to check if two points or values are same and to avoid zero division. | |
| `almost-same` | The pair of two points $P_{1}$ and $P_{2}$, or the pair of two base values $s_{1}$ and $s_{2}$ are called `almost-same` if their distance or difference are less than `k_points_minimum_dist_threshold` | |
## API
### Interpolators
| Class | method/function | description |
| ---------------- | ----------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| Common Functions | `minimum_required_points()` | return the number of points required for each concrete interpolator |
| | `compute(double s) -> T` | compute the interpolated value at given base $s$. $s$ is clamped to the underlying base range. |
| | `compute(vector<double> s) -> vector<T>` | compute the interpolated values at for each base values in $s$. |
| | `compute_first_derivative(double s) -> double` | compute the first derivative of at given base $s$. $s$ is clamped. |
| | `compute_second_derivative(double s) -> double` | compute the second derivative of at given base $s$. $s$ is clamped. |
`AkimaSpline` requires at least **5** points to interpolate.
```cpp title="./examples/example_readme.cpp:142:152"
--8<--
common/autoware_trajectory/examples/example_readme.cpp:142:152
--8<--
CubicSpline
requires at least 4 points to interpolate.
```cpp title=”./examples/example_readme.cpp:192:201” –8<– common/autoware_trajectory/examples/example_readme.cpp:192:201
File truncated at 100 lines see the full file
Changelog for package autoware_trajectory
1.1.0 (2025-05-01)
-
fix(autoware_trajectory): avoid nan in align_orientation_with_trajectory_direction (#398)
- fix(autoware_trajectory): avoid nan in align_orientation_with_trajectory_direction
- tidy
* remove eps ---------
-
chore(autoware_trajectory): relax the warning condition of boundary check (#393)
- chore(autoware_trajectory): relax the warning condition of boundary check
* tidy
-
feat(trajectory): define distance threshold and refine restore() without API breakage(in experimental) (#376)
- feat(trajectory): define distance threshold and refine restore
* fix spell ---------
-
feat(autoware_trajectory): add get_contained_lane_ids function (#369)
- add get_contained_lane_ids
- add unit test
* remove assert ---------
-
feat(trajectory): add pretty_build() function for Planning/Control component node (#332)
-
refactor(autoware_trajectory)!: move everything to namespace experimetal (#371) refactor(autoware_trajectory)!: move everything to namespace experimental
-
feat(trajectory): improve shift function and their documents (#337)
- feat(trajectory): add populate function
- update curvature figure for approximation desc
- update align_orientation_with_trajectory_direction fig
- finished trajectory classes
- refactored shift
- add comment
* update error message ---------
-
fix(autoware_trajectory): fix base_addition callback to work when Trajectory is moved (#370)
-
fix(autoware_trajectory): check vector size check before accessing (#365)
- fix(autoware_trajectory): check vector size check before accessing
- update
* minor fix ---------Co-authored-by: Mamoru Sobue <<hilo.soblin@gmail.com>>
-
feat(autoware_trajectory): improve performance of get_underlying_base (#298)
-
feat(trajectory): add API documentation for trajectory class, add some utillity (#295)
-
feat(trajectory): add API description, nomenclature, illustration, rename functions to align with nomenclature (#292)
- feat(trajectory): add API description, nomenclature, illustration, rename functions to align with nomenclature
* resurrect get_internal_base ---------
-
chore: include iostream and link yaml-cpp for Jazzy (#351)
-
Contributors: Mamoru Sobue, Tim Clephas, Yukinari Hisaki
1.0.0 (2025-03-31)
- feat(trajectory): remove default ctor and collect default setting in
File truncated at 100 lines see the full file
Wiki Tutorials
Package Dependencies
System Dependencies
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged autoware_trajectory at Robotics Stack Exchange
Package Summary
Tags | No category tags. |
Version | 1.1.0 |
License | Apache License 2.0 |
Build type | AMENT_CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/autowarefoundation/autoware_core.git |
VCS Type | git |
VCS Version | main |
Last Updated | 2025-06-12 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | UNRELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Yukinari Hisaki
- Takayuki Murooka
- Kosuke Takeuchi
- Mamoru Sobue
Authors
- Yukinari Hisaki
Autoware Trajectory
This package provides classes to manage/manipulate Trajectory.
Overview
Interpolators
The interpolator class interpolates given bases
and values
. Following interpolators are implemented.
- Linear
- AkimaSpline
- CubicSpline
- NearestNeighbor
- Stairstep
The builder internally executes interpolation and return the result in the form of expected<T, E>
. If successful, it contains the interpolator object.
```cpp title=”./examples/example_readme.cpp:53:68” –8<– common/autoware_trajectory/examples/example_readme.cpp:53:68 –8<–
Otherwise it contains the error object representing the failure reason. In the below snippet, cubic spline interpolation fails because the number of input points is 3, which is below the `minimum_required_points() = 4` of `CubicSpline`.
```cpp title="./examples/example_readme.cpp:109:119"
--8<--
common/autoware_trajectory/examples/example_readme.cpp:109:119
--8<--
In such cases the result expected
object contains InterpolationFailure
type with an error message like “base size 3 is less than minimum required 4”.
Trajectory class
The Trajectory class provides mathematical continuous representation and object oriented interface for discrete array of following point types
-
geometry_msgs::Point
-
geometry_msgs::Pose
-
autoware_planning_msgs::PathPoint
-
autoware_planning_msgs::PathPointWithLaneId
-
autoware_planning_msgs::TrajectoryPoint
by interpolating the given underlying points. Once built, arbitrary point on the curve is continuously parametrized by a single s
coordinate.
```cpp title=”./examples/example_readme.cpp:549:561” –8<– common/autoware_trajectory/examples/example_readme.cpp:549:561 –8<–

[View in Drawio]({{ drawio("/common/autoware_trajectory/images/overview/trajectory.drawio.svg") }})
## Nomenclature
This section introduces strict definition of several words used in this package to clarify the description of API and help the developers understand and grasp the geometric meaning of algorithms.
| Word | Meaning | Illustration |
| --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `curve` | `curve` is an oriented bounded curve denoted as `(x(s), y(s), z(s))` with additional properties, parameterized by `s` (`s = 0` at the start). | <br>[View in Drawio]({{ drawio("/common/autoware_trajectory/images/nomenclature/curve.drawio.svg") }})<br>There are 5 `underlying` points<br>$\mathrm{P0} = (0, 0, 0)$<br>$\mathrm{P1} = (1/ \sqrt{2}, 1/ \sqrt{2}, 0)$<br>$\mathrm{P2} = (1/ \sqrt{2}, 1+1/ \sqrt{2}, 0)$<br>$\mathrm{P3} = (2/ \sqrt{2}, 1+2/ \sqrt{2}, 0)$<br>$\mathrm{P4} = (2/ \sqrt{2} + 1/ \sqrt{6}, 1+2/ \sqrt{2} + 1 / \sqrt{3}, 1 / \sqrt{2})$<br>and the `arc length` between each interval is $1, 2, 1, 1$ respectively, so $\mathrm{start} = 0$ and $\mathrm{end} = 5$. |
| `underlying` | `underlying` points of a curve refers to the list of 3D points from which the curve was interpolated. | |
| `arc length`[m] | `arc length` denotes the approximate **3D** length of of a curve and is computed based on the discrete `underlying` points. | |
| `s`[m] | `s` denotes the **3D** `arc length` coordinate starting from the base point (mostly the start point) of the curve and a point is identified by `trajectory(s)`.<br>Due to this definition, the actual _curve length_ and `arc length` have subtle difference as illustrated. | <br>[View in Drawio]({{ drawio("/common/autoware_trajectory/images/nomenclature/approximation.drawio.svg") }})<br>The point for $s = 0.5$ is the purple dot, but the _curve length_ from $\mathrm{P0}$ to this point does not equal to $0.5$.<br>The exact _curve length_ is $\int \sqrt{(\frac{dx}{dt})^2 + (\frac{dy}{dt})^2 + (\frac{dz}{dt})^2} dt$, which cannot be obtained in an analytical closed form. |
| `curvature` | `curvature` is computed **using only X-Y 2D coordinate**. This is based on the normal and natural assumption that _roads are flat_. Mathematically, it asserts that [Gaussian curvature](https://en.wikipedia.org/wiki/Gaussian_curvature) of road is uniformly 0.<br>The sign of curvature is positive if the center of turning circle is on the left side, otherwise negative. | <br>[View in Drawio]({{ drawio("/common/autoware_trajectory/images/nomenclature/curvature.drawio.svg") }}) |
| `k_points_minimum_dist_threshold` | This is a constant threshold that is used to check if two points or values are same and to avoid zero division. | |
| `almost-same` | The pair of two points $P_{1}$ and $P_{2}$, or the pair of two base values $s_{1}$ and $s_{2}$ are called `almost-same` if their distance or difference are less than `k_points_minimum_dist_threshold` | |
## API
### Interpolators
| Class | method/function | description |
| ---------------- | ----------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| Common Functions | `minimum_required_points()` | return the number of points required for each concrete interpolator |
| | `compute(double s) -> T` | compute the interpolated value at given base $s$. $s$ is clamped to the underlying base range. |
| | `compute(vector<double> s) -> vector<T>` | compute the interpolated values at for each base values in $s$. |
| | `compute_first_derivative(double s) -> double` | compute the first derivative of at given base $s$. $s$ is clamped. |
| | `compute_second_derivative(double s) -> double` | compute the second derivative of at given base $s$. $s$ is clamped. |
`AkimaSpline` requires at least **5** points to interpolate.
```cpp title="./examples/example_readme.cpp:142:152"
--8<--
common/autoware_trajectory/examples/example_readme.cpp:142:152
--8<--
CubicSpline
requires at least 4 points to interpolate.
```cpp title=”./examples/example_readme.cpp:192:201” –8<– common/autoware_trajectory/examples/example_readme.cpp:192:201
File truncated at 100 lines see the full file
Changelog for package autoware_trajectory
1.1.0 (2025-05-01)
-
fix(autoware_trajectory): avoid nan in align_orientation_with_trajectory_direction (#398)
- fix(autoware_trajectory): avoid nan in align_orientation_with_trajectory_direction
- tidy
* remove eps ---------
-
chore(autoware_trajectory): relax the warning condition of boundary check (#393)
- chore(autoware_trajectory): relax the warning condition of boundary check
* tidy
-
feat(trajectory): define distance threshold and refine restore() without API breakage(in experimental) (#376)
- feat(trajectory): define distance threshold and refine restore
* fix spell ---------
-
feat(autoware_trajectory): add get_contained_lane_ids function (#369)
- add get_contained_lane_ids
- add unit test
* remove assert ---------
-
feat(trajectory): add pretty_build() function for Planning/Control component node (#332)
-
refactor(autoware_trajectory)!: move everything to namespace experimetal (#371) refactor(autoware_trajectory)!: move everything to namespace experimental
-
feat(trajectory): improve shift function and their documents (#337)
- feat(trajectory): add populate function
- update curvature figure for approximation desc
- update align_orientation_with_trajectory_direction fig
- finished trajectory classes
- refactored shift
- add comment
* update error message ---------
-
fix(autoware_trajectory): fix base_addition callback to work when Trajectory is moved (#370)
-
fix(autoware_trajectory): check vector size check before accessing (#365)
- fix(autoware_trajectory): check vector size check before accessing
- update
* minor fix ---------Co-authored-by: Mamoru Sobue <<hilo.soblin@gmail.com>>
-
feat(autoware_trajectory): improve performance of get_underlying_base (#298)
-
feat(trajectory): add API documentation for trajectory class, add some utillity (#295)
-
feat(trajectory): add API description, nomenclature, illustration, rename functions to align with nomenclature (#292)
- feat(trajectory): add API description, nomenclature, illustration, rename functions to align with nomenclature
* resurrect get_internal_base ---------
-
chore: include iostream and link yaml-cpp for Jazzy (#351)
-
Contributors: Mamoru Sobue, Tim Clephas, Yukinari Hisaki
1.0.0 (2025-03-31)
- feat(trajectory): remove default ctor and collect default setting in
File truncated at 100 lines see the full file
Wiki Tutorials
Package Dependencies
System Dependencies
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged autoware_trajectory at Robotics Stack Exchange
Package Summary
Tags | No category tags. |
Version | 1.1.0 |
License | Apache License 2.0 |
Build type | AMENT_CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/autowarefoundation/autoware_core.git |
VCS Type | git |
VCS Version | main |
Last Updated | 2025-06-12 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | UNRELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Yukinari Hisaki
- Takayuki Murooka
- Kosuke Takeuchi
- Mamoru Sobue
Authors
- Yukinari Hisaki
Autoware Trajectory
This package provides classes to manage/manipulate Trajectory.
Overview
Interpolators
The interpolator class interpolates given bases
and values
. Following interpolators are implemented.
- Linear
- AkimaSpline
- CubicSpline
- NearestNeighbor
- Stairstep
The builder internally executes interpolation and return the result in the form of expected<T, E>
. If successful, it contains the interpolator object.
```cpp title=”./examples/example_readme.cpp:53:68” –8<– common/autoware_trajectory/examples/example_readme.cpp:53:68 –8<–
Otherwise it contains the error object representing the failure reason. In the below snippet, cubic spline interpolation fails because the number of input points is 3, which is below the `minimum_required_points() = 4` of `CubicSpline`.
```cpp title="./examples/example_readme.cpp:109:119"
--8<--
common/autoware_trajectory/examples/example_readme.cpp:109:119
--8<--
In such cases the result expected
object contains InterpolationFailure
type with an error message like “base size 3 is less than minimum required 4”.
Trajectory class
The Trajectory class provides mathematical continuous representation and object oriented interface for discrete array of following point types
-
geometry_msgs::Point
-
geometry_msgs::Pose
-
autoware_planning_msgs::PathPoint
-
autoware_planning_msgs::PathPointWithLaneId
-
autoware_planning_msgs::TrajectoryPoint
by interpolating the given underlying points. Once built, arbitrary point on the curve is continuously parametrized by a single s
coordinate.
```cpp title=”./examples/example_readme.cpp:549:561” –8<– common/autoware_trajectory/examples/example_readme.cpp:549:561 –8<–

[View in Drawio]({{ drawio("/common/autoware_trajectory/images/overview/trajectory.drawio.svg") }})
## Nomenclature
This section introduces strict definition of several words used in this package to clarify the description of API and help the developers understand and grasp the geometric meaning of algorithms.
| Word | Meaning | Illustration |
| --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `curve` | `curve` is an oriented bounded curve denoted as `(x(s), y(s), z(s))` with additional properties, parameterized by `s` (`s = 0` at the start). | <br>[View in Drawio]({{ drawio("/common/autoware_trajectory/images/nomenclature/curve.drawio.svg") }})<br>There are 5 `underlying` points<br>$\mathrm{P0} = (0, 0, 0)$<br>$\mathrm{P1} = (1/ \sqrt{2}, 1/ \sqrt{2}, 0)$<br>$\mathrm{P2} = (1/ \sqrt{2}, 1+1/ \sqrt{2}, 0)$<br>$\mathrm{P3} = (2/ \sqrt{2}, 1+2/ \sqrt{2}, 0)$<br>$\mathrm{P4} = (2/ \sqrt{2} + 1/ \sqrt{6}, 1+2/ \sqrt{2} + 1 / \sqrt{3}, 1 / \sqrt{2})$<br>and the `arc length` between each interval is $1, 2, 1, 1$ respectively, so $\mathrm{start} = 0$ and $\mathrm{end} = 5$. |
| `underlying` | `underlying` points of a curve refers to the list of 3D points from which the curve was interpolated. | |
| `arc length`[m] | `arc length` denotes the approximate **3D** length of of a curve and is computed based on the discrete `underlying` points. | |
| `s`[m] | `s` denotes the **3D** `arc length` coordinate starting from the base point (mostly the start point) of the curve and a point is identified by `trajectory(s)`.<br>Due to this definition, the actual _curve length_ and `arc length` have subtle difference as illustrated. | <br>[View in Drawio]({{ drawio("/common/autoware_trajectory/images/nomenclature/approximation.drawio.svg") }})<br>The point for $s = 0.5$ is the purple dot, but the _curve length_ from $\mathrm{P0}$ to this point does not equal to $0.5$.<br>The exact _curve length_ is $\int \sqrt{(\frac{dx}{dt})^2 + (\frac{dy}{dt})^2 + (\frac{dz}{dt})^2} dt$, which cannot be obtained in an analytical closed form. |
| `curvature` | `curvature` is computed **using only X-Y 2D coordinate**. This is based on the normal and natural assumption that _roads are flat_. Mathematically, it asserts that [Gaussian curvature](https://en.wikipedia.org/wiki/Gaussian_curvature) of road is uniformly 0.<br>The sign of curvature is positive if the center of turning circle is on the left side, otherwise negative. | <br>[View in Drawio]({{ drawio("/common/autoware_trajectory/images/nomenclature/curvature.drawio.svg") }}) |
| `k_points_minimum_dist_threshold` | This is a constant threshold that is used to check if two points or values are same and to avoid zero division. | |
| `almost-same` | The pair of two points $P_{1}$ and $P_{2}$, or the pair of two base values $s_{1}$ and $s_{2}$ are called `almost-same` if their distance or difference are less than `k_points_minimum_dist_threshold` | |
## API
### Interpolators
| Class | method/function | description |
| ---------------- | ----------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| Common Functions | `minimum_required_points()` | return the number of points required for each concrete interpolator |
| | `compute(double s) -> T` | compute the interpolated value at given base $s$. $s$ is clamped to the underlying base range. |
| | `compute(vector<double> s) -> vector<T>` | compute the interpolated values at for each base values in $s$. |
| | `compute_first_derivative(double s) -> double` | compute the first derivative of at given base $s$. $s$ is clamped. |
| | `compute_second_derivative(double s) -> double` | compute the second derivative of at given base $s$. $s$ is clamped. |
`AkimaSpline` requires at least **5** points to interpolate.
```cpp title="./examples/example_readme.cpp:142:152"
--8<--
common/autoware_trajectory/examples/example_readme.cpp:142:152
--8<--
CubicSpline
requires at least 4 points to interpolate.
```cpp title=”./examples/example_readme.cpp:192:201” –8<– common/autoware_trajectory/examples/example_readme.cpp:192:201
File truncated at 100 lines see the full file
Changelog for package autoware_trajectory
1.1.0 (2025-05-01)
-
fix(autoware_trajectory): avoid nan in align_orientation_with_trajectory_direction (#398)
- fix(autoware_trajectory): avoid nan in align_orientation_with_trajectory_direction
- tidy
* remove eps ---------
-
chore(autoware_trajectory): relax the warning condition of boundary check (#393)
- chore(autoware_trajectory): relax the warning condition of boundary check
* tidy
-
feat(trajectory): define distance threshold and refine restore() without API breakage(in experimental) (#376)
- feat(trajectory): define distance threshold and refine restore
* fix spell ---------
-
feat(autoware_trajectory): add get_contained_lane_ids function (#369)
- add get_contained_lane_ids
- add unit test
* remove assert ---------
-
feat(trajectory): add pretty_build() function for Planning/Control component node (#332)
-
refactor(autoware_trajectory)!: move everything to namespace experimetal (#371) refactor(autoware_trajectory)!: move everything to namespace experimental
-
feat(trajectory): improve shift function and their documents (#337)
- feat(trajectory): add populate function
- update curvature figure for approximation desc
- update align_orientation_with_trajectory_direction fig
- finished trajectory classes
- refactored shift
- add comment
* update error message ---------
-
fix(autoware_trajectory): fix base_addition callback to work when Trajectory is moved (#370)
-
fix(autoware_trajectory): check vector size check before accessing (#365)
- fix(autoware_trajectory): check vector size check before accessing
- update
* minor fix ---------Co-authored-by: Mamoru Sobue <<hilo.soblin@gmail.com>>
-
feat(autoware_trajectory): improve performance of get_underlying_base (#298)
-
feat(trajectory): add API documentation for trajectory class, add some utillity (#295)
-
feat(trajectory): add API description, nomenclature, illustration, rename functions to align with nomenclature (#292)
- feat(trajectory): add API description, nomenclature, illustration, rename functions to align with nomenclature
* resurrect get_internal_base ---------
-
chore: include iostream and link yaml-cpp for Jazzy (#351)
-
Contributors: Mamoru Sobue, Tim Clephas, Yukinari Hisaki
1.0.0 (2025-03-31)
- feat(trajectory): remove default ctor and collect default setting in
File truncated at 100 lines see the full file
Wiki Tutorials
Package Dependencies
System Dependencies
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged autoware_trajectory at Robotics Stack Exchange
Package Summary
Tags | No category tags. |
Version | 1.1.0 |
License | Apache License 2.0 |
Build type | AMENT_CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/autowarefoundation/autoware_core.git |
VCS Type | git |
VCS Version | main |
Last Updated | 2025-06-12 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | UNRELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Yukinari Hisaki
- Takayuki Murooka
- Kosuke Takeuchi
- Mamoru Sobue
Authors
- Yukinari Hisaki
Autoware Trajectory
This package provides classes to manage/manipulate Trajectory.
Overview
Interpolators
The interpolator class interpolates given bases
and values
. Following interpolators are implemented.
- Linear
- AkimaSpline
- CubicSpline
- NearestNeighbor
- Stairstep
The builder internally executes interpolation and return the result in the form of expected<T, E>
. If successful, it contains the interpolator object.
```cpp title=”./examples/example_readme.cpp:53:68” –8<– common/autoware_trajectory/examples/example_readme.cpp:53:68 –8<–
Otherwise it contains the error object representing the failure reason. In the below snippet, cubic spline interpolation fails because the number of input points is 3, which is below the `minimum_required_points() = 4` of `CubicSpline`.
```cpp title="./examples/example_readme.cpp:109:119"
--8<--
common/autoware_trajectory/examples/example_readme.cpp:109:119
--8<--
In such cases the result expected
object contains InterpolationFailure
type with an error message like “base size 3 is less than minimum required 4”.
Trajectory class
The Trajectory class provides mathematical continuous representation and object oriented interface for discrete array of following point types
-
geometry_msgs::Point
-
geometry_msgs::Pose
-
autoware_planning_msgs::PathPoint
-
autoware_planning_msgs::PathPointWithLaneId
-
autoware_planning_msgs::TrajectoryPoint
by interpolating the given underlying points. Once built, arbitrary point on the curve is continuously parametrized by a single s
coordinate.
```cpp title=”./examples/example_readme.cpp:549:561” –8<– common/autoware_trajectory/examples/example_readme.cpp:549:561 –8<–

[View in Drawio]({{ drawio("/common/autoware_trajectory/images/overview/trajectory.drawio.svg") }})
## Nomenclature
This section introduces strict definition of several words used in this package to clarify the description of API and help the developers understand and grasp the geometric meaning of algorithms.
| Word | Meaning | Illustration |
| --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `curve` | `curve` is an oriented bounded curve denoted as `(x(s), y(s), z(s))` with additional properties, parameterized by `s` (`s = 0` at the start). | <br>[View in Drawio]({{ drawio("/common/autoware_trajectory/images/nomenclature/curve.drawio.svg") }})<br>There are 5 `underlying` points<br>$\mathrm{P0} = (0, 0, 0)$<br>$\mathrm{P1} = (1/ \sqrt{2}, 1/ \sqrt{2}, 0)$<br>$\mathrm{P2} = (1/ \sqrt{2}, 1+1/ \sqrt{2}, 0)$<br>$\mathrm{P3} = (2/ \sqrt{2}, 1+2/ \sqrt{2}, 0)$<br>$\mathrm{P4} = (2/ \sqrt{2} + 1/ \sqrt{6}, 1+2/ \sqrt{2} + 1 / \sqrt{3}, 1 / \sqrt{2})$<br>and the `arc length` between each interval is $1, 2, 1, 1$ respectively, so $\mathrm{start} = 0$ and $\mathrm{end} = 5$. |
| `underlying` | `underlying` points of a curve refers to the list of 3D points from which the curve was interpolated. | |
| `arc length`[m] | `arc length` denotes the approximate **3D** length of of a curve and is computed based on the discrete `underlying` points. | |
| `s`[m] | `s` denotes the **3D** `arc length` coordinate starting from the base point (mostly the start point) of the curve and a point is identified by `trajectory(s)`.<br>Due to this definition, the actual _curve length_ and `arc length` have subtle difference as illustrated. | <br>[View in Drawio]({{ drawio("/common/autoware_trajectory/images/nomenclature/approximation.drawio.svg") }})<br>The point for $s = 0.5$ is the purple dot, but the _curve length_ from $\mathrm{P0}$ to this point does not equal to $0.5$.<br>The exact _curve length_ is $\int \sqrt{(\frac{dx}{dt})^2 + (\frac{dy}{dt})^2 + (\frac{dz}{dt})^2} dt$, which cannot be obtained in an analytical closed form. |
| `curvature` | `curvature` is computed **using only X-Y 2D coordinate**. This is based on the normal and natural assumption that _roads are flat_. Mathematically, it asserts that [Gaussian curvature](https://en.wikipedia.org/wiki/Gaussian_curvature) of road is uniformly 0.<br>The sign of curvature is positive if the center of turning circle is on the left side, otherwise negative. | <br>[View in Drawio]({{ drawio("/common/autoware_trajectory/images/nomenclature/curvature.drawio.svg") }}) |
| `k_points_minimum_dist_threshold` | This is a constant threshold that is used to check if two points or values are same and to avoid zero division. | |
| `almost-same` | The pair of two points $P_{1}$ and $P_{2}$, or the pair of two base values $s_{1}$ and $s_{2}$ are called `almost-same` if their distance or difference are less than `k_points_minimum_dist_threshold` | |
## API
### Interpolators
| Class | method/function | description |
| ---------------- | ----------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| Common Functions | `minimum_required_points()` | return the number of points required for each concrete interpolator |
| | `compute(double s) -> T` | compute the interpolated value at given base $s$. $s$ is clamped to the underlying base range. |
| | `compute(vector<double> s) -> vector<T>` | compute the interpolated values at for each base values in $s$. |
| | `compute_first_derivative(double s) -> double` | compute the first derivative of at given base $s$. $s$ is clamped. |
| | `compute_second_derivative(double s) -> double` | compute the second derivative of at given base $s$. $s$ is clamped. |
`AkimaSpline` requires at least **5** points to interpolate.
```cpp title="./examples/example_readme.cpp:142:152"
--8<--
common/autoware_trajectory/examples/example_readme.cpp:142:152
--8<--
CubicSpline
requires at least 4 points to interpolate.
```cpp title=”./examples/example_readme.cpp:192:201” –8<– common/autoware_trajectory/examples/example_readme.cpp:192:201
File truncated at 100 lines see the full file
Changelog for package autoware_trajectory
1.1.0 (2025-05-01)
-
fix(autoware_trajectory): avoid nan in align_orientation_with_trajectory_direction (#398)
- fix(autoware_trajectory): avoid nan in align_orientation_with_trajectory_direction
- tidy
* remove eps ---------
-
chore(autoware_trajectory): relax the warning condition of boundary check (#393)
- chore(autoware_trajectory): relax the warning condition of boundary check
* tidy
-
feat(trajectory): define distance threshold and refine restore() without API breakage(in experimental) (#376)
- feat(trajectory): define distance threshold and refine restore
* fix spell ---------
-
feat(autoware_trajectory): add get_contained_lane_ids function (#369)
- add get_contained_lane_ids
- add unit test
* remove assert ---------
-
feat(trajectory): add pretty_build() function for Planning/Control component node (#332)
-
refactor(autoware_trajectory)!: move everything to namespace experimetal (#371) refactor(autoware_trajectory)!: move everything to namespace experimental
-
feat(trajectory): improve shift function and their documents (#337)
- feat(trajectory): add populate function
- update curvature figure for approximation desc
- update align_orientation_with_trajectory_direction fig
- finished trajectory classes
- refactored shift
- add comment
* update error message ---------
-
fix(autoware_trajectory): fix base_addition callback to work when Trajectory is moved (#370)
-
fix(autoware_trajectory): check vector size check before accessing (#365)
- fix(autoware_trajectory): check vector size check before accessing
- update
* minor fix ---------Co-authored-by: Mamoru Sobue <<hilo.soblin@gmail.com>>
-
feat(autoware_trajectory): improve performance of get_underlying_base (#298)
-
feat(trajectory): add API documentation for trajectory class, add some utillity (#295)
-
feat(trajectory): add API description, nomenclature, illustration, rename functions to align with nomenclature (#292)
- feat(trajectory): add API description, nomenclature, illustration, rename functions to align with nomenclature
* resurrect get_internal_base ---------
-
chore: include iostream and link yaml-cpp for Jazzy (#351)
-
Contributors: Mamoru Sobue, Tim Clephas, Yukinari Hisaki
1.0.0 (2025-03-31)
- feat(trajectory): remove default ctor and collect default setting in
File truncated at 100 lines see the full file
Wiki Tutorials
Package Dependencies
System Dependencies
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged autoware_trajectory at Robotics Stack Exchange
Package Summary
Tags | No category tags. |
Version | 1.1.0 |
License | Apache License 2.0 |
Build type | AMENT_CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/autowarefoundation/autoware_core.git |
VCS Type | git |
VCS Version | main |
Last Updated | 2025-06-12 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | UNRELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Yukinari Hisaki
- Takayuki Murooka
- Kosuke Takeuchi
- Mamoru Sobue
Authors
- Yukinari Hisaki
Autoware Trajectory
This package provides classes to manage/manipulate Trajectory.
Overview
Interpolators
The interpolator class interpolates given bases
and values
. Following interpolators are implemented.
- Linear
- AkimaSpline
- CubicSpline
- NearestNeighbor
- Stairstep
The builder internally executes interpolation and return the result in the form of expected<T, E>
. If successful, it contains the interpolator object.
```cpp title=”./examples/example_readme.cpp:53:68” –8<– common/autoware_trajectory/examples/example_readme.cpp:53:68 –8<–
Otherwise it contains the error object representing the failure reason. In the below snippet, cubic spline interpolation fails because the number of input points is 3, which is below the `minimum_required_points() = 4` of `CubicSpline`.
```cpp title="./examples/example_readme.cpp:109:119"
--8<--
common/autoware_trajectory/examples/example_readme.cpp:109:119
--8<--
In such cases the result expected
object contains InterpolationFailure
type with an error message like “base size 3 is less than minimum required 4”.
Trajectory class
The Trajectory class provides mathematical continuous representation and object oriented interface for discrete array of following point types
-
geometry_msgs::Point
-
geometry_msgs::Pose
-
autoware_planning_msgs::PathPoint
-
autoware_planning_msgs::PathPointWithLaneId
-
autoware_planning_msgs::TrajectoryPoint
by interpolating the given underlying points. Once built, arbitrary point on the curve is continuously parametrized by a single s
coordinate.
```cpp title=”./examples/example_readme.cpp:549:561” –8<– common/autoware_trajectory/examples/example_readme.cpp:549:561 –8<–

[View in Drawio]({{ drawio("/common/autoware_trajectory/images/overview/trajectory.drawio.svg") }})
## Nomenclature
This section introduces strict definition of several words used in this package to clarify the description of API and help the developers understand and grasp the geometric meaning of algorithms.
| Word | Meaning | Illustration |
| --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `curve` | `curve` is an oriented bounded curve denoted as `(x(s), y(s), z(s))` with additional properties, parameterized by `s` (`s = 0` at the start). | <br>[View in Drawio]({{ drawio("/common/autoware_trajectory/images/nomenclature/curve.drawio.svg") }})<br>There are 5 `underlying` points<br>$\mathrm{P0} = (0, 0, 0)$<br>$\mathrm{P1} = (1/ \sqrt{2}, 1/ \sqrt{2}, 0)$<br>$\mathrm{P2} = (1/ \sqrt{2}, 1+1/ \sqrt{2}, 0)$<br>$\mathrm{P3} = (2/ \sqrt{2}, 1+2/ \sqrt{2}, 0)$<br>$\mathrm{P4} = (2/ \sqrt{2} + 1/ \sqrt{6}, 1+2/ \sqrt{2} + 1 / \sqrt{3}, 1 / \sqrt{2})$<br>and the `arc length` between each interval is $1, 2, 1, 1$ respectively, so $\mathrm{start} = 0$ and $\mathrm{end} = 5$. |
| `underlying` | `underlying` points of a curve refers to the list of 3D points from which the curve was interpolated. | |
| `arc length`[m] | `arc length` denotes the approximate **3D** length of of a curve and is computed based on the discrete `underlying` points. | |
| `s`[m] | `s` denotes the **3D** `arc length` coordinate starting from the base point (mostly the start point) of the curve and a point is identified by `trajectory(s)`.<br>Due to this definition, the actual _curve length_ and `arc length` have subtle difference as illustrated. | <br>[View in Drawio]({{ drawio("/common/autoware_trajectory/images/nomenclature/approximation.drawio.svg") }})<br>The point for $s = 0.5$ is the purple dot, but the _curve length_ from $\mathrm{P0}$ to this point does not equal to $0.5$.<br>The exact _curve length_ is $\int \sqrt{(\frac{dx}{dt})^2 + (\frac{dy}{dt})^2 + (\frac{dz}{dt})^2} dt$, which cannot be obtained in an analytical closed form. |
| `curvature` | `curvature` is computed **using only X-Y 2D coordinate**. This is based on the normal and natural assumption that _roads are flat_. Mathematically, it asserts that [Gaussian curvature](https://en.wikipedia.org/wiki/Gaussian_curvature) of road is uniformly 0.<br>The sign of curvature is positive if the center of turning circle is on the left side, otherwise negative. | <br>[View in Drawio]({{ drawio("/common/autoware_trajectory/images/nomenclature/curvature.drawio.svg") }}) |
| `k_points_minimum_dist_threshold` | This is a constant threshold that is used to check if two points or values are same and to avoid zero division. | |
| `almost-same` | The pair of two points $P_{1}$ and $P_{2}$, or the pair of two base values $s_{1}$ and $s_{2}$ are called `almost-same` if their distance or difference are less than `k_points_minimum_dist_threshold` | |
## API
### Interpolators
| Class | method/function | description |
| ---------------- | ----------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| Common Functions | `minimum_required_points()` | return the number of points required for each concrete interpolator |
| | `compute(double s) -> T` | compute the interpolated value at given base $s$. $s$ is clamped to the underlying base range. |
| | `compute(vector<double> s) -> vector<T>` | compute the interpolated values at for each base values in $s$. |
| | `compute_first_derivative(double s) -> double` | compute the first derivative of at given base $s$. $s$ is clamped. |
| | `compute_second_derivative(double s) -> double` | compute the second derivative of at given base $s$. $s$ is clamped. |
`AkimaSpline` requires at least **5** points to interpolate.
```cpp title="./examples/example_readme.cpp:142:152"
--8<--
common/autoware_trajectory/examples/example_readme.cpp:142:152
--8<--
CubicSpline
requires at least 4 points to interpolate.
```cpp title=”./examples/example_readme.cpp:192:201” –8<– common/autoware_trajectory/examples/example_readme.cpp:192:201
File truncated at 100 lines see the full file
Changelog for package autoware_trajectory
1.1.0 (2025-05-01)
-
fix(autoware_trajectory): avoid nan in align_orientation_with_trajectory_direction (#398)
- fix(autoware_trajectory): avoid nan in align_orientation_with_trajectory_direction
- tidy
* remove eps ---------
-
chore(autoware_trajectory): relax the warning condition of boundary check (#393)
- chore(autoware_trajectory): relax the warning condition of boundary check
* tidy
-
feat(trajectory): define distance threshold and refine restore() without API breakage(in experimental) (#376)
- feat(trajectory): define distance threshold and refine restore
* fix spell ---------
-
feat(autoware_trajectory): add get_contained_lane_ids function (#369)
- add get_contained_lane_ids
- add unit test
* remove assert ---------
-
feat(trajectory): add pretty_build() function for Planning/Control component node (#332)
-
refactor(autoware_trajectory)!: move everything to namespace experimetal (#371) refactor(autoware_trajectory)!: move everything to namespace experimental
-
feat(trajectory): improve shift function and their documents (#337)
- feat(trajectory): add populate function
- update curvature figure for approximation desc
- update align_orientation_with_trajectory_direction fig
- finished trajectory classes
- refactored shift
- add comment
* update error message ---------
-
fix(autoware_trajectory): fix base_addition callback to work when Trajectory is moved (#370)
-
fix(autoware_trajectory): check vector size check before accessing (#365)
- fix(autoware_trajectory): check vector size check before accessing
- update
* minor fix ---------Co-authored-by: Mamoru Sobue <<hilo.soblin@gmail.com>>
-
feat(autoware_trajectory): improve performance of get_underlying_base (#298)
-
feat(trajectory): add API documentation for trajectory class, add some utillity (#295)
-
feat(trajectory): add API description, nomenclature, illustration, rename functions to align with nomenclature (#292)
- feat(trajectory): add API description, nomenclature, illustration, rename functions to align with nomenclature
* resurrect get_internal_base ---------
-
chore: include iostream and link yaml-cpp for Jazzy (#351)
-
Contributors: Mamoru Sobue, Tim Clephas, Yukinari Hisaki
1.0.0 (2025-03-31)
- feat(trajectory): remove default ctor and collect default setting in
File truncated at 100 lines see the full file
Wiki Tutorials
Package Dependencies
System Dependencies
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged autoware_trajectory at Robotics Stack Exchange
Package Summary
Tags | No category tags. |
Version | 1.1.0 |
License | Apache License 2.0 |
Build type | AMENT_CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/autowarefoundation/autoware_core.git |
VCS Type | git |
VCS Version | main |
Last Updated | 2025-06-12 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | UNRELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Yukinari Hisaki
- Takayuki Murooka
- Kosuke Takeuchi
- Mamoru Sobue
Authors
- Yukinari Hisaki
Autoware Trajectory
This package provides classes to manage/manipulate Trajectory.
Overview
Interpolators
The interpolator class interpolates given bases
and values
. Following interpolators are implemented.
- Linear
- AkimaSpline
- CubicSpline
- NearestNeighbor
- Stairstep
The builder internally executes interpolation and return the result in the form of expected<T, E>
. If successful, it contains the interpolator object.
```cpp title=”./examples/example_readme.cpp:53:68” –8<– common/autoware_trajectory/examples/example_readme.cpp:53:68 –8<–
Otherwise it contains the error object representing the failure reason. In the below snippet, cubic spline interpolation fails because the number of input points is 3, which is below the `minimum_required_points() = 4` of `CubicSpline`.
```cpp title="./examples/example_readme.cpp:109:119"
--8<--
common/autoware_trajectory/examples/example_readme.cpp:109:119
--8<--
In such cases the result expected
object contains InterpolationFailure
type with an error message like “base size 3 is less than minimum required 4”.
Trajectory class
The Trajectory class provides mathematical continuous representation and object oriented interface for discrete array of following point types
-
geometry_msgs::Point
-
geometry_msgs::Pose
-
autoware_planning_msgs::PathPoint
-
autoware_planning_msgs::PathPointWithLaneId
-
autoware_planning_msgs::TrajectoryPoint
by interpolating the given underlying points. Once built, arbitrary point on the curve is continuously parametrized by a single s
coordinate.
```cpp title=”./examples/example_readme.cpp:549:561” –8<– common/autoware_trajectory/examples/example_readme.cpp:549:561 –8<–

[View in Drawio]({{ drawio("/common/autoware_trajectory/images/overview/trajectory.drawio.svg") }})
## Nomenclature
This section introduces strict definition of several words used in this package to clarify the description of API and help the developers understand and grasp the geometric meaning of algorithms.
| Word | Meaning | Illustration |
| --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `curve` | `curve` is an oriented bounded curve denoted as `(x(s), y(s), z(s))` with additional properties, parameterized by `s` (`s = 0` at the start). | <br>[View in Drawio]({{ drawio("/common/autoware_trajectory/images/nomenclature/curve.drawio.svg") }})<br>There are 5 `underlying` points<br>$\mathrm{P0} = (0, 0, 0)$<br>$\mathrm{P1} = (1/ \sqrt{2}, 1/ \sqrt{2}, 0)$<br>$\mathrm{P2} = (1/ \sqrt{2}, 1+1/ \sqrt{2}, 0)$<br>$\mathrm{P3} = (2/ \sqrt{2}, 1+2/ \sqrt{2}, 0)$<br>$\mathrm{P4} = (2/ \sqrt{2} + 1/ \sqrt{6}, 1+2/ \sqrt{2} + 1 / \sqrt{3}, 1 / \sqrt{2})$<br>and the `arc length` between each interval is $1, 2, 1, 1$ respectively, so $\mathrm{start} = 0$ and $\mathrm{end} = 5$. |
| `underlying` | `underlying` points of a curve refers to the list of 3D points from which the curve was interpolated. | |
| `arc length`[m] | `arc length` denotes the approximate **3D** length of of a curve and is computed based on the discrete `underlying` points. | |
| `s`[m] | `s` denotes the **3D** `arc length` coordinate starting from the base point (mostly the start point) of the curve and a point is identified by `trajectory(s)`.<br>Due to this definition, the actual _curve length_ and `arc length` have subtle difference as illustrated. | <br>[View in Drawio]({{ drawio("/common/autoware_trajectory/images/nomenclature/approximation.drawio.svg") }})<br>The point for $s = 0.5$ is the purple dot, but the _curve length_ from $\mathrm{P0}$ to this point does not equal to $0.5$.<br>The exact _curve length_ is $\int \sqrt{(\frac{dx}{dt})^2 + (\frac{dy}{dt})^2 + (\frac{dz}{dt})^2} dt$, which cannot be obtained in an analytical closed form. |
| `curvature` | `curvature` is computed **using only X-Y 2D coordinate**. This is based on the normal and natural assumption that _roads are flat_. Mathematically, it asserts that [Gaussian curvature](https://en.wikipedia.org/wiki/Gaussian_curvature) of road is uniformly 0.<br>The sign of curvature is positive if the center of turning circle is on the left side, otherwise negative. | <br>[View in Drawio]({{ drawio("/common/autoware_trajectory/images/nomenclature/curvature.drawio.svg") }}) |
| `k_points_minimum_dist_threshold` | This is a constant threshold that is used to check if two points or values are same and to avoid zero division. | |
| `almost-same` | The pair of two points $P_{1}$ and $P_{2}$, or the pair of two base values $s_{1}$ and $s_{2}$ are called `almost-same` if their distance or difference are less than `k_points_minimum_dist_threshold` | |
## API
### Interpolators
| Class | method/function | description |
| ---------------- | ----------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| Common Functions | `minimum_required_points()` | return the number of points required for each concrete interpolator |
| | `compute(double s) -> T` | compute the interpolated value at given base $s$. $s$ is clamped to the underlying base range. |
| | `compute(vector<double> s) -> vector<T>` | compute the interpolated values at for each base values in $s$. |
| | `compute_first_derivative(double s) -> double` | compute the first derivative of at given base $s$. $s$ is clamped. |
| | `compute_second_derivative(double s) -> double` | compute the second derivative of at given base $s$. $s$ is clamped. |
`AkimaSpline` requires at least **5** points to interpolate.
```cpp title="./examples/example_readme.cpp:142:152"
--8<--
common/autoware_trajectory/examples/example_readme.cpp:142:152
--8<--
CubicSpline
requires at least 4 points to interpolate.
```cpp title=”./examples/example_readme.cpp:192:201” –8<– common/autoware_trajectory/examples/example_readme.cpp:192:201
File truncated at 100 lines see the full file
Changelog for package autoware_trajectory
1.1.0 (2025-05-01)
-
fix(autoware_trajectory): avoid nan in align_orientation_with_trajectory_direction (#398)
- fix(autoware_trajectory): avoid nan in align_orientation_with_trajectory_direction
- tidy
* remove eps ---------
-
chore(autoware_trajectory): relax the warning condition of boundary check (#393)
- chore(autoware_trajectory): relax the warning condition of boundary check
* tidy
-
feat(trajectory): define distance threshold and refine restore() without API breakage(in experimental) (#376)
- feat(trajectory): define distance threshold and refine restore
* fix spell ---------
-
feat(autoware_trajectory): add get_contained_lane_ids function (#369)
- add get_contained_lane_ids
- add unit test
* remove assert ---------
-
feat(trajectory): add pretty_build() function for Planning/Control component node (#332)
-
refactor(autoware_trajectory)!: move everything to namespace experimetal (#371) refactor(autoware_trajectory)!: move everything to namespace experimental
-
feat(trajectory): improve shift function and their documents (#337)
- feat(trajectory): add populate function
- update curvature figure for approximation desc
- update align_orientation_with_trajectory_direction fig
- finished trajectory classes
- refactored shift
- add comment
* update error message ---------
-
fix(autoware_trajectory): fix base_addition callback to work when Trajectory is moved (#370)
-
fix(autoware_trajectory): check vector size check before accessing (#365)
- fix(autoware_trajectory): check vector size check before accessing
- update
* minor fix ---------Co-authored-by: Mamoru Sobue <<hilo.soblin@gmail.com>>
-
feat(autoware_trajectory): improve performance of get_underlying_base (#298)
-
feat(trajectory): add API documentation for trajectory class, add some utillity (#295)
-
feat(trajectory): add API description, nomenclature, illustration, rename functions to align with nomenclature (#292)
- feat(trajectory): add API description, nomenclature, illustration, rename functions to align with nomenclature
* resurrect get_internal_base ---------
-
chore: include iostream and link yaml-cpp for Jazzy (#351)
-
Contributors: Mamoru Sobue, Tim Clephas, Yukinari Hisaki
1.0.0 (2025-03-31)
- feat(trajectory): remove default ctor and collect default setting in
File truncated at 100 lines see the full file
Wiki Tutorials
Package Dependencies
System Dependencies
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged autoware_trajectory at Robotics Stack Exchange
Package Summary
Tags | No category tags. |
Version | 1.1.0 |
License | Apache License 2.0 |
Build type | AMENT_CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/autowarefoundation/autoware_core.git |
VCS Type | git |
VCS Version | main |
Last Updated | 2025-06-12 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | UNRELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Yukinari Hisaki
- Takayuki Murooka
- Kosuke Takeuchi
- Mamoru Sobue
Authors
- Yukinari Hisaki
Autoware Trajectory
This package provides classes to manage/manipulate Trajectory.
Overview
Interpolators
The interpolator class interpolates given bases
and values
. Following interpolators are implemented.
- Linear
- AkimaSpline
- CubicSpline
- NearestNeighbor
- Stairstep
The builder internally executes interpolation and return the result in the form of expected<T, E>
. If successful, it contains the interpolator object.
```cpp title=”./examples/example_readme.cpp:53:68” –8<– common/autoware_trajectory/examples/example_readme.cpp:53:68 –8<–
Otherwise it contains the error object representing the failure reason. In the below snippet, cubic spline interpolation fails because the number of input points is 3, which is below the `minimum_required_points() = 4` of `CubicSpline`.
```cpp title="./examples/example_readme.cpp:109:119"
--8<--
common/autoware_trajectory/examples/example_readme.cpp:109:119
--8<--
In such cases the result expected
object contains InterpolationFailure
type with an error message like “base size 3 is less than minimum required 4”.
Trajectory class
The Trajectory class provides mathematical continuous representation and object oriented interface for discrete array of following point types
-
geometry_msgs::Point
-
geometry_msgs::Pose
-
autoware_planning_msgs::PathPoint
-
autoware_planning_msgs::PathPointWithLaneId
-
autoware_planning_msgs::TrajectoryPoint
by interpolating the given underlying points. Once built, arbitrary point on the curve is continuously parametrized by a single s
coordinate.
```cpp title=”./examples/example_readme.cpp:549:561” –8<– common/autoware_trajectory/examples/example_readme.cpp:549:561 –8<–

[View in Drawio]({{ drawio("/common/autoware_trajectory/images/overview/trajectory.drawio.svg") }})
## Nomenclature
This section introduces strict definition of several words used in this package to clarify the description of API and help the developers understand and grasp the geometric meaning of algorithms.
| Word | Meaning | Illustration |
| --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `curve` | `curve` is an oriented bounded curve denoted as `(x(s), y(s), z(s))` with additional properties, parameterized by `s` (`s = 0` at the start). | <br>[View in Drawio]({{ drawio("/common/autoware_trajectory/images/nomenclature/curve.drawio.svg") }})<br>There are 5 `underlying` points<br>$\mathrm{P0} = (0, 0, 0)$<br>$\mathrm{P1} = (1/ \sqrt{2}, 1/ \sqrt{2}, 0)$<br>$\mathrm{P2} = (1/ \sqrt{2}, 1+1/ \sqrt{2}, 0)$<br>$\mathrm{P3} = (2/ \sqrt{2}, 1+2/ \sqrt{2}, 0)$<br>$\mathrm{P4} = (2/ \sqrt{2} + 1/ \sqrt{6}, 1+2/ \sqrt{2} + 1 / \sqrt{3}, 1 / \sqrt{2})$<br>and the `arc length` between each interval is $1, 2, 1, 1$ respectively, so $\mathrm{start} = 0$ and $\mathrm{end} = 5$. |
| `underlying` | `underlying` points of a curve refers to the list of 3D points from which the curve was interpolated. | |
| `arc length`[m] | `arc length` denotes the approximate **3D** length of of a curve and is computed based on the discrete `underlying` points. | |
| `s`[m] | `s` denotes the **3D** `arc length` coordinate starting from the base point (mostly the start point) of the curve and a point is identified by `trajectory(s)`.<br>Due to this definition, the actual _curve length_ and `arc length` have subtle difference as illustrated. | <br>[View in Drawio]({{ drawio("/common/autoware_trajectory/images/nomenclature/approximation.drawio.svg") }})<br>The point for $s = 0.5$ is the purple dot, but the _curve length_ from $\mathrm{P0}$ to this point does not equal to $0.5$.<br>The exact _curve length_ is $\int \sqrt{(\frac{dx}{dt})^2 + (\frac{dy}{dt})^2 + (\frac{dz}{dt})^2} dt$, which cannot be obtained in an analytical closed form. |
| `curvature` | `curvature` is computed **using only X-Y 2D coordinate**. This is based on the normal and natural assumption that _roads are flat_. Mathematically, it asserts that [Gaussian curvature](https://en.wikipedia.org/wiki/Gaussian_curvature) of road is uniformly 0.<br>The sign of curvature is positive if the center of turning circle is on the left side, otherwise negative. | <br>[View in Drawio]({{ drawio("/common/autoware_trajectory/images/nomenclature/curvature.drawio.svg") }}) |
| `k_points_minimum_dist_threshold` | This is a constant threshold that is used to check if two points or values are same and to avoid zero division. | |
| `almost-same` | The pair of two points $P_{1}$ and $P_{2}$, or the pair of two base values $s_{1}$ and $s_{2}$ are called `almost-same` if their distance or difference are less than `k_points_minimum_dist_threshold` | |
## API
### Interpolators
| Class | method/function | description |
| ---------------- | ----------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| Common Functions | `minimum_required_points()` | return the number of points required for each concrete interpolator |
| | `compute(double s) -> T` | compute the interpolated value at given base $s$. $s$ is clamped to the underlying base range. |
| | `compute(vector<double> s) -> vector<T>` | compute the interpolated values at for each base values in $s$. |
| | `compute_first_derivative(double s) -> double` | compute the first derivative of at given base $s$. $s$ is clamped. |
| | `compute_second_derivative(double s) -> double` | compute the second derivative of at given base $s$. $s$ is clamped. |
`AkimaSpline` requires at least **5** points to interpolate.
```cpp title="./examples/example_readme.cpp:142:152"
--8<--
common/autoware_trajectory/examples/example_readme.cpp:142:152
--8<--
CubicSpline
requires at least 4 points to interpolate.
```cpp title=”./examples/example_readme.cpp:192:201” –8<– common/autoware_trajectory/examples/example_readme.cpp:192:201
File truncated at 100 lines see the full file
Changelog for package autoware_trajectory
1.1.0 (2025-05-01)
-
fix(autoware_trajectory): avoid nan in align_orientation_with_trajectory_direction (#398)
- fix(autoware_trajectory): avoid nan in align_orientation_with_trajectory_direction
- tidy
* remove eps ---------
-
chore(autoware_trajectory): relax the warning condition of boundary check (#393)
- chore(autoware_trajectory): relax the warning condition of boundary check
* tidy
-
feat(trajectory): define distance threshold and refine restore() without API breakage(in experimental) (#376)
- feat(trajectory): define distance threshold and refine restore
* fix spell ---------
-
feat(autoware_trajectory): add get_contained_lane_ids function (#369)
- add get_contained_lane_ids
- add unit test
* remove assert ---------
-
feat(trajectory): add pretty_build() function for Planning/Control component node (#332)
-
refactor(autoware_trajectory)!: move everything to namespace experimetal (#371) refactor(autoware_trajectory)!: move everything to namespace experimental
-
feat(trajectory): improve shift function and their documents (#337)
- feat(trajectory): add populate function
- update curvature figure for approximation desc
- update align_orientation_with_trajectory_direction fig
- finished trajectory classes
- refactored shift
- add comment
* update error message ---------
-
fix(autoware_trajectory): fix base_addition callback to work when Trajectory is moved (#370)
-
fix(autoware_trajectory): check vector size check before accessing (#365)
- fix(autoware_trajectory): check vector size check before accessing
- update
* minor fix ---------Co-authored-by: Mamoru Sobue <<hilo.soblin@gmail.com>>
-
feat(autoware_trajectory): improve performance of get_underlying_base (#298)
-
feat(trajectory): add API documentation for trajectory class, add some utillity (#295)
-
feat(trajectory): add API description, nomenclature, illustration, rename functions to align with nomenclature (#292)
- feat(trajectory): add API description, nomenclature, illustration, rename functions to align with nomenclature
* resurrect get_internal_base ---------
-
chore: include iostream and link yaml-cpp for Jazzy (#351)
-
Contributors: Mamoru Sobue, Tim Clephas, Yukinari Hisaki
1.0.0 (2025-03-31)
- feat(trajectory): remove default ctor and collect default setting in
File truncated at 100 lines see the full file
Wiki Tutorials
Package Dependencies
System Dependencies
Dependant Packages
Launch files
Messages
Services
Plugins
Recent questions tagged autoware_trajectory at Robotics Stack Exchange
Package Summary
Tags | No category tags. |
Version | 1.1.0 |
License | Apache License 2.0 |
Build type | AMENT_CMAKE |
Use | RECOMMENDED |
Repository Summary
Checkout URI | https://github.com/autowarefoundation/autoware_core.git |
VCS Type | git |
VCS Version | main |
Last Updated | 2025-06-12 |
Dev Status | DEVELOPED |
CI status | No Continuous Integration |
Released | UNRELEASED |
Tags | No category tags. |
Contributing |
Help Wanted (0)
Good First Issues (0) Pull Requests to Review (0) |
Package Description
Additional Links
Maintainers
- Yukinari Hisaki
- Takayuki Murooka
- Kosuke Takeuchi
- Mamoru Sobue
Authors
- Yukinari Hisaki
Autoware Trajectory
This package provides classes to manage/manipulate Trajectory.
Overview
Interpolators
The interpolator class interpolates given bases
and values
. Following interpolators are implemented.
- Linear
- AkimaSpline
- CubicSpline
- NearestNeighbor
- Stairstep
The builder internally executes interpolation and return the result in the form of expected<T, E>
. If successful, it contains the interpolator object.
```cpp title=”./examples/example_readme.cpp:53:68” –8<– common/autoware_trajectory/examples/example_readme.cpp:53:68 –8<–
Otherwise it contains the error object representing the failure reason. In the below snippet, cubic spline interpolation fails because the number of input points is 3, which is below the `minimum_required_points() = 4` of `CubicSpline`.
```cpp title="./examples/example_readme.cpp:109:119"
--8<--
common/autoware_trajectory/examples/example_readme.cpp:109:119
--8<--
In such cases the result expected
object contains InterpolationFailure
type with an error message like “base size 3 is less than minimum required 4”.
Trajectory class
The Trajectory class provides mathematical continuous representation and object oriented interface for discrete array of following point types
-
geometry_msgs::Point
-
geometry_msgs::Pose
-
autoware_planning_msgs::PathPoint
-
autoware_planning_msgs::PathPointWithLaneId
-
autoware_planning_msgs::TrajectoryPoint
by interpolating the given underlying points. Once built, arbitrary point on the curve is continuously parametrized by a single s
coordinate.
```cpp title=”./examples/example_readme.cpp:549:561” –8<– common/autoware_trajectory/examples/example_readme.cpp:549:561 –8<–

[View in Drawio]({{ drawio("/common/autoware_trajectory/images/overview/trajectory.drawio.svg") }})
## Nomenclature
This section introduces strict definition of several words used in this package to clarify the description of API and help the developers understand and grasp the geometric meaning of algorithms.
| Word | Meaning | Illustration |
| --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `curve` | `curve` is an oriented bounded curve denoted as `(x(s), y(s), z(s))` with additional properties, parameterized by `s` (`s = 0` at the start). | <br>[View in Drawio]({{ drawio("/common/autoware_trajectory/images/nomenclature/curve.drawio.svg") }})<br>There are 5 `underlying` points<br>$\mathrm{P0} = (0, 0, 0)$<br>$\mathrm{P1} = (1/ \sqrt{2}, 1/ \sqrt{2}, 0)$<br>$\mathrm{P2} = (1/ \sqrt{2}, 1+1/ \sqrt{2}, 0)$<br>$\mathrm{P3} = (2/ \sqrt{2}, 1+2/ \sqrt{2}, 0)$<br>$\mathrm{P4} = (2/ \sqrt{2} + 1/ \sqrt{6}, 1+2/ \sqrt{2} + 1 / \sqrt{3}, 1 / \sqrt{2})$<br>and the `arc length` between each interval is $1, 2, 1, 1$ respectively, so $\mathrm{start} = 0$ and $\mathrm{end} = 5$. |
| `underlying` | `underlying` points of a curve refers to the list of 3D points from which the curve was interpolated. | |
| `arc length`[m] | `arc length` denotes the approximate **3D** length of of a curve and is computed based on the discrete `underlying` points. | |
| `s`[m] | `s` denotes the **3D** `arc length` coordinate starting from the base point (mostly the start point) of the curve and a point is identified by `trajectory(s)`.<br>Due to this definition, the actual _curve length_ and `arc length` have subtle difference as illustrated. | <br>[View in Drawio]({{ drawio("/common/autoware_trajectory/images/nomenclature/approximation.drawio.svg") }})<br>The point for $s = 0.5$ is the purple dot, but the _curve length_ from $\mathrm{P0}$ to this point does not equal to $0.5$.<br>The exact _curve length_ is $\int \sqrt{(\frac{dx}{dt})^2 + (\frac{dy}{dt})^2 + (\frac{dz}{dt})^2} dt$, which cannot be obtained in an analytical closed form. |
| `curvature` | `curvature` is computed **using only X-Y 2D coordinate**. This is based on the normal and natural assumption that _roads are flat_. Mathematically, it asserts that [Gaussian curvature](https://en.wikipedia.org/wiki/Gaussian_curvature) of road is uniformly 0.<br>The sign of curvature is positive if the center of turning circle is on the left side, otherwise negative. | <br>[View in Drawio]({{ drawio("/common/autoware_trajectory/images/nomenclature/curvature.drawio.svg") }}) |
| `k_points_minimum_dist_threshold` | This is a constant threshold that is used to check if two points or values are same and to avoid zero division. | |
| `almost-same` | The pair of two points $P_{1}$ and $P_{2}$, or the pair of two base values $s_{1}$ and $s_{2}$ are called `almost-same` if their distance or difference are less than `k_points_minimum_dist_threshold` | |
## API
### Interpolators
| Class | method/function | description |
| ---------------- | ----------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| Common Functions | `minimum_required_points()` | return the number of points required for each concrete interpolator |
| | `compute(double s) -> T` | compute the interpolated value at given base $s$. $s$ is clamped to the underlying base range. |
| | `compute(vector<double> s) -> vector<T>` | compute the interpolated values at for each base values in $s$. |
| | `compute_first_derivative(double s) -> double` | compute the first derivative of at given base $s$. $s$ is clamped. |
| | `compute_second_derivative(double s) -> double` | compute the second derivative of at given base $s$. $s$ is clamped. |
`AkimaSpline` requires at least **5** points to interpolate.
```cpp title="./examples/example_readme.cpp:142:152"
--8<--
common/autoware_trajectory/examples/example_readme.cpp:142:152
--8<--
CubicSpline
requires at least 4 points to interpolate.
```cpp title=”./examples/example_readme.cpp:192:201” –8<– common/autoware_trajectory/examples/example_readme.cpp:192:201
File truncated at 100 lines see the full file
Changelog for package autoware_trajectory
1.1.0 (2025-05-01)
-
fix(autoware_trajectory): avoid nan in align_orientation_with_trajectory_direction (#398)
- fix(autoware_trajectory): avoid nan in align_orientation_with_trajectory_direction
- tidy
* remove eps ---------
-
chore(autoware_trajectory): relax the warning condition of boundary check (#393)
- chore(autoware_trajectory): relax the warning condition of boundary check
* tidy
-
feat(trajectory): define distance threshold and refine restore() without API breakage(in experimental) (#376)
- feat(trajectory): define distance threshold and refine restore
* fix spell ---------
-
feat(autoware_trajectory): add get_contained_lane_ids function (#369)
- add get_contained_lane_ids
- add unit test
* remove assert ---------
-
feat(trajectory): add pretty_build() function for Planning/Control component node (#332)
-
refactor(autoware_trajectory)!: move everything to namespace experimetal (#371) refactor(autoware_trajectory)!: move everything to namespace experimental
-
feat(trajectory): improve shift function and their documents (#337)
- feat(trajectory): add populate function
- update curvature figure for approximation desc
- update align_orientation_with_trajectory_direction fig
- finished trajectory classes
- refactored shift
- add comment
* update error message ---------
-
fix(autoware_trajectory): fix base_addition callback to work when Trajectory is moved (#370)
-
fix(autoware_trajectory): check vector size check before accessing (#365)
- fix(autoware_trajectory): check vector size check before accessing
- update
* minor fix ---------Co-authored-by: Mamoru Sobue <<hilo.soblin@gmail.com>>
-
feat(autoware_trajectory): improve performance of get_underlying_base (#298)
-
feat(trajectory): add API documentation for trajectory class, add some utillity (#295)
-
feat(trajectory): add API description, nomenclature, illustration, rename functions to align with nomenclature (#292)
- feat(trajectory): add API description, nomenclature, illustration, rename functions to align with nomenclature
* resurrect get_internal_base ---------
-
chore: include iostream and link yaml-cpp for Jazzy (#351)
-
Contributors: Mamoru Sobue, Tim Clephas, Yukinari Hisaki
1.0.0 (2025-03-31)
- feat(trajectory): remove default ctor and collect default setting in
File truncated at 100 lines see the full file