Package symbol

autoware_trajectory package from autoware_core repo

autoware_adapi_specs autoware_core autoware_component_interface_specs autoware_geography_utils autoware_global_parameter_loader autoware_interpolation autoware_kalman_filter autoware_lanelet2_utils autoware_motion_utils autoware_node autoware_object_recognition_utils autoware_osqp_interface autoware_point_types autoware_qp_interface autoware_signal_processing autoware_trajectory autoware_vehicle_info_utils autoware_core_control autoware_simple_pure_pursuit autoware_core_localization autoware_ekf_localizer autoware_gyro_odometer autoware_localization_util autoware_ndt_scan_matcher autoware_pose_initializer autoware_stop_filter autoware_twist2accel autoware_core_map autoware_lanelet2_map_visualizer autoware_map_height_fitter autoware_map_loader autoware_map_projection_loader autoware_core_perception autoware_euclidean_cluster_object_detector autoware_ground_filter autoware_perception_objects_converter autoware_core_planning autoware_mission_planner autoware_objects_of_interest_marker_interface autoware_path_generator autoware_planning_factor_interface autoware_planning_topic_converter autoware_route_handler autoware_velocity_smoother autoware_behavior_velocity_planner autoware_behavior_velocity_planner_common autoware_behavior_velocity_stop_line_module autoware_motion_velocity_obstacle_stop_module autoware_motion_velocity_planner autoware_motion_velocity_planner_common autoware_core_sensing autoware_crop_box_filter autoware_downsample_filters autoware_gnss_poser autoware_vehicle_velocity_converter autoware_planning_test_manager autoware_pyplot autoware_test_node autoware_test_utils autoware_testing autoware_core_vehicle

ROS Distro
humble

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

The autoware_trajectory package

Additional Links

No 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

interpolators View in Drawio

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<–


![overview_trajectory](./images/overview/trajectory.drawio.svg)
[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).                                                                                                                                                                                                                                    | ![curve](./images/nomenclature/curve.drawio.svg)<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.                                                                                                     | ![approximation](./images/nomenclature/approximation.drawio.svg)<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. | ![curvature](./images/nomenclature/curvature.drawio.svg)<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<--

akima_spline View in Drawio

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

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

This package does not provide any links to tutorials in it's rosindex metadata. You can check on the ROS Wiki Tutorials page for the package.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged autoware_trajectory at Robotics Stack Exchange

No version for distro jazzy showing humble. Known supported distros are highlighted in the buttons above.
Package symbol

autoware_trajectory package from autoware_core repo

autoware_adapi_specs autoware_core autoware_component_interface_specs autoware_geography_utils autoware_global_parameter_loader autoware_interpolation autoware_kalman_filter autoware_lanelet2_utils autoware_motion_utils autoware_node autoware_object_recognition_utils autoware_osqp_interface autoware_point_types autoware_qp_interface autoware_signal_processing autoware_trajectory autoware_vehicle_info_utils autoware_core_control autoware_simple_pure_pursuit autoware_core_localization autoware_ekf_localizer autoware_gyro_odometer autoware_localization_util autoware_ndt_scan_matcher autoware_pose_initializer autoware_stop_filter autoware_twist2accel autoware_core_map autoware_lanelet2_map_visualizer autoware_map_height_fitter autoware_map_loader autoware_map_projection_loader autoware_core_perception autoware_euclidean_cluster_object_detector autoware_ground_filter autoware_perception_objects_converter autoware_core_planning autoware_mission_planner autoware_objects_of_interest_marker_interface autoware_path_generator autoware_planning_factor_interface autoware_planning_topic_converter autoware_route_handler autoware_velocity_smoother autoware_behavior_velocity_planner autoware_behavior_velocity_planner_common autoware_behavior_velocity_stop_line_module autoware_motion_velocity_obstacle_stop_module autoware_motion_velocity_planner autoware_motion_velocity_planner_common autoware_core_sensing autoware_crop_box_filter autoware_downsample_filters autoware_gnss_poser autoware_vehicle_velocity_converter autoware_planning_test_manager autoware_pyplot autoware_test_node autoware_test_utils autoware_testing autoware_core_vehicle

ROS Distro
humble

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

The autoware_trajectory package

Additional Links

No 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

interpolators View in Drawio

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<–


![overview_trajectory](./images/overview/trajectory.drawio.svg)
[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).                                                                                                                                                                                                                                    | ![curve](./images/nomenclature/curve.drawio.svg)<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.                                                                                                     | ![approximation](./images/nomenclature/approximation.drawio.svg)<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. | ![curvature](./images/nomenclature/curvature.drawio.svg)<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<--

akima_spline View in Drawio

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

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

This package does not provide any links to tutorials in it's rosindex metadata. You can check on the ROS Wiki Tutorials page for the package.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged autoware_trajectory at Robotics Stack Exchange

No version for distro kilted showing humble. Known supported distros are highlighted in the buttons above.
Package symbol

autoware_trajectory package from autoware_core repo

autoware_adapi_specs autoware_core autoware_component_interface_specs autoware_geography_utils autoware_global_parameter_loader autoware_interpolation autoware_kalman_filter autoware_lanelet2_utils autoware_motion_utils autoware_node autoware_object_recognition_utils autoware_osqp_interface autoware_point_types autoware_qp_interface autoware_signal_processing autoware_trajectory autoware_vehicle_info_utils autoware_core_control autoware_simple_pure_pursuit autoware_core_localization autoware_ekf_localizer autoware_gyro_odometer autoware_localization_util autoware_ndt_scan_matcher autoware_pose_initializer autoware_stop_filter autoware_twist2accel autoware_core_map autoware_lanelet2_map_visualizer autoware_map_height_fitter autoware_map_loader autoware_map_projection_loader autoware_core_perception autoware_euclidean_cluster_object_detector autoware_ground_filter autoware_perception_objects_converter autoware_core_planning autoware_mission_planner autoware_objects_of_interest_marker_interface autoware_path_generator autoware_planning_factor_interface autoware_planning_topic_converter autoware_route_handler autoware_velocity_smoother autoware_behavior_velocity_planner autoware_behavior_velocity_planner_common autoware_behavior_velocity_stop_line_module autoware_motion_velocity_obstacle_stop_module autoware_motion_velocity_planner autoware_motion_velocity_planner_common autoware_core_sensing autoware_crop_box_filter autoware_downsample_filters autoware_gnss_poser autoware_vehicle_velocity_converter autoware_planning_test_manager autoware_pyplot autoware_test_node autoware_test_utils autoware_testing autoware_core_vehicle

ROS Distro
humble

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

The autoware_trajectory package

Additional Links

No 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

interpolators View in Drawio

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<–


![overview_trajectory](./images/overview/trajectory.drawio.svg)
[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).                                                                                                                                                                                                                                    | ![curve](./images/nomenclature/curve.drawio.svg)<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.                                                                                                     | ![approximation](./images/nomenclature/approximation.drawio.svg)<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. | ![curvature](./images/nomenclature/curvature.drawio.svg)<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<--

akima_spline View in Drawio

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

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

This package does not provide any links to tutorials in it's rosindex metadata. You can check on the ROS Wiki Tutorials page for the package.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged autoware_trajectory at Robotics Stack Exchange

No version for distro rolling showing humble. Known supported distros are highlighted in the buttons above.
Package symbol

autoware_trajectory package from autoware_core repo

autoware_adapi_specs autoware_core autoware_component_interface_specs autoware_geography_utils autoware_global_parameter_loader autoware_interpolation autoware_kalman_filter autoware_lanelet2_utils autoware_motion_utils autoware_node autoware_object_recognition_utils autoware_osqp_interface autoware_point_types autoware_qp_interface autoware_signal_processing autoware_trajectory autoware_vehicle_info_utils autoware_core_control autoware_simple_pure_pursuit autoware_core_localization autoware_ekf_localizer autoware_gyro_odometer autoware_localization_util autoware_ndt_scan_matcher autoware_pose_initializer autoware_stop_filter autoware_twist2accel autoware_core_map autoware_lanelet2_map_visualizer autoware_map_height_fitter autoware_map_loader autoware_map_projection_loader autoware_core_perception autoware_euclidean_cluster_object_detector autoware_ground_filter autoware_perception_objects_converter autoware_core_planning autoware_mission_planner autoware_objects_of_interest_marker_interface autoware_path_generator autoware_planning_factor_interface autoware_planning_topic_converter autoware_route_handler autoware_velocity_smoother autoware_behavior_velocity_planner autoware_behavior_velocity_planner_common autoware_behavior_velocity_stop_line_module autoware_motion_velocity_obstacle_stop_module autoware_motion_velocity_planner autoware_motion_velocity_planner_common autoware_core_sensing autoware_crop_box_filter autoware_downsample_filters autoware_gnss_poser autoware_vehicle_velocity_converter autoware_planning_test_manager autoware_pyplot autoware_test_node autoware_test_utils autoware_testing autoware_core_vehicle

ROS Distro
humble

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

The autoware_trajectory package

Additional Links

No 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

interpolators View in Drawio

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<–


![overview_trajectory](./images/overview/trajectory.drawio.svg)
[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).                                                                                                                                                                                                                                    | ![curve](./images/nomenclature/curve.drawio.svg)<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.                                                                                                     | ![approximation](./images/nomenclature/approximation.drawio.svg)<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. | ![curvature](./images/nomenclature/curvature.drawio.svg)<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<--

akima_spline View in Drawio

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

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

This package does not provide any links to tutorials in it's rosindex metadata. You can check on the ROS Wiki Tutorials page for the package.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged autoware_trajectory at Robotics Stack Exchange

No version for distro ardent showing humble. Known supported distros are highlighted in the buttons above.
Package symbol

autoware_trajectory package from autoware_core repo

autoware_adapi_specs autoware_core autoware_component_interface_specs autoware_geography_utils autoware_global_parameter_loader autoware_interpolation autoware_kalman_filter autoware_lanelet2_utils autoware_motion_utils autoware_node autoware_object_recognition_utils autoware_osqp_interface autoware_point_types autoware_qp_interface autoware_signal_processing autoware_trajectory autoware_vehicle_info_utils autoware_core_control autoware_simple_pure_pursuit autoware_core_localization autoware_ekf_localizer autoware_gyro_odometer autoware_localization_util autoware_ndt_scan_matcher autoware_pose_initializer autoware_stop_filter autoware_twist2accel autoware_core_map autoware_lanelet2_map_visualizer autoware_map_height_fitter autoware_map_loader autoware_map_projection_loader autoware_core_perception autoware_euclidean_cluster_object_detector autoware_ground_filter autoware_perception_objects_converter autoware_core_planning autoware_mission_planner autoware_objects_of_interest_marker_interface autoware_path_generator autoware_planning_factor_interface autoware_planning_topic_converter autoware_route_handler autoware_velocity_smoother autoware_behavior_velocity_planner autoware_behavior_velocity_planner_common autoware_behavior_velocity_stop_line_module autoware_motion_velocity_obstacle_stop_module autoware_motion_velocity_planner autoware_motion_velocity_planner_common autoware_core_sensing autoware_crop_box_filter autoware_downsample_filters autoware_gnss_poser autoware_vehicle_velocity_converter autoware_planning_test_manager autoware_pyplot autoware_test_node autoware_test_utils autoware_testing autoware_core_vehicle

ROS Distro
humble

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

The autoware_trajectory package

Additional Links

No 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

interpolators View in Drawio

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<–


![overview_trajectory](./images/overview/trajectory.drawio.svg)
[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).                                                                                                                                                                                                                                    | ![curve](./images/nomenclature/curve.drawio.svg)<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.                                                                                                     | ![approximation](./images/nomenclature/approximation.drawio.svg)<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. | ![curvature](./images/nomenclature/curvature.drawio.svg)<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<--

akima_spline View in Drawio

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

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

This package does not provide any links to tutorials in it's rosindex metadata. You can check on the ROS Wiki Tutorials page for the package.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged autoware_trajectory at Robotics Stack Exchange

No version for distro bouncy showing humble. Known supported distros are highlighted in the buttons above.
Package symbol

autoware_trajectory package from autoware_core repo

autoware_adapi_specs autoware_core autoware_component_interface_specs autoware_geography_utils autoware_global_parameter_loader autoware_interpolation autoware_kalman_filter autoware_lanelet2_utils autoware_motion_utils autoware_node autoware_object_recognition_utils autoware_osqp_interface autoware_point_types autoware_qp_interface autoware_signal_processing autoware_trajectory autoware_vehicle_info_utils autoware_core_control autoware_simple_pure_pursuit autoware_core_localization autoware_ekf_localizer autoware_gyro_odometer autoware_localization_util autoware_ndt_scan_matcher autoware_pose_initializer autoware_stop_filter autoware_twist2accel autoware_core_map autoware_lanelet2_map_visualizer autoware_map_height_fitter autoware_map_loader autoware_map_projection_loader autoware_core_perception autoware_euclidean_cluster_object_detector autoware_ground_filter autoware_perception_objects_converter autoware_core_planning autoware_mission_planner autoware_objects_of_interest_marker_interface autoware_path_generator autoware_planning_factor_interface autoware_planning_topic_converter autoware_route_handler autoware_velocity_smoother autoware_behavior_velocity_planner autoware_behavior_velocity_planner_common autoware_behavior_velocity_stop_line_module autoware_motion_velocity_obstacle_stop_module autoware_motion_velocity_planner autoware_motion_velocity_planner_common autoware_core_sensing autoware_crop_box_filter autoware_downsample_filters autoware_gnss_poser autoware_vehicle_velocity_converter autoware_planning_test_manager autoware_pyplot autoware_test_node autoware_test_utils autoware_testing autoware_core_vehicle

ROS Distro
humble

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

The autoware_trajectory package

Additional Links

No 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

interpolators View in Drawio

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<–


![overview_trajectory](./images/overview/trajectory.drawio.svg)
[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).                                                                                                                                                                                                                                    | ![curve](./images/nomenclature/curve.drawio.svg)<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.                                                                                                     | ![approximation](./images/nomenclature/approximation.drawio.svg)<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. | ![curvature](./images/nomenclature/curvature.drawio.svg)<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<--

akima_spline View in Drawio

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

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

This package does not provide any links to tutorials in it's rosindex metadata. You can check on the ROS Wiki Tutorials page for the package.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged autoware_trajectory at Robotics Stack Exchange

No version for distro crystal showing humble. Known supported distros are highlighted in the buttons above.
Package symbol

autoware_trajectory package from autoware_core repo

autoware_adapi_specs autoware_core autoware_component_interface_specs autoware_geography_utils autoware_global_parameter_loader autoware_interpolation autoware_kalman_filter autoware_lanelet2_utils autoware_motion_utils autoware_node autoware_object_recognition_utils autoware_osqp_interface autoware_point_types autoware_qp_interface autoware_signal_processing autoware_trajectory autoware_vehicle_info_utils autoware_core_control autoware_simple_pure_pursuit autoware_core_localization autoware_ekf_localizer autoware_gyro_odometer autoware_localization_util autoware_ndt_scan_matcher autoware_pose_initializer autoware_stop_filter autoware_twist2accel autoware_core_map autoware_lanelet2_map_visualizer autoware_map_height_fitter autoware_map_loader autoware_map_projection_loader autoware_core_perception autoware_euclidean_cluster_object_detector autoware_ground_filter autoware_perception_objects_converter autoware_core_planning autoware_mission_planner autoware_objects_of_interest_marker_interface autoware_path_generator autoware_planning_factor_interface autoware_planning_topic_converter autoware_route_handler autoware_velocity_smoother autoware_behavior_velocity_planner autoware_behavior_velocity_planner_common autoware_behavior_velocity_stop_line_module autoware_motion_velocity_obstacle_stop_module autoware_motion_velocity_planner autoware_motion_velocity_planner_common autoware_core_sensing autoware_crop_box_filter autoware_downsample_filters autoware_gnss_poser autoware_vehicle_velocity_converter autoware_planning_test_manager autoware_pyplot autoware_test_node autoware_test_utils autoware_testing autoware_core_vehicle

ROS Distro
humble

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

The autoware_trajectory package

Additional Links

No 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

interpolators View in Drawio

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<–


![overview_trajectory](./images/overview/trajectory.drawio.svg)
[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).                                                                                                                                                                                                                                    | ![curve](./images/nomenclature/curve.drawio.svg)<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.                                                                                                     | ![approximation](./images/nomenclature/approximation.drawio.svg)<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. | ![curvature](./images/nomenclature/curvature.drawio.svg)<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<--

akima_spline View in Drawio

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

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

This package does not provide any links to tutorials in it's rosindex metadata. You can check on the ROS Wiki Tutorials page for the package.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged autoware_trajectory at Robotics Stack Exchange

No version for distro eloquent showing humble. Known supported distros are highlighted in the buttons above.
Package symbol

autoware_trajectory package from autoware_core repo

autoware_adapi_specs autoware_core autoware_component_interface_specs autoware_geography_utils autoware_global_parameter_loader autoware_interpolation autoware_kalman_filter autoware_lanelet2_utils autoware_motion_utils autoware_node autoware_object_recognition_utils autoware_osqp_interface autoware_point_types autoware_qp_interface autoware_signal_processing autoware_trajectory autoware_vehicle_info_utils autoware_core_control autoware_simple_pure_pursuit autoware_core_localization autoware_ekf_localizer autoware_gyro_odometer autoware_localization_util autoware_ndt_scan_matcher autoware_pose_initializer autoware_stop_filter autoware_twist2accel autoware_core_map autoware_lanelet2_map_visualizer autoware_map_height_fitter autoware_map_loader autoware_map_projection_loader autoware_core_perception autoware_euclidean_cluster_object_detector autoware_ground_filter autoware_perception_objects_converter autoware_core_planning autoware_mission_planner autoware_objects_of_interest_marker_interface autoware_path_generator autoware_planning_factor_interface autoware_planning_topic_converter autoware_route_handler autoware_velocity_smoother autoware_behavior_velocity_planner autoware_behavior_velocity_planner_common autoware_behavior_velocity_stop_line_module autoware_motion_velocity_obstacle_stop_module autoware_motion_velocity_planner autoware_motion_velocity_planner_common autoware_core_sensing autoware_crop_box_filter autoware_downsample_filters autoware_gnss_poser autoware_vehicle_velocity_converter autoware_planning_test_manager autoware_pyplot autoware_test_node autoware_test_utils autoware_testing autoware_core_vehicle

ROS Distro
humble

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

The autoware_trajectory package

Additional Links

No 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

interpolators View in Drawio

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<–


![overview_trajectory](./images/overview/trajectory.drawio.svg)
[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).                                                                                                                                                                                                                                    | ![curve](./images/nomenclature/curve.drawio.svg)<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.                                                                                                     | ![approximation](./images/nomenclature/approximation.drawio.svg)<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. | ![curvature](./images/nomenclature/curvature.drawio.svg)<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<--

akima_spline View in Drawio

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

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

This package does not provide any links to tutorials in it's rosindex metadata. You can check on the ROS Wiki Tutorials page for the package.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged autoware_trajectory at Robotics Stack Exchange

No version for distro dashing showing humble. Known supported distros are highlighted in the buttons above.
Package symbol

autoware_trajectory package from autoware_core repo

autoware_adapi_specs autoware_core autoware_component_interface_specs autoware_geography_utils autoware_global_parameter_loader autoware_interpolation autoware_kalman_filter autoware_lanelet2_utils autoware_motion_utils autoware_node autoware_object_recognition_utils autoware_osqp_interface autoware_point_types autoware_qp_interface autoware_signal_processing autoware_trajectory autoware_vehicle_info_utils autoware_core_control autoware_simple_pure_pursuit autoware_core_localization autoware_ekf_localizer autoware_gyro_odometer autoware_localization_util autoware_ndt_scan_matcher autoware_pose_initializer autoware_stop_filter autoware_twist2accel autoware_core_map autoware_lanelet2_map_visualizer autoware_map_height_fitter autoware_map_loader autoware_map_projection_loader autoware_core_perception autoware_euclidean_cluster_object_detector autoware_ground_filter autoware_perception_objects_converter autoware_core_planning autoware_mission_planner autoware_objects_of_interest_marker_interface autoware_path_generator autoware_planning_factor_interface autoware_planning_topic_converter autoware_route_handler autoware_velocity_smoother autoware_behavior_velocity_planner autoware_behavior_velocity_planner_common autoware_behavior_velocity_stop_line_module autoware_motion_velocity_obstacle_stop_module autoware_motion_velocity_planner autoware_motion_velocity_planner_common autoware_core_sensing autoware_crop_box_filter autoware_downsample_filters autoware_gnss_poser autoware_vehicle_velocity_converter autoware_planning_test_manager autoware_pyplot autoware_test_node autoware_test_utils autoware_testing autoware_core_vehicle

ROS Distro
humble

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

The autoware_trajectory package

Additional Links

No 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

interpolators View in Drawio

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<–


![overview_trajectory](./images/overview/trajectory.drawio.svg)
[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).                                                                                                                                                                                                                                    | ![curve](./images/nomenclature/curve.drawio.svg)<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.                                                                                                     | ![approximation](./images/nomenclature/approximation.drawio.svg)<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. | ![curvature](./images/nomenclature/curvature.drawio.svg)<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<--

akima_spline View in Drawio

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

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

This package does not provide any links to tutorials in it's rosindex metadata. You can check on the ROS Wiki Tutorials page for the package.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged autoware_trajectory at Robotics Stack Exchange

No version for distro galactic showing humble. Known supported distros are highlighted in the buttons above.
Package symbol

autoware_trajectory package from autoware_core repo

autoware_adapi_specs autoware_core autoware_component_interface_specs autoware_geography_utils autoware_global_parameter_loader autoware_interpolation autoware_kalman_filter autoware_lanelet2_utils autoware_motion_utils autoware_node autoware_object_recognition_utils autoware_osqp_interface autoware_point_types autoware_qp_interface autoware_signal_processing autoware_trajectory autoware_vehicle_info_utils autoware_core_control autoware_simple_pure_pursuit autoware_core_localization autoware_ekf_localizer autoware_gyro_odometer autoware_localization_util autoware_ndt_scan_matcher autoware_pose_initializer autoware_stop_filter autoware_twist2accel autoware_core_map autoware_lanelet2_map_visualizer autoware_map_height_fitter autoware_map_loader autoware_map_projection_loader autoware_core_perception autoware_euclidean_cluster_object_detector autoware_ground_filter autoware_perception_objects_converter autoware_core_planning autoware_mission_planner autoware_objects_of_interest_marker_interface autoware_path_generator autoware_planning_factor_interface autoware_planning_topic_converter autoware_route_handler autoware_velocity_smoother autoware_behavior_velocity_planner autoware_behavior_velocity_planner_common autoware_behavior_velocity_stop_line_module autoware_motion_velocity_obstacle_stop_module autoware_motion_velocity_planner autoware_motion_velocity_planner_common autoware_core_sensing autoware_crop_box_filter autoware_downsample_filters autoware_gnss_poser autoware_vehicle_velocity_converter autoware_planning_test_manager autoware_pyplot autoware_test_node autoware_test_utils autoware_testing autoware_core_vehicle

ROS Distro
humble

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

The autoware_trajectory package

Additional Links

No 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

interpolators View in Drawio

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<–


![overview_trajectory](./images/overview/trajectory.drawio.svg)
[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).                                                                                                                                                                                                                                    | ![curve](./images/nomenclature/curve.drawio.svg)<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.                                                                                                     | ![approximation](./images/nomenclature/approximation.drawio.svg)<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. | ![curvature](./images/nomenclature/curvature.drawio.svg)<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<--

akima_spline View in Drawio

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

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

This package does not provide any links to tutorials in it's rosindex metadata. You can check on the ROS Wiki Tutorials page for the package.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged autoware_trajectory at Robotics Stack Exchange

No version for distro foxy showing humble. Known supported distros are highlighted in the buttons above.
Package symbol

autoware_trajectory package from autoware_core repo

autoware_adapi_specs autoware_core autoware_component_interface_specs autoware_geography_utils autoware_global_parameter_loader autoware_interpolation autoware_kalman_filter autoware_lanelet2_utils autoware_motion_utils autoware_node autoware_object_recognition_utils autoware_osqp_interface autoware_point_types autoware_qp_interface autoware_signal_processing autoware_trajectory autoware_vehicle_info_utils autoware_core_control autoware_simple_pure_pursuit autoware_core_localization autoware_ekf_localizer autoware_gyro_odometer autoware_localization_util autoware_ndt_scan_matcher autoware_pose_initializer autoware_stop_filter autoware_twist2accel autoware_core_map autoware_lanelet2_map_visualizer autoware_map_height_fitter autoware_map_loader autoware_map_projection_loader autoware_core_perception autoware_euclidean_cluster_object_detector autoware_ground_filter autoware_perception_objects_converter autoware_core_planning autoware_mission_planner autoware_objects_of_interest_marker_interface autoware_path_generator autoware_planning_factor_interface autoware_planning_topic_converter autoware_route_handler autoware_velocity_smoother autoware_behavior_velocity_planner autoware_behavior_velocity_planner_common autoware_behavior_velocity_stop_line_module autoware_motion_velocity_obstacle_stop_module autoware_motion_velocity_planner autoware_motion_velocity_planner_common autoware_core_sensing autoware_crop_box_filter autoware_downsample_filters autoware_gnss_poser autoware_vehicle_velocity_converter autoware_planning_test_manager autoware_pyplot autoware_test_node autoware_test_utils autoware_testing autoware_core_vehicle

ROS Distro
humble

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

The autoware_trajectory package

Additional Links

No 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

interpolators View in Drawio

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<–


![overview_trajectory](./images/overview/trajectory.drawio.svg)
[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).                                                                                                                                                                                                                                    | ![curve](./images/nomenclature/curve.drawio.svg)<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.                                                                                                     | ![approximation](./images/nomenclature/approximation.drawio.svg)<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. | ![curvature](./images/nomenclature/curvature.drawio.svg)<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<--

akima_spline View in Drawio

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

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

This package does not provide any links to tutorials in it's rosindex metadata. You can check on the ROS Wiki Tutorials page for the package.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged autoware_trajectory at Robotics Stack Exchange

No version for distro iron showing humble. Known supported distros are highlighted in the buttons above.
Package symbol

autoware_trajectory package from autoware_core repo

autoware_adapi_specs autoware_core autoware_component_interface_specs autoware_geography_utils autoware_global_parameter_loader autoware_interpolation autoware_kalman_filter autoware_lanelet2_utils autoware_motion_utils autoware_node autoware_object_recognition_utils autoware_osqp_interface autoware_point_types autoware_qp_interface autoware_signal_processing autoware_trajectory autoware_vehicle_info_utils autoware_core_control autoware_simple_pure_pursuit autoware_core_localization autoware_ekf_localizer autoware_gyro_odometer autoware_localization_util autoware_ndt_scan_matcher autoware_pose_initializer autoware_stop_filter autoware_twist2accel autoware_core_map autoware_lanelet2_map_visualizer autoware_map_height_fitter autoware_map_loader autoware_map_projection_loader autoware_core_perception autoware_euclidean_cluster_object_detector autoware_ground_filter autoware_perception_objects_converter autoware_core_planning autoware_mission_planner autoware_objects_of_interest_marker_interface autoware_path_generator autoware_planning_factor_interface autoware_planning_topic_converter autoware_route_handler autoware_velocity_smoother autoware_behavior_velocity_planner autoware_behavior_velocity_planner_common autoware_behavior_velocity_stop_line_module autoware_motion_velocity_obstacle_stop_module autoware_motion_velocity_planner autoware_motion_velocity_planner_common autoware_core_sensing autoware_crop_box_filter autoware_downsample_filters autoware_gnss_poser autoware_vehicle_velocity_converter autoware_planning_test_manager autoware_pyplot autoware_test_node autoware_test_utils autoware_testing autoware_core_vehicle

ROS Distro
humble

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

The autoware_trajectory package

Additional Links

No 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

interpolators View in Drawio

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<–


![overview_trajectory](./images/overview/trajectory.drawio.svg)
[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).                                                                                                                                                                                                                                    | ![curve](./images/nomenclature/curve.drawio.svg)<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.                                                                                                     | ![approximation](./images/nomenclature/approximation.drawio.svg)<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. | ![curvature](./images/nomenclature/curvature.drawio.svg)<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<--

akima_spline View in Drawio

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

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

This package does not provide any links to tutorials in it's rosindex metadata. You can check on the ROS Wiki Tutorials page for the package.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged autoware_trajectory at Robotics Stack Exchange

No version for distro lunar showing humble. Known supported distros are highlighted in the buttons above.
Package symbol

autoware_trajectory package from autoware_core repo

autoware_adapi_specs autoware_core autoware_component_interface_specs autoware_geography_utils autoware_global_parameter_loader autoware_interpolation autoware_kalman_filter autoware_lanelet2_utils autoware_motion_utils autoware_node autoware_object_recognition_utils autoware_osqp_interface autoware_point_types autoware_qp_interface autoware_signal_processing autoware_trajectory autoware_vehicle_info_utils autoware_core_control autoware_simple_pure_pursuit autoware_core_localization autoware_ekf_localizer autoware_gyro_odometer autoware_localization_util autoware_ndt_scan_matcher autoware_pose_initializer autoware_stop_filter autoware_twist2accel autoware_core_map autoware_lanelet2_map_visualizer autoware_map_height_fitter autoware_map_loader autoware_map_projection_loader autoware_core_perception autoware_euclidean_cluster_object_detector autoware_ground_filter autoware_perception_objects_converter autoware_core_planning autoware_mission_planner autoware_objects_of_interest_marker_interface autoware_path_generator autoware_planning_factor_interface autoware_planning_topic_converter autoware_route_handler autoware_velocity_smoother autoware_behavior_velocity_planner autoware_behavior_velocity_planner_common autoware_behavior_velocity_stop_line_module autoware_motion_velocity_obstacle_stop_module autoware_motion_velocity_planner autoware_motion_velocity_planner_common autoware_core_sensing autoware_crop_box_filter autoware_downsample_filters autoware_gnss_poser autoware_vehicle_velocity_converter autoware_planning_test_manager autoware_pyplot autoware_test_node autoware_test_utils autoware_testing autoware_core_vehicle

ROS Distro
humble

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

The autoware_trajectory package

Additional Links

No 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

interpolators View in Drawio

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<–


![overview_trajectory](./images/overview/trajectory.drawio.svg)
[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).                                                                                                                                                                                                                                    | ![curve](./images/nomenclature/curve.drawio.svg)<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.                                                                                                     | ![approximation](./images/nomenclature/approximation.drawio.svg)<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. | ![curvature](./images/nomenclature/curvature.drawio.svg)<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<--

akima_spline View in Drawio

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

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

This package does not provide any links to tutorials in it's rosindex metadata. You can check on the ROS Wiki Tutorials page for the package.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged autoware_trajectory at Robotics Stack Exchange

No version for distro jade showing humble. Known supported distros are highlighted in the buttons above.
Package symbol

autoware_trajectory package from autoware_core repo

autoware_adapi_specs autoware_core autoware_component_interface_specs autoware_geography_utils autoware_global_parameter_loader autoware_interpolation autoware_kalman_filter autoware_lanelet2_utils autoware_motion_utils autoware_node autoware_object_recognition_utils autoware_osqp_interface autoware_point_types autoware_qp_interface autoware_signal_processing autoware_trajectory autoware_vehicle_info_utils autoware_core_control autoware_simple_pure_pursuit autoware_core_localization autoware_ekf_localizer autoware_gyro_odometer autoware_localization_util autoware_ndt_scan_matcher autoware_pose_initializer autoware_stop_filter autoware_twist2accel autoware_core_map autoware_lanelet2_map_visualizer autoware_map_height_fitter autoware_map_loader autoware_map_projection_loader autoware_core_perception autoware_euclidean_cluster_object_detector autoware_ground_filter autoware_perception_objects_converter autoware_core_planning autoware_mission_planner autoware_objects_of_interest_marker_interface autoware_path_generator autoware_planning_factor_interface autoware_planning_topic_converter autoware_route_handler autoware_velocity_smoother autoware_behavior_velocity_planner autoware_behavior_velocity_planner_common autoware_behavior_velocity_stop_line_module autoware_motion_velocity_obstacle_stop_module autoware_motion_velocity_planner autoware_motion_velocity_planner_common autoware_core_sensing autoware_crop_box_filter autoware_downsample_filters autoware_gnss_poser autoware_vehicle_velocity_converter autoware_planning_test_manager autoware_pyplot autoware_test_node autoware_test_utils autoware_testing autoware_core_vehicle

ROS Distro
humble

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

The autoware_trajectory package

Additional Links

No 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

interpolators View in Drawio

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<–


![overview_trajectory](./images/overview/trajectory.drawio.svg)
[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).                                                                                                                                                                                                                                    | ![curve](./images/nomenclature/curve.drawio.svg)<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.                                                                                                     | ![approximation](./images/nomenclature/approximation.drawio.svg)<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. | ![curvature](./images/nomenclature/curvature.drawio.svg)<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<--

akima_spline View in Drawio

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

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

This package does not provide any links to tutorials in it's rosindex metadata. You can check on the ROS Wiki Tutorials page for the package.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged autoware_trajectory at Robotics Stack Exchange

No version for distro indigo showing humble. Known supported distros are highlighted in the buttons above.
Package symbol

autoware_trajectory package from autoware_core repo

autoware_adapi_specs autoware_core autoware_component_interface_specs autoware_geography_utils autoware_global_parameter_loader autoware_interpolation autoware_kalman_filter autoware_lanelet2_utils autoware_motion_utils autoware_node autoware_object_recognition_utils autoware_osqp_interface autoware_point_types autoware_qp_interface autoware_signal_processing autoware_trajectory autoware_vehicle_info_utils autoware_core_control autoware_simple_pure_pursuit autoware_core_localization autoware_ekf_localizer autoware_gyro_odometer autoware_localization_util autoware_ndt_scan_matcher autoware_pose_initializer autoware_stop_filter autoware_twist2accel autoware_core_map autoware_lanelet2_map_visualizer autoware_map_height_fitter autoware_map_loader autoware_map_projection_loader autoware_core_perception autoware_euclidean_cluster_object_detector autoware_ground_filter autoware_perception_objects_converter autoware_core_planning autoware_mission_planner autoware_objects_of_interest_marker_interface autoware_path_generator autoware_planning_factor_interface autoware_planning_topic_converter autoware_route_handler autoware_velocity_smoother autoware_behavior_velocity_planner autoware_behavior_velocity_planner_common autoware_behavior_velocity_stop_line_module autoware_motion_velocity_obstacle_stop_module autoware_motion_velocity_planner autoware_motion_velocity_planner_common autoware_core_sensing autoware_crop_box_filter autoware_downsample_filters autoware_gnss_poser autoware_vehicle_velocity_converter autoware_planning_test_manager autoware_pyplot autoware_test_node autoware_test_utils autoware_testing autoware_core_vehicle

ROS Distro
humble

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

The autoware_trajectory package

Additional Links

No 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

interpolators View in Drawio

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<–


![overview_trajectory](./images/overview/trajectory.drawio.svg)
[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).                                                                                                                                                                                                                                    | ![curve](./images/nomenclature/curve.drawio.svg)<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.                                                                                                     | ![approximation](./images/nomenclature/approximation.drawio.svg)<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. | ![curvature](./images/nomenclature/curvature.drawio.svg)<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<--

akima_spline View in Drawio

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

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

This package does not provide any links to tutorials in it's rosindex metadata. You can check on the ROS Wiki Tutorials page for the package.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged autoware_trajectory at Robotics Stack Exchange

No version for distro hydro showing humble. Known supported distros are highlighted in the buttons above.
Package symbol

autoware_trajectory package from autoware_core repo

autoware_adapi_specs autoware_core autoware_component_interface_specs autoware_geography_utils autoware_global_parameter_loader autoware_interpolation autoware_kalman_filter autoware_lanelet2_utils autoware_motion_utils autoware_node autoware_object_recognition_utils autoware_osqp_interface autoware_point_types autoware_qp_interface autoware_signal_processing autoware_trajectory autoware_vehicle_info_utils autoware_core_control autoware_simple_pure_pursuit autoware_core_localization autoware_ekf_localizer autoware_gyro_odometer autoware_localization_util autoware_ndt_scan_matcher autoware_pose_initializer autoware_stop_filter autoware_twist2accel autoware_core_map autoware_lanelet2_map_visualizer autoware_map_height_fitter autoware_map_loader autoware_map_projection_loader autoware_core_perception autoware_euclidean_cluster_object_detector autoware_ground_filter autoware_perception_objects_converter autoware_core_planning autoware_mission_planner autoware_objects_of_interest_marker_interface autoware_path_generator autoware_planning_factor_interface autoware_planning_topic_converter autoware_route_handler autoware_velocity_smoother autoware_behavior_velocity_planner autoware_behavior_velocity_planner_common autoware_behavior_velocity_stop_line_module autoware_motion_velocity_obstacle_stop_module autoware_motion_velocity_planner autoware_motion_velocity_planner_common autoware_core_sensing autoware_crop_box_filter autoware_downsample_filters autoware_gnss_poser autoware_vehicle_velocity_converter autoware_planning_test_manager autoware_pyplot autoware_test_node autoware_test_utils autoware_testing autoware_core_vehicle

ROS Distro
humble

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

The autoware_trajectory package

Additional Links

No 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

interpolators View in Drawio

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<–


![overview_trajectory](./images/overview/trajectory.drawio.svg)
[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).                                                                                                                                                                                                                                    | ![curve](./images/nomenclature/curve.drawio.svg)<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.                                                                                                     | ![approximation](./images/nomenclature/approximation.drawio.svg)<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. | ![curvature](./images/nomenclature/curvature.drawio.svg)<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<--

akima_spline View in Drawio

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

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

This package does not provide any links to tutorials in it's rosindex metadata. You can check on the ROS Wiki Tutorials page for the package.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged autoware_trajectory at Robotics Stack Exchange

No version for distro kinetic showing humble. Known supported distros are highlighted in the buttons above.
Package symbol

autoware_trajectory package from autoware_core repo

autoware_adapi_specs autoware_core autoware_component_interface_specs autoware_geography_utils autoware_global_parameter_loader autoware_interpolation autoware_kalman_filter autoware_lanelet2_utils autoware_motion_utils autoware_node autoware_object_recognition_utils autoware_osqp_interface autoware_point_types autoware_qp_interface autoware_signal_processing autoware_trajectory autoware_vehicle_info_utils autoware_core_control autoware_simple_pure_pursuit autoware_core_localization autoware_ekf_localizer autoware_gyro_odometer autoware_localization_util autoware_ndt_scan_matcher autoware_pose_initializer autoware_stop_filter autoware_twist2accel autoware_core_map autoware_lanelet2_map_visualizer autoware_map_height_fitter autoware_map_loader autoware_map_projection_loader autoware_core_perception autoware_euclidean_cluster_object_detector autoware_ground_filter autoware_perception_objects_converter autoware_core_planning autoware_mission_planner autoware_objects_of_interest_marker_interface autoware_path_generator autoware_planning_factor_interface autoware_planning_topic_converter autoware_route_handler autoware_velocity_smoother autoware_behavior_velocity_planner autoware_behavior_velocity_planner_common autoware_behavior_velocity_stop_line_module autoware_motion_velocity_obstacle_stop_module autoware_motion_velocity_planner autoware_motion_velocity_planner_common autoware_core_sensing autoware_crop_box_filter autoware_downsample_filters autoware_gnss_poser autoware_vehicle_velocity_converter autoware_planning_test_manager autoware_pyplot autoware_test_node autoware_test_utils autoware_testing autoware_core_vehicle

ROS Distro
humble

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

The autoware_trajectory package

Additional Links

No 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

interpolators View in Drawio

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<–


![overview_trajectory](./images/overview/trajectory.drawio.svg)
[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).                                                                                                                                                                                                                                    | ![curve](./images/nomenclature/curve.drawio.svg)<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.                                                                                                     | ![approximation](./images/nomenclature/approximation.drawio.svg)<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. | ![curvature](./images/nomenclature/curvature.drawio.svg)<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<--

akima_spline View in Drawio

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

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

This package does not provide any links to tutorials in it's rosindex metadata. You can check on the ROS Wiki Tutorials page for the package.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged autoware_trajectory at Robotics Stack Exchange

No version for distro melodic showing humble. Known supported distros are highlighted in the buttons above.
Package symbol

autoware_trajectory package from autoware_core repo

autoware_adapi_specs autoware_core autoware_component_interface_specs autoware_geography_utils autoware_global_parameter_loader autoware_interpolation autoware_kalman_filter autoware_lanelet2_utils autoware_motion_utils autoware_node autoware_object_recognition_utils autoware_osqp_interface autoware_point_types autoware_qp_interface autoware_signal_processing autoware_trajectory autoware_vehicle_info_utils autoware_core_control autoware_simple_pure_pursuit autoware_core_localization autoware_ekf_localizer autoware_gyro_odometer autoware_localization_util autoware_ndt_scan_matcher autoware_pose_initializer autoware_stop_filter autoware_twist2accel autoware_core_map autoware_lanelet2_map_visualizer autoware_map_height_fitter autoware_map_loader autoware_map_projection_loader autoware_core_perception autoware_euclidean_cluster_object_detector autoware_ground_filter autoware_perception_objects_converter autoware_core_planning autoware_mission_planner autoware_objects_of_interest_marker_interface autoware_path_generator autoware_planning_factor_interface autoware_planning_topic_converter autoware_route_handler autoware_velocity_smoother autoware_behavior_velocity_planner autoware_behavior_velocity_planner_common autoware_behavior_velocity_stop_line_module autoware_motion_velocity_obstacle_stop_module autoware_motion_velocity_planner autoware_motion_velocity_planner_common autoware_core_sensing autoware_crop_box_filter autoware_downsample_filters autoware_gnss_poser autoware_vehicle_velocity_converter autoware_planning_test_manager autoware_pyplot autoware_test_node autoware_test_utils autoware_testing autoware_core_vehicle

ROS Distro
humble

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

The autoware_trajectory package

Additional Links

No 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

interpolators View in Drawio

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<–


![overview_trajectory](./images/overview/trajectory.drawio.svg)
[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).                                                                                                                                                                                                                                    | ![curve](./images/nomenclature/curve.drawio.svg)<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.                                                                                                     | ![approximation](./images/nomenclature/approximation.drawio.svg)<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. | ![curvature](./images/nomenclature/curvature.drawio.svg)<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<--

akima_spline View in Drawio

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

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

This package does not provide any links to tutorials in it's rosindex metadata. You can check on the ROS Wiki Tutorials page for the package.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged autoware_trajectory at Robotics Stack Exchange

No version for distro noetic showing humble. Known supported distros are highlighted in the buttons above.
Package symbol

autoware_trajectory package from autoware_core repo

autoware_adapi_specs autoware_core autoware_component_interface_specs autoware_geography_utils autoware_global_parameter_loader autoware_interpolation autoware_kalman_filter autoware_lanelet2_utils autoware_motion_utils autoware_node autoware_object_recognition_utils autoware_osqp_interface autoware_point_types autoware_qp_interface autoware_signal_processing autoware_trajectory autoware_vehicle_info_utils autoware_core_control autoware_simple_pure_pursuit autoware_core_localization autoware_ekf_localizer autoware_gyro_odometer autoware_localization_util autoware_ndt_scan_matcher autoware_pose_initializer autoware_stop_filter autoware_twist2accel autoware_core_map autoware_lanelet2_map_visualizer autoware_map_height_fitter autoware_map_loader autoware_map_projection_loader autoware_core_perception autoware_euclidean_cluster_object_detector autoware_ground_filter autoware_perception_objects_converter autoware_core_planning autoware_mission_planner autoware_objects_of_interest_marker_interface autoware_path_generator autoware_planning_factor_interface autoware_planning_topic_converter autoware_route_handler autoware_velocity_smoother autoware_behavior_velocity_planner autoware_behavior_velocity_planner_common autoware_behavior_velocity_stop_line_module autoware_motion_velocity_obstacle_stop_module autoware_motion_velocity_planner autoware_motion_velocity_planner_common autoware_core_sensing autoware_crop_box_filter autoware_downsample_filters autoware_gnss_poser autoware_vehicle_velocity_converter autoware_planning_test_manager autoware_pyplot autoware_test_node autoware_test_utils autoware_testing autoware_core_vehicle

ROS Distro
humble

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

The autoware_trajectory package

Additional Links

No 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

interpolators View in Drawio

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<–


![overview_trajectory](./images/overview/trajectory.drawio.svg)
[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).                                                                                                                                                                                                                                    | ![curve](./images/nomenclature/curve.drawio.svg)<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.                                                                                                     | ![approximation](./images/nomenclature/approximation.drawio.svg)<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. | ![curvature](./images/nomenclature/curvature.drawio.svg)<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<--

akima_spline View in Drawio

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

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

This package does not provide any links to tutorials in it's rosindex metadata. You can check on the ROS Wiki Tutorials page for the package.

Launch files

No launch files found

Messages

No message files found.

Services

No service files found

Plugins

No plugins found.

Recent questions tagged autoware_trajectory at Robotics Stack Exchange