diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
index 1406aee3849c0..a2daafa395cd5 100644
--- a/.github/CODEOWNERS
+++ b/.github/CODEOWNERS
@@ -1,9 +1,9 @@
### Copied from .github/CODEOWNERS-manual ###
### Automatically generated from package.xml ###
-common/autoware_ad_api_specs/** isamu.takagi@tier4.jp kahhooi.tan@tier4.jp kenji.miyake@tier4.jp makoto.yabuta@tier4.jp @autowarefoundation/autoware-global-codeowners
+common/autoware_ad_api_specs/** isamu.takagi@tier4.jp kahhooi.tan@tier4.jp makoto.yabuta@tier4.jp ryohsuke.mitsudome@tier4.jp @autowarefoundation/autoware-global-codeowners
common/autoware_auto_common/** opensource@apex.ai @autowarefoundation/autoware-global-codeowners
-common/autoware_auto_geometry/** opensource@apex.ai @autowarefoundation/autoware-global-codeowners
+common/autoware_auto_geometry/** satoshi.ota@tier4.jp @autowarefoundation/autoware-global-codeowners
common/autoware_auto_perception_rviz_plugin/** opensource@apex.ai satoshi.tanaka@tier4.jp taiki.tanaka@tier4.jp takeshi.miura@tier4.jp @autowarefoundation/autoware-global-codeowners
common/autoware_auto_tf2/** jit.ray.c@gmail.com @autowarefoundation/autoware-global-codeowners
common/autoware_point_types/** taichi.higashide@tier4.jp @autowarefoundation/autoware-global-codeowners
@@ -11,7 +11,7 @@ common/autoware_testing/** adam.dabrowski@robotec.ai @autowarefoundation/autowar
common/bag_time_manager_rviz_plugin/** taiki.tanaka@tier4.jp @autowarefoundation/autoware-global-codeowners
common/component_interface_specs/** isamu.takagi@tier4.jp kahhooi.tan@tier4.jp makoto.yabuta@tier4.jp yukihiro.saito@tier4.jp @autowarefoundation/autoware-global-codeowners
common/component_interface_tools/** isamu.takagi@tier4.jp kahhooi.tan@tier4.jp makoto.yabuta@tier4.jp @autowarefoundation/autoware-global-codeowners
-common/component_interface_utils/** isamu.takagi@tier4.jp kahhooi.tan@tier4.jp kenji.miyake@tier4.jp makoto.yabuta@tier4.jp @autowarefoundation/autoware-global-codeowners
+common/component_interface_utils/** isamu.takagi@tier4.jp kahhooi.tan@tier4.jp makoto.yabuta@tier4.jp yukihiro.saito@tier4.jp @autowarefoundation/autoware-global-codeowners
common/cuda_utils/** daisuke.nishimatsu@tier4.jp manato.hirabayashi@tier4.jp @autowarefoundation/autoware-global-codeowners
common/fake_test_node/** opensource@apex.ai @autowarefoundation/autoware-global-codeowners
common/global_parameter_loader/** kenji.miyake@tier4.jp @autowarefoundation/autoware-global-codeowners
@@ -24,9 +24,10 @@ common/osqp_interface/** fumiya.watanabe@tier4.jp maxime.clement@tier4.jp satosh
common/path_distance_calculator/** isamu.takagi@tier4.jp kahhooi.tan@tier4.jp makoto.yabuta@tier4.jp @autowarefoundation/autoware-global-codeowners
common/perception_utils/** satoshi.tanaka@tier4.jp shunsuke.miura@tier4.jp takayuki.murooka@tier4.jp yusuke.muramatsu@tier4.jp @autowarefoundation/autoware-global-codeowners
common/polar_grid/** yukihiro.saito@tier4.jp @autowarefoundation/autoware-global-codeowners
+common/qp_interface/** fumiya.watanabe@tier4.jp maxime.clement@tier4.jp satoshi.ota@tier4.jp takayuki.murooka@tier4.jp @autowarefoundation/autoware-global-codeowners
common/rtc_manager_rviz_plugin/** taiki.tanaka@tier4.jp tomoya.kimura@tier4.jp @autowarefoundation/autoware-global-codeowners
common/signal_processing/** ali.boyali@tier4.jp takayuki.murooka@tier4.jp @autowarefoundation/autoware-global-codeowners
-common/tensorrt_common/** daisuke.nishimatsu@tier4.jp manato.hirabayashi@tier4.jp @autowarefoundation/autoware-global-codeowners
+common/tensorrt_common/** daisuke.nishimatsu@tier4.jp dan.umeda@tier4.jp manato.hirabayashi@tier4.jp @autowarefoundation/autoware-global-codeowners
common/tier4_adapi_rviz_plugin/** hiroki.ota@tier4.jp isamu.takagi@tier4.jp kosuke.takeuchi@tier4.jp @autowarefoundation/autoware-global-codeowners
common/tier4_api_utils/** isamu.takagi@tier4.jp kahhooi.tan@tier4.jp kenji.miyake@tier4.jp makoto.yabuta@tier4.jp @autowarefoundation/autoware-global-codeowners
common/tier4_automatic_goal_rviz_plugin/** dawid.moszynski@robotec.ai shumpei.wakabayashi@tier4.jp @autowarefoundation/autoware-global-codeowners
@@ -65,11 +66,12 @@ evaluator/diagnostic_converter/** kyoichi.sugahara@tier4.jp maxime.clement@tier4
evaluator/kinematic_evaluator/** dominik.jargot@robotec.ai @autowarefoundation/autoware-global-codeowners
evaluator/localization_evaluator/** dominik.jargot@robotec.ai @autowarefoundation/autoware-global-codeowners
evaluator/planning_evaluator/** kyoichi.sugahara@tier4.jp maxime.clement@tier4.jp @autowarefoundation/autoware-global-codeowners
+launch/map4_localization_launch/** kento.yabuuchi.2@tier4.jp koji.minoda@tier4.jp ryohei.sasaki@map.jp ryu.yamamoto@tier4.jp yamato.ando@tier4.jp @autowarefoundation/autoware-global-codeowners
launch/tier4_autoware_api_launch/** isamu.takagi@tier4.jp kahhooi.tan@tier4.jp kenji.miyake@tier4.jp makoto.yabuta@tier4.jp ryohsuke.mitsudome@tier4.jp @autowarefoundation/autoware-global-codeowners
launch/tier4_control_launch/** takamasa.horibe@tier4.jp takayuki.murooka@tier4.jp @autowarefoundation/autoware-global-codeowners
launch/tier4_localization_launch/** kento.yabuuchi.2@tier4.jp koji.minoda@tier4.jp ryu.yamamoto@tier4.jp yamato.ando@tier4.jp @autowarefoundation/autoware-global-codeowners
launch/tier4_map_launch/** koji.minoda@tier4.jp ryohsuke.mitsudome@tier4.jp ryu.yamamoto@tier4.jp @autowarefoundation/autoware-global-codeowners
-launch/tier4_perception_launch/** shunsuke.miura@tier4.jp yukihiro.saito@tier4.jp @autowarefoundation/autoware-global-codeowners
+launch/tier4_perception_launch/** shunsuke.miura@tier4.jp yoshi.ri@tier4.jp yukihiro.saito@tier4.jp @autowarefoundation/autoware-global-codeowners
launch/tier4_planning_launch/** fumiya.watanabe@tier4.jp kosuke.takeuchi@tier4.jp kyoichi.sugahara@tier4.jp makoto.kurihara@tier4.jp mamoru.sobue@tier4.jp satoshi.ota@tier4.jp shumpei.wakabayashi@tier4.jp taiki.tanaka@tier4.jp takamasa.horibe@tier4.jp takayuki.murooka@tier4.jp tomohito.ando@tier4.jp tomoya.kimura@tier4.jp yutaka.shimizu@tier4.jp zulfaqar.azmi@tier4.jp @autowarefoundation/autoware-global-codeowners
launch/tier4_sensing_launch/** yukihiro.saito@tier4.jp @autowarefoundation/autoware-global-codeowners
launch/tier4_simulator_launch/** keisuke.shima@tier4.jp taiki.tanaka@tier4.jp takamasa.horibe@tier4.jp takayuki.murooka@tier4.jp tomoya.kimura@tier4.jp @autowarefoundation/autoware-global-codeowners
@@ -89,11 +91,11 @@ map/map_loader/** koji.minoda@tier4.jp ryohsuke.mitsudome@tier4.jp ryu.yamamoto@
map/map_tf_generator/** azumi.suzuki@tier4.jp @autowarefoundation/autoware-global-codeowners
map/util/lanelet2_map_preprocessor/** ryohsuke.mitsudome@tier4.jp @autowarefoundation/autoware-global-codeowners
perception/bytetrack/** manato.hirabayashi@tier4.jp @autowarefoundation/autoware-global-codeowners
-perception/compare_map_segmentation/** abrahammonrroy@yahoo.com yukihiro.saito@tier4.jp @autowarefoundation/autoware-global-codeowners
+perception/compare_map_segmentation/** abrahammonrroy@yahoo.com dai.nguyen@tier4.jp yukihiro.saito@tier4.jp @autowarefoundation/autoware-global-codeowners
perception/crosswalk_traffic_light_estimator/** satoshi.ota@tier4.jp @autowarefoundation/autoware-global-codeowners
perception/detected_object_feature_remover/** tomoya.kimura@tier4.jp @autowarefoundation/autoware-global-codeowners
-perception/detected_object_validation/** yukihiro.saito@tier4.jp @autowarefoundation/autoware-global-codeowners
-perception/detection_by_tracker/** yukihiro.saito@tier4.jp @autowarefoundation/autoware-global-codeowners
+perception/detected_object_validation/** shunsuke.miura@tier4.jp yukihiro.saito@tier4.jp @autowarefoundation/autoware-global-codeowners
+perception/detection_by_tracker/** yoshi.ri@tier4.jp yukihiro.saito@tier4.jp @autowarefoundation/autoware-global-codeowners
perception/elevation_map_loader/** kosuke.takeuchi@tier4.jp taichi.higashide@tier4.jp @autowarefoundation/autoware-global-codeowners
perception/euclidean_cluster/** yukihiro.saito@tier4.jp @autowarefoundation/autoware-global-codeowners
perception/front_vehicle_velocity_estimator/** satoshi.tanaka@tier4.jp shunsuke.miura@tier4.jp @autowarefoundation/autoware-global-codeowners
@@ -105,17 +107,17 @@ perception/lidar_apollo_segmentation_tvm/** ambroise.vincent@arm.com xinyu.wang@
perception/lidar_apollo_segmentation_tvm_nodes/** ambroise.vincent@arm.com xinyu.wang@tier4.jp @autowarefoundation/autoware-global-codeowners
perception/lidar_centerpoint/** kenzo.lobos@tier4.jp yusuke.muramatsu@tier4.jp @autowarefoundation/autoware-global-codeowners
perception/lidar_centerpoint_tvm/** carl.liu@autocore.ai xinyu.wang@tier4.jp @autowarefoundation/autoware-global-codeowners
-perception/map_based_prediction/** shunsuke.miura@tier4.jp tomoya.kimura@tier4.jp yutaka.shimizu@tier4.jp @autowarefoundation/autoware-global-codeowners
-perception/multi_object_tracker/** jilada.eccleston@tier4.jp yukihiro.saito@tier4.jp @autowarefoundation/autoware-global-codeowners
-perception/object_merger/** yukihiro.saito@tier4.jp @autowarefoundation/autoware-global-codeowners
+perception/map_based_prediction/** shunsuke.miura@tier4.jp tomoya.kimura@tier4.jp yoshi.ri@tier4.jp yutaka.shimizu@tier4.jp @autowarefoundation/autoware-global-codeowners
+perception/multi_object_tracker/** yoshi.ri@tier4.jp yukihiro.saito@tier4.jp @autowarefoundation/autoware-global-codeowners
+perception/object_merger/** yoshi.ri@tier4.jp yukihiro.saito@tier4.jp @autowarefoundation/autoware-global-codeowners
perception/object_range_splitter/** yukihiro.saito@tier4.jp @autowarefoundation/autoware-global-codeowners
-perception/occupancy_grid_map_outlier_filter/** abrahammonrroy@yahoo.com yukihiro.saito@tier4.jp @autowarefoundation/autoware-global-codeowners
-perception/probabilistic_occupancy_grid_map/** yukihiro.saito@tier4.jp @autowarefoundation/autoware-global-codeowners
+perception/occupancy_grid_map_outlier_filter/** abrahammonrroy@yahoo.com yoshi.ri@tier4.jp yukihiro.saito@tier4.jp @autowarefoundation/autoware-global-codeowners
+perception/probabilistic_occupancy_grid_map/** yoshi.ri@tier4.jp yukihiro.saito@tier4.jp @autowarefoundation/autoware-global-codeowners
perception/radar_fusion_to_detected_object/** satoshi.tanaka@tier4.jp shunsuke.miura@tier4.jp @autowarefoundation/autoware-global-codeowners
perception/radar_tracks_msgs_converter/** satoshi.tanaka@tier4.jp shunsuke.miura@tier4.jp @autowarefoundation/autoware-global-codeowners
-perception/shape_estimation/** yukihiro.saito@tier4.jp @autowarefoundation/autoware-global-codeowners
+perception/shape_estimation/** yoshi.ri@tier4.jp yukihiro.saito@tier4.jp @autowarefoundation/autoware-global-codeowners
perception/tensorrt_yolo/** daisuke.nishimatsu@tier4.jp @autowarefoundation/autoware-global-codeowners
-perception/tensorrt_yolox/** daisuke.nishimatsu@tier4.jp manato.hirabayashi@tier4.jp @autowarefoundation/autoware-global-codeowners
+perception/tensorrt_yolox/** daisuke.nishimatsu@tier4.jp dan.umeda@tier4.jp manato.hirabayashi@tier4.jp @autowarefoundation/autoware-global-codeowners
perception/traffic_light_classifier/** shunsuke.miura@tier4.jp yukihiro.saito@tier4.jp @autowarefoundation/autoware-global-codeowners
perception/traffic_light_map_based_detector/** yukihiro.saito@tier4.jp @autowarefoundation/autoware-global-codeowners
perception/traffic_light_selector/** isamu.takagi@tier4.jp @autowarefoundation/autoware-global-codeowners
@@ -131,7 +133,7 @@ planning/mission_planner/** isamu.takagi@tier4.jp kosuke.takeuchi@tier4.jp ryohs
planning/motion_velocity_smoother/** fumiya.watanabe@tier4.jp makoto.kurihara@tier4.jp takamasa.horibe@tier4.jp yutaka.shimizu@tier4.jp @autowarefoundation/autoware-global-codeowners
planning/obstacle_avoidance_planner/** kosuke.takeuchi@tier4.jp takamasa.horibe@tier4.jp takayuki.murooka@tier4.jp @autowarefoundation/autoware-global-codeowners
planning/obstacle_cruise_planner/** takayuki.murooka@tier4.jp yutaka.shimizu@tier4.jp @autowarefoundation/autoware-global-codeowners
-planning/obstacle_stop_planner/** satoshi.ota@tier4.jp shumpei.wakabayashi@tier4.jp taiki.tanaka@tier4.jp tomoya.kimura@tier4.jp @autowarefoundation/autoware-global-codeowners
+planning/obstacle_stop_planner/** berkay@leodrive.ai satoshi.ota@tier4.jp shumpei.wakabayashi@tier4.jp taiki.tanaka@tier4.jp tomoya.kimura@tier4.jp @autowarefoundation/autoware-global-codeowners
planning/obstacle_velocity_limiter/** maxime.clement@tier4.jp @autowarefoundation/autoware-global-codeowners
planning/planning_debug_tools/** taiki.tanaka@tier4.jp takamasa.horibe@tier4.jp @autowarefoundation/autoware-global-codeowners
planning/planning_test_utils/** kyoichi.sugahara@tier4.jp takamasa.horibe@tier4.jp @autowarefoundation/autoware-global-codeowners
@@ -140,6 +142,10 @@ planning/route_handler/** fumiya.watanabe@tier4.jp kosuke.takeuchi@tier4.jp yuta
planning/rtc_auto_mode_manager/** fumiya.watanabe@tier4.jp taiki.tanaka@tier4.jp @autowarefoundation/autoware-global-codeowners
planning/rtc_interface/** fumiya.watanabe@tier4.jp taiki.tanaka@tier4.jp @autowarefoundation/autoware-global-codeowners
planning/rtc_replayer/** fumiya.watanabe@tier4.jp taiki.tanaka@tier4.jp @autowarefoundation/autoware-global-codeowners
+planning/sampling_based_planner/bezier_sampler/** maxime.clement@tier4.jp @autowarefoundation/autoware-global-codeowners
+planning/sampling_based_planner/frenet_planner/** maxime.clement@tier4.jp @autowarefoundation/autoware-global-codeowners
+planning/sampling_based_planner/path_sampler/** maxime.clement@tier4.jp @autowarefoundation/autoware-global-codeowners
+planning/sampling_based_planner/sampler_common/** maxime.clement@tier4.jp @autowarefoundation/autoware-global-codeowners
planning/scenario_selector/** fumiya.watanabe@tier4.jp kenji.miyake@tier4.jp satoshi.ota@tier4.jp shumpei.wakabayashi@tier4.jp taiki.tanaka@tier4.jp takamasa.horibe@tier4.jp takayuki.murooka@tier4.jp tomoya.kimura@tier4.jp @autowarefoundation/autoware-global-codeowners
planning/static_centerline_optimizer/** kosuke.takeuchi@tier4.jp takayuki.murooka@tier4.jp @autowarefoundation/autoware-global-codeowners
planning/surround_obstacle_checker/** satoshi.ota@tier4.jp @autowarefoundation/autoware-global-codeowners
diff --git a/.github/sync-files.yaml b/.github/sync-files.yaml
index 656d632f00f8c..49da65cd85567 100644
--- a/.github/sync-files.yaml
+++ b/.github/sync-files.yaml
@@ -89,3 +89,11 @@
files:
- source: .github/workflows/deploy-docs.yaml
- source: .github/workflows/delete-closed-pr-docs.yaml
+ - source: mkdocs.yaml
+ pre-commands: |
+ sd "Autoware Documentation" "Autoware Universe Documentation" {source}
+ sd "autoware-documentation" "autoware.universe" {source}
+ sd "repo_url: .*" "repo_url: https://github.com/autowarefoundation/autoware.universe" {source}
+ sd "/edit/main/docs/" "/edit/main/" {source}
+ sd "docs_dir: .*" "docs_dir: ." {source}
+ sd "assets/(\w+)" "docs/assets/\$1" {source}
diff --git a/.markdown-link-check.json b/.markdown-link-check.json
index c71a3e4253687..2279120c7083b 100644
--- a/.markdown-link-check.json
+++ b/.markdown-link-check.json
@@ -9,6 +9,9 @@
},
{
"pattern": "^https://github.com/.*/discussions/new"
+ },
+ {
+ "pattern": "^https://doi.org/10.2172/7309916"
}
],
"retryOn429": true,
diff --git a/.pages b/.pages
new file mode 100644
index 0000000000000..7ee8aa0513a53
--- /dev/null
+++ b/.pages
@@ -0,0 +1,2 @@
+nav:
+ - ... | regex=^(?!.*(README.md|CONTRIBUTING.md|CODE_OF_CONDUCT.md|DISCLAIMER.md)).*$
diff --git a/common/autoware_ad_api_specs/include/autoware_ad_api_specs/routing.hpp b/common/autoware_ad_api_specs/include/autoware_ad_api_specs/routing.hpp
index 76fac74f667f9..62f99a4a8d8e9 100644
--- a/common/autoware_ad_api_specs/include/autoware_ad_api_specs/routing.hpp
+++ b/common/autoware_ad_api_specs/include/autoware_ad_api_specs/routing.hpp
@@ -38,6 +38,18 @@ struct SetRoute
static constexpr char name[] = "/api/routing/set_route";
};
+struct ChangeRoutePoints
+{
+ using Service = autoware_adapi_v1_msgs::srv::SetRoutePoints;
+ static constexpr char name[] = "/api/routing/change_route_points";
+};
+
+struct ChangeRoute
+{
+ using Service = autoware_adapi_v1_msgs::srv::SetRoute;
+ static constexpr char name[] = "/api/routing/change_route";
+};
+
struct ClearRoute
{
using Service = autoware_adapi_v1_msgs::srv::ClearRoute;
diff --git a/common/autoware_ad_api_specs/package.xml b/common/autoware_ad_api_specs/package.xml
index 0659a3c923923..d4d82faf4ee78 100644
--- a/common/autoware_ad_api_specs/package.xml
+++ b/common/autoware_ad_api_specs/package.xml
@@ -7,12 +7,11 @@
Takagi, Isamu
yabuta
Kah Hooi Tan
- Kenji Miyake
+ Ryohsuke Mitsudome
Apache License 2.0
ament_cmake_auto
-
- autoware_cmake
+ autoware_cmake
ament_lint_auto
autoware_lint_common
diff --git a/common/autoware_auto_common/package.xml b/common/autoware_auto_common/package.xml
index 17d666e2273e6..59e2907e91501 100644
--- a/common/autoware_auto_common/package.xml
+++ b/common/autoware_auto_common/package.xml
@@ -8,8 +8,7 @@
Apache License 2.0
ament_cmake_auto
-
- autoware_cmake
+ autoware_cmake
builtin_interfaces
eigen
diff --git a/common/autoware_auto_geometry/design/polygon_intersection_2d-design.md b/common/autoware_auto_geometry/design/polygon_intersection_2d-design.md
index dc4b33b56b4bc..f651c218bc80d 100644
--- a/common/autoware_auto_geometry/design/polygon_intersection_2d-design.md
+++ b/common/autoware_auto_geometry/design/polygon_intersection_2d-design.md
@@ -12,7 +12,7 @@ association and in any application that deals with the objects around the percei
## Design
-[\(Livermore, Calif, 1977\)](https://www.osti.gov/biblio/7309916/) mention the following
+[\(Livermore, Calif, 1977\)](https://doi.org/10.2172/7309916) mention the following
observations about convex polygon intersection:
- Intersection of two convex polygons is a convex polygon
diff --git a/common/autoware_auto_geometry/package.xml b/common/autoware_auto_geometry/package.xml
index e19ac4897aab0..f53412298a485 100644
--- a/common/autoware_auto_geometry/package.xml
+++ b/common/autoware_auto_geometry/package.xml
@@ -4,12 +4,13 @@
autoware_auto_geometry
1.0.0
Geometry related algorithms
- Apex.AI, Inc.
+ Satoshi Ota
Apache License 2.0
- ament_cmake_auto
+ Apex.AI, Inc.
- autoware_cmake
+ ament_cmake_auto
+ autoware_cmake
autoware_auto_common
autoware_auto_geometry_msgs
diff --git a/common/autoware_auto_perception_rviz_plugin/include/object_detection/object_polygon_display_base.hpp b/common/autoware_auto_perception_rviz_plugin/include/object_detection/object_polygon_display_base.hpp
index acf4a389ec6e3..a37aa79288177 100644
--- a/common/autoware_auto_perception_rviz_plugin/include/object_detection/object_polygon_display_base.hpp
+++ b/common/autoware_auto_perception_rviz_plugin/include/object_detection/object_polygon_display_base.hpp
@@ -81,15 +81,14 @@ class AUTOWARE_AUTO_PERCEPTION_RVIZ_PLUGIN_PUBLIC ObjectPolygonDisplayBase
m_default_topic{default_topic}
{
m_display_type_property = new rviz_common::properties::EnumProperty(
- "Polygon Type", "3d", "Type of the polygon to display object.", this, SLOT(updatePalette()));
+ "Polygon Type", "3d", "Type of the polygon to display object.");
// Option values here must correspond to indices in palette_textures_ array in onInitialize()
// below.
m_display_type_property->addOption("3d", 0);
m_display_type_property->addOption("2d", 1);
m_display_type_property->addOption("Disable", 2);
m_simple_visualize_mode_property = new rviz_common::properties::EnumProperty(
- "Visualization Type", "Normal", "Simplicity of the polygon to display object.", this,
- SLOT(updatePalette()));
+ "Visualization Type", "Normal", "Simplicity of the polygon to display object.");
m_simple_visualize_mode_property->addOption("Normal", 0);
m_simple_visualize_mode_property->addOption("Simple", 1);
// iterate over default values to create and initialize the properties.
diff --git a/common/autoware_auto_perception_rviz_plugin/package.xml b/common/autoware_auto_perception_rviz_plugin/package.xml
index 4771589dc9038..c1ad3e3df140e 100644
--- a/common/autoware_auto_perception_rviz_plugin/package.xml
+++ b/common/autoware_auto_perception_rviz_plugin/package.xml
@@ -12,8 +12,8 @@
Apache 2.0
ament_cmake
+ autoware_cmake
- autoware_cmake
libboost-dev
qtbase5-dev
diff --git a/common/autoware_auto_tf2/design/autoware-auto-tf2-design.md b/common/autoware_auto_tf2/design/autoware-auto-tf2-design.md
index 3befe575e3e7f..aaa719d617373 100644
--- a/common/autoware_auto_tf2/design/autoware-auto-tf2-design.md
+++ b/common/autoware_auto_tf2/design/autoware-auto-tf2-design.md
@@ -8,7 +8,7 @@ In general, users of ROS rely on tf (and its successor, tf2) for publishing and
frame transforms. This is true even to the extent that the tf2 contains the packages
`tf2_geometry_msgs` and `tf2_sensor_msgs` which allow for easy conversion to and from the message
types defined in `geometry_msgs` and `sensor_msgs`, respectively. However, AutowareAuto contains
-some specialized message types which are not transformable between frames using the ROS2 library.
+some specialized message types which are not transformable between frames using the ROS 2 library.
The `autoware_auto_tf2` package aims to provide developers with tools to transform applicable
`autoware_auto_msgs` types. In addition to this, this package also provides transform tools for
messages types in `geometry_msgs` missing in `tf2_geometry_msgs`.
@@ -49,7 +49,7 @@ const ros::Time& tf2::getTimestamp(const T& t);
## Current Implementation of tf2_geometry_msgs
-In both ROS1 and ROS2 stamped msgs like `Vector3Stamped`, `QuaternionStamped` have associated
+In both ROS 1 and ROS 2 stamped msgs like `Vector3Stamped`, `QuaternionStamped` have associated
functions like:
- `getTimestamp`
@@ -58,13 +58,13 @@ functions like:
- `toMsg`
- `fromMsg`
-In ROS1, to support `tf2::convert` and need in `doTransform` of the stamped data, non-stamped
+In ROS 1, to support `tf2::convert` and need in `doTransform` of the stamped data, non-stamped
underlying data like `Vector3`, `Point`, have implementations of the following functions:
- `toMsg`
- `fromMsg`
-In ROS2, much of the `doTransform` method is not using `toMsg` and `fromMsg` as data types from tf2
+In ROS 2, much of the `doTransform` method is not using `toMsg` and `fromMsg` as data types from tf2
are not used. Instead `doTransform` is done using `KDL`, thus functions relating to underlying data
were not added; such as `Vector3`, `Point`, or ported in this commit ros/geometry2/commit/6f2a82.
The non-stamped data with `toMsg` and `fromMsg` are `Quaternion`, `Transform`. `Pose` has the
diff --git a/common/autoware_auto_tf2/package.xml b/common/autoware_auto_tf2/package.xml
index c80ce45a217ac..c7b620a9a737e 100644
--- a/common/autoware_auto_tf2/package.xml
+++ b/common/autoware_auto_tf2/package.xml
@@ -8,8 +8,7 @@
Apache License 2.0
ament_cmake
-
- autoware_cmake
+ autoware_cmake
autoware_auto_common
autoware_auto_geometry_msgs
diff --git a/common/autoware_point_types/package.xml b/common/autoware_point_types/package.xml
index 8829bd7538d9b..e05b604e90d13 100644
--- a/common/autoware_point_types/package.xml
+++ b/common/autoware_point_types/package.xml
@@ -10,12 +10,11 @@
ament_cmake_core
ament_cmake_export_dependencies
ament_cmake_test
+ autoware_cmake
ament_cmake_core
ament_cmake_test
- autoware_cmake
-
ament_cmake_copyright
ament_cmake_cppcheck
ament_cmake_lint_cmake
diff --git a/common/autoware_testing/package.xml b/common/autoware_testing/package.xml
index 30a27bb9435b1..769942b437884 100644
--- a/common/autoware_testing/package.xml
+++ b/common/autoware_testing/package.xml
@@ -9,8 +9,7 @@
ament_cmake_auto
ament_cmake_lint_cmake
-
- autoware_cmake
+ autoware_cmake
ros_testing
diff --git a/common/bag_time_manager_rviz_plugin/package.xml b/common/bag_time_manager_rviz_plugin/package.xml
index b12c24b728cde..f82d75b46e06f 100644
--- a/common/bag_time_manager_rviz_plugin/package.xml
+++ b/common/bag_time_manager_rviz_plugin/package.xml
@@ -8,8 +8,8 @@
Apache License 2.0
ament_cmake_auto
+ autoware_cmake
- autoware_cmake
libqt5-core
libqt5-gui
libqt5-widgets
diff --git a/common/component_interface_specs/package.xml b/common/component_interface_specs/package.xml
index 54a0f1a66d5d2..d4fe460a6daea 100644
--- a/common/component_interface_specs/package.xml
+++ b/common/component_interface_specs/package.xml
@@ -11,8 +11,7 @@
Apache License 2.0
ament_cmake_auto
-
- autoware_cmake
+ autoware_cmake
autoware_adapi_v1_msgs
diff --git a/common/component_interface_tools/package.xml b/common/component_interface_tools/package.xml
index a1eba3cb41e09..ebf0684d0066c 100644
--- a/common/component_interface_tools/package.xml
+++ b/common/component_interface_tools/package.xml
@@ -10,8 +10,7 @@
Apache License 2.0
ament_cmake_auto
-
- autoware_cmake
+ autoware_cmake
diagnostic_updater
fmt
diff --git a/common/component_interface_utils/package.xml b/common/component_interface_utils/package.xml
index 90602a65bd1b0..a1803a35cc1c9 100644
--- a/common/component_interface_utils/package.xml
+++ b/common/component_interface_utils/package.xml
@@ -7,12 +7,12 @@
Takagi, Isamu
yabuta
Kah Hooi Tan
- Kenji Miyake
+ Yukihiro Saito
Apache License 2.0
ament_cmake_auto
+ autoware_cmake
- autoware_cmake
tier4_system_msgs
autoware_adapi_v1_msgs
diff --git a/common/cuda_utils/package.xml b/common/cuda_utils/package.xml
index 53127da0c1ff6..4ae44469f1efa 100644
--- a/common/cuda_utils/package.xml
+++ b/common/cuda_utils/package.xml
@@ -11,8 +11,7 @@
Apache License 2.0
ament_cmake_auto
-
- autoware_cmake
+ autoware_cmake
ament_lint_auto
autoware_lint_common
diff --git a/common/fake_test_node/package.xml b/common/fake_test_node/package.xml
index 8e919d719fc6c..78d53831670d8 100644
--- a/common/fake_test_node/package.xml
+++ b/common/fake_test_node/package.xml
@@ -8,8 +8,7 @@
Apache 2.0
ament_cmake_auto
-
- autoware_cmake
+ autoware_cmake
ament_cmake_ros
autoware_auto_common
diff --git a/common/global_parameter_loader/package.xml b/common/global_parameter_loader/package.xml
index 97e679334e6c2..5fa46351930cf 100644
--- a/common/global_parameter_loader/package.xml
+++ b/common/global_parameter_loader/package.xml
@@ -8,8 +8,7 @@
Apache License 2.0
ament_cmake_auto
-
- autoware_cmake
+ autoware_cmake
vehicle_info_util
diff --git a/common/goal_distance_calculator/package.xml b/common/goal_distance_calculator/package.xml
index 941186daa063b..49cb674f0a256 100644
--- a/common/goal_distance_calculator/package.xml
+++ b/common/goal_distance_calculator/package.xml
@@ -8,8 +8,7 @@
Apache License 2.0
ament_cmake
-
- autoware_cmake
+ autoware_cmake
autoware_auto_planning_msgs
geometry_msgs
diff --git a/common/interpolation/package.xml b/common/interpolation/package.xml
index 5a39d818a3238..e5d2c7af8d06e 100644
--- a/common/interpolation/package.xml
+++ b/common/interpolation/package.xml
@@ -10,8 +10,7 @@
Apache License 2.0
ament_cmake_auto
-
- autoware_cmake
+ autoware_cmake
tier4_autoware_utils
diff --git a/common/kalman_filter/include/kalman_filter/kalman_filter.hpp b/common/kalman_filter/include/kalman_filter/kalman_filter.hpp
index 2ae8877aeea60..79a47bde3a1b2 100644
--- a/common/kalman_filter/include/kalman_filter/kalman_filter.hpp
+++ b/common/kalman_filter/include/kalman_filter/kalman_filter.hpp
@@ -15,8 +15,8 @@
#ifndef KALMAN_FILTER__KALMAN_FILTER_HPP_
#define KALMAN_FILTER__KALMAN_FILTER_HPP_
-#include
-#include
+#include
+#include
/**
* @file kalman_filter.h
diff --git a/common/kalman_filter/include/kalman_filter/time_delay_kalman_filter.hpp b/common/kalman_filter/include/kalman_filter/time_delay_kalman_filter.hpp
index 1a072bb43d4ac..cdc03f3558854 100644
--- a/common/kalman_filter/include/kalman_filter/time_delay_kalman_filter.hpp
+++ b/common/kalman_filter/include/kalman_filter/time_delay_kalman_filter.hpp
@@ -17,8 +17,8 @@
#include "kalman_filter/kalman_filter.hpp"
-#include
-#include
+#include
+#include
#include
diff --git a/common/kalman_filter/package.xml b/common/kalman_filter/package.xml
index f75755c172605..ea061f3f23bb8 100644
--- a/common/kalman_filter/package.xml
+++ b/common/kalman_filter/package.xml
@@ -12,8 +12,8 @@
Takamasa Horibe
ament_cmake_auto
+ autoware_cmake
- autoware_cmake
eigen
eigen3_cmake_module
diff --git a/common/motion_utils/include/motion_utils/marker/marker_helper.hpp b/common/motion_utils/include/motion_utils/marker/marker_helper.hpp
index 166d3a6661689..1328f1fada9a7 100644
--- a/common/motion_utils/include/motion_utils/marker/marker_helper.hpp
+++ b/common/motion_utils/include/motion_utils/marker/marker_helper.hpp
@@ -28,15 +28,15 @@ using geometry_msgs::msg::Pose;
visualization_msgs::msg::MarkerArray createStopVirtualWallMarker(
const Pose & pose, const std::string & module_name, const rclcpp::Time & now, const int32_t id,
- const double longitudinal_offset = 0.0);
+ const double longitudinal_offset = 0.0, const std::string & ns_prefix = "");
visualization_msgs::msg::MarkerArray createSlowDownVirtualWallMarker(
const Pose & pose, const std::string & module_name, const rclcpp::Time & now, const int32_t id,
- const double longitudinal_offset = 0.0);
+ const double longitudinal_offset = 0.0, const std::string & ns_prefix = "");
visualization_msgs::msg::MarkerArray createDeadLineVirtualWallMarker(
const Pose & pose, const std::string & module_name, const rclcpp::Time & now, const int32_t id,
- const double longitudinal_offset = 0.0);
+ const double longitudinal_offset = 0.0, const std::string & ns_prefix = "");
visualization_msgs::msg::MarkerArray createDeletedStopVirtualWallMarker(
const rclcpp::Time & now, const int32_t id);
@@ -58,33 +58,36 @@ class VirtualWallMarkerCreator
using create_wall_function = std::function;
+ const rclcpp::Time & now, const int32_t id, const double longitudinal_offset,
+ const std::string & ns_prefix)>;
using delete_wall_function =
std::function;
visualization_msgs::msg::MarkerArray createStopVirtualWallMarker(
const std::vector & stop_poses, const std::string & module_name, const rclcpp::Time & now,
- int32_t id, const double longitudinal_offset = 0.0);
+ const double longitudinal_offset = 0.0, const std::string & ns_prefix = "");
visualization_msgs::msg::MarkerArray createSlowDownVirtualWallMarker(
const std::vector & slow_down_poses, const std::string & module_name,
- const rclcpp::Time & now, int32_t id, const double longitudinal_offset = 0.0);
+ const rclcpp::Time & now, const double longitudinal_offset = 0.0,
+ const std::string & ns_prefix = "");
visualization_msgs::msg::MarkerArray createDeadLineVirtualWallMarker(
const std::vector & dead_line_poses, const std::string & module_name,
- const rclcpp::Time & now, int32_t id, const double longitudinal_offset = 0.0);
+ const rclcpp::Time & now, const double longitudinal_offset = 0.0,
+ const std::string & ns_prefix = "");
private:
visualization_msgs::msg::MarkerArray handleVirtualWallMarker(
const std::vector & poses, const std::string & module_name, const rclcpp::Time & now,
- int32_t id, create_wall_function function_create_wall_marker,
- delete_wall_function function_delete_wall_marker,
- std::vector & previous_poses, const double longitudinal_offset = 0.0);
+ create_wall_function function_create_wall_marker,
+ delete_wall_function function_delete_wall_marker, size_t & previous_virtual_walls_nb,
+ const double longitudinal_offset = 0.0, const std::string & ns_prefix = "");
- std::vector previous_stop_poses_;
- std::vector previous_slow_down_poses_;
- std::vector previous_dead_line_poses_;
+ size_t previous_stop_poses_nb_ = 0UL;
+ size_t previous_slow_down_poses_nb_ = 0UL;
+ size_t previous_dead_line_poses_nb_ = 0UL;
};
} // namespace motion_utils
diff --git a/common/motion_utils/include/motion_utils/trajectory/trajectory.hpp b/common/motion_utils/include/motion_utils/trajectory/trajectory.hpp
index 9a2527d1be4a5..c65a7eae189e3 100644
--- a/common/motion_utils/include/motion_utils/trajectory/trajectory.hpp
+++ b/common/motion_utils/include/motion_utils/trajectory/trajectory.hpp
@@ -1107,17 +1107,27 @@ inline boost::optional insertTargetPoint(
{
validateNonEmpty(points);
- if (insert_point_length < 0.0 || src_segment_idx >= points.size() - 1) {
+ if (src_segment_idx >= points.size() - 1) {
return boost::none;
}
// Get Nearest segment index
boost::optional segment_idx = boost::none;
- for (size_t i = src_segment_idx + 1; i < points.size(); ++i) {
- const double length = calcSignedArcLength(points, src_segment_idx, i);
- if (insert_point_length <= length) {
- segment_idx = i - 1;
- break;
+ if (0.0 <= insert_point_length) {
+ for (size_t i = src_segment_idx + 1; i < points.size(); ++i) {
+ const double length = calcSignedArcLength(points, src_segment_idx, i);
+ if (insert_point_length <= length) {
+ segment_idx = i - 1;
+ break;
+ }
+ }
+ } else {
+ for (int i = src_segment_idx - 1; 0 <= i; --i) {
+ const double length = calcSignedArcLength(points, src_segment_idx, i);
+ if (length <= insert_point_length) {
+ segment_idx = i;
+ break;
+ }
}
}
@@ -1128,7 +1138,7 @@ inline boost::optional insertTargetPoint(
// Get Target Point
const double segment_length = calcSignedArcLength(points, *segment_idx, *segment_idx + 1);
const double target_length =
- std::max(0.0, insert_point_length - calcSignedArcLength(points, src_segment_idx, *segment_idx));
+ insert_point_length - calcSignedArcLength(points, src_segment_idx, *segment_idx);
const double ratio = std::clamp(target_length / segment_length, 0.0, 1.0);
const auto p_target = tier4_autoware_utils::calcInterpolatedPoint(
tier4_autoware_utils::getPoint(points.at(*segment_idx)),
@@ -1728,6 +1738,76 @@ T cropPoints(
return cropped_points;
}
+
+/**
+ * @brief Calculate the angle of the input pose with respect to the nearest trajectory segment.
+ * The function gets the nearest segment index between the points of the trajectory and the given
+ * pose's position, then calculates the azimuth angle of that segment and compares it to the yaw of
+ * the input pose. The segment is a straight path between two continuous points of the trajectory.
+ * @param points Points of the trajectory, path, ...
+ * @param pose Input pose with position and orientation (yaw)
+ * @param throw_exception Flag to enable/disable exception throwing
+ * @return Angle with respect to the trajectory segment (signed) in radians
+ */
+template
+double calcYawDeviation(
+ const T & points, const geometry_msgs::msg::Pose & pose, const bool throw_exception = false)
+{
+ const auto overlap_removed_points = removeOverlapPoints(points, 0);
+
+ if (throw_exception) {
+ validateNonEmpty(overlap_removed_points);
+ } else {
+ try {
+ validateNonEmpty(overlap_removed_points);
+ } catch (const std::exception & e) {
+ std::cerr << e.what() << std::endl;
+ return 0.0;
+ }
+ }
+
+ if (overlap_removed_points.size() <= 1) {
+ const std::runtime_error e("points size is less than 2");
+ if (throw_exception) {
+ throw e;
+ }
+ std::cerr << e.what() << std::endl;
+ return 0.0;
+ }
+
+ const size_t seg_idx = findNearestSegmentIndex(overlap_removed_points, pose.position);
+
+ const double path_yaw = tier4_autoware_utils::calcAzimuthAngle(
+ tier4_autoware_utils::getPoint(overlap_removed_points.at(seg_idx)),
+ tier4_autoware_utils::getPoint(overlap_removed_points.at(seg_idx + 1)));
+ const double pose_yaw = tf2::getYaw(pose.orientation);
+
+ return tier4_autoware_utils::normalizeRadian(pose_yaw - path_yaw);
+}
+
+/**
+ * @brief Check if the given target point is in front of the based pose from the trajectory.
+ * if the points is empty, the function returns false
+ * @param points Points of the trajectory, path, ...
+ * @param base_point Base point
+ * @param target_point Target point
+ * @param threshold threshold for judging front point
+ * @return true if the target pose is in front of the base pose
+ */
+template
+bool isTargetPointFront(
+ const T & points, const geometry_msgs::msg::Point & base_point,
+ const geometry_msgs::msg::Point & target_point, const double threshold = 0.0)
+{
+ if (points.empty()) {
+ return false;
+ }
+
+ const double s_base = calcSignedArcLength(points, 0, base_point);
+ const double s_target = calcSignedArcLength(points, 0, target_point);
+
+ return s_target - s_base > threshold;
+}
} // namespace motion_utils
#endif // MOTION_UTILS__TRAJECTORY__TRAJECTORY_HPP_
diff --git a/common/motion_utils/package.xml b/common/motion_utils/package.xml
index ee6975e0caa83..834342624bfcd 100644
--- a/common/motion_utils/package.xml
+++ b/common/motion_utils/package.xml
@@ -20,8 +20,7 @@
Satoshi Ota
ament_cmake_auto
-
- autoware_cmake
+ autoware_cmake
autoware_auto_planning_msgs
autoware_auto_vehicle_msgs
diff --git a/common/motion_utils/src/distance/distance.cpp b/common/motion_utils/src/distance/distance.cpp
index 6349d724c635c..14ba02ab38703 100644
--- a/common/motion_utils/src/distance/distance.cpp
+++ b/common/motion_utils/src/distance/distance.cpp
@@ -88,12 +88,12 @@ std::tuple update(
* @param (am) minimum deceleration [m/ss]
* @param (ja) maximum jerk [m/sss]
* @param (jd) minimum jerk [m/sss]
- * @param (t_min) duration of constant deceleration [s]
+ * @param (t_during_min_acc) duration of constant deceleration [s]
* @return moving distance until velocity is reached vt [m]
*/
boost::optional calcDecelDistPlanType1(
const double v0, const double vt, const double a0, const double am, const double ja,
- const double jd, const double t_min)
+ const double jd, const double t_during_min_acc)
{
constexpr double epsilon = 1e-3;
@@ -103,7 +103,7 @@ boost::optional calcDecelDistPlanType1(
const auto [x1, v1, a1] = update(0.0, v0, a0, j1, t1);
// zero jerk time
- const double t2 = epsilon < t_min ? t_min : 0.0;
+ const double t2 = epsilon < t_during_min_acc ? t_during_min_acc : 0.0;
const auto [x2, v2, a2] = update(x1, v1, a1, 0.0, t2);
// positive jerk time
@@ -238,22 +238,30 @@ boost::optional calcDecelDistWithJerkAndAccConstraints(
const double current_vel, const double target_vel, const double current_acc, const double acc_min,
const double jerk_acc, const double jerk_dec)
{
+ if (current_vel < target_vel) {
+ return {};
+ }
+
constexpr double epsilon = 1e-3;
- const double t_dec =
- acc_min < current_acc ? (acc_min - current_acc) / jerk_dec : (acc_min - current_acc) / jerk_acc;
- const double t_acc = (0.0 - acc_min) / jerk_acc;
- const double t_min = (target_vel - current_vel - current_acc * t_dec -
- 0.5 * jerk_dec * t_dec * t_dec - 0.5 * acc_min * t_acc) /
- acc_min;
+ const double jerk_before_min_acc = acc_min < current_acc ? jerk_dec : jerk_acc;
+ const double t_before_min_acc = (acc_min - current_acc) / jerk_before_min_acc;
+ const double jerk_after_min_acc = jerk_acc;
+ const double t_after_min_acc = (0.0 - acc_min) / jerk_after_min_acc;
+
+ const double t_during_min_acc =
+ (target_vel - current_vel - current_acc * t_before_min_acc -
+ 0.5 * jerk_before_min_acc * std::pow(t_before_min_acc, 2) - acc_min * t_after_min_acc -
+ 0.5 * jerk_after_min_acc * std::pow(t_after_min_acc, 2)) /
+ acc_min;
// check if it is possible to decelerate to the target velocity
// by simply bringing the current acceleration to zero.
const auto is_decel_needed =
0.5 * (0.0 - current_acc) / jerk_acc * current_acc > target_vel - current_vel;
- if (t_min > epsilon) {
+ if (t_during_min_acc > epsilon) {
return calcDecelDistPlanType1(
- current_vel, target_vel, current_acc, acc_min, jerk_acc, jerk_dec, t_min);
+ current_vel, target_vel, current_acc, acc_min, jerk_acc, jerk_dec, t_during_min_acc);
} else if (is_decel_needed || current_acc > epsilon) {
return calcDecelDistPlanType2(current_vel, target_vel, current_acc, jerk_acc, jerk_dec);
}
diff --git a/common/motion_utils/src/marker/marker_helper.cpp b/common/motion_utils/src/marker/marker_helper.cpp
index ab4dc623c3125..bc6a938400b4b 100644
--- a/common/motion_utils/src/marker/marker_helper.cpp
+++ b/common/motion_utils/src/marker/marker_helper.cpp
@@ -86,32 +86,35 @@ namespace motion_utils
{
visualization_msgs::msg::MarkerArray createStopVirtualWallMarker(
const geometry_msgs::msg::Pose & pose, const std::string & module_name, const rclcpp::Time & now,
- const int32_t id, const double longitudinal_offset)
+ const int32_t id, const double longitudinal_offset, const std::string & ns_prefix)
{
const auto pose_with_offset =
tier4_autoware_utils::calcOffsetPose(pose, longitudinal_offset, 0.0, 0.0);
return createVirtualWallMarkerArray(
- pose_with_offset, module_name, "stop_", now, id, createMarkerColor(1.0, 0.0, 0.0, 0.5));
+ pose_with_offset, module_name, ns_prefix + "stop_", now, id,
+ createMarkerColor(1.0, 0.0, 0.0, 0.5));
}
visualization_msgs::msg::MarkerArray createSlowDownVirtualWallMarker(
const geometry_msgs::msg::Pose & pose, const std::string & module_name, const rclcpp::Time & now,
- const int32_t id, const double longitudinal_offset)
+ const int32_t id, const double longitudinal_offset, const std::string & ns_prefix)
{
const auto pose_with_offset =
tier4_autoware_utils::calcOffsetPose(pose, longitudinal_offset, 0.0, 0.0);
return createVirtualWallMarkerArray(
- pose_with_offset, module_name, "slow_down_", now, id, createMarkerColor(1.0, 1.0, 0.0, 0.5));
+ pose_with_offset, module_name, ns_prefix + "slow_down_", now, id,
+ createMarkerColor(1.0, 1.0, 0.0, 0.5));
}
visualization_msgs::msg::MarkerArray createDeadLineVirtualWallMarker(
const geometry_msgs::msg::Pose & pose, const std::string & module_name, const rclcpp::Time & now,
- const int32_t id, const double longitudinal_offset)
+ const int32_t id, const double longitudinal_offset, const std::string & ns_prefix)
{
const auto pose_with_offset =
tier4_autoware_utils::calcOffsetPose(pose, longitudinal_offset, 0.0, 0.0);
return createVirtualWallMarkerArray(
- pose_with_offset, module_name, "dead_line_", now, id, createMarkerColor(0.0, 1.0, 0.0, 0.5));
+ pose_with_offset, module_name, ns_prefix + "dead_line_", now, id,
+ createMarkerColor(0.0, 1.0, 0.0, 0.5));
}
visualization_msgs::msg::MarkerArray createDeletedStopVirtualWallMarker(
@@ -134,76 +137,63 @@ visualization_msgs::msg::MarkerArray createDeletedDeadLineVirtualWallMarker(
visualization_msgs::msg::MarkerArray VirtualWallMarkerCreator::handleVirtualWallMarker(
const std::vector & poses, const std::string & module_name, const rclcpp::Time & now,
- int32_t id, create_wall_function function_create_wall_marker,
- delete_wall_function function_delete_wall_marker,
- std::vector & previous_virtual_wall_poses,
- const double longitudinal_offset)
+ create_wall_function function_create_wall_marker,
+ delete_wall_function function_delete_wall_marker, size_t & previous_virtual_walls_nb,
+ const double longitudinal_offset, const std::string & ns_prefix)
{
- size_t id_to_create = id;
- size_t id_to_delete = id;
visualization_msgs::msg::MarkerArray wall_marker;
- if (poses.size() == 0) {
- return wall_marker;
- }
-
- for (const auto & p : previous_virtual_wall_poses) {
- const bool previous_stop_pose_is_in_stop_pose =
- std::any_of(poses.begin(), poses.end(), [&](const geometry_msgs::msg::Pose & elem) {
- std::vector poses;
- poses.push_back(p);
- poses.push_back(elem);
- return resample_utils::validate_points_duplication(poses);
- });
-
- if (!previous_stop_pose_is_in_stop_pose) {
- appendMarkerArray(function_delete_wall_marker(now, id_to_delete), &wall_marker, now);
- }
- id_to_delete++;
- }
+ int32_t id = 0;
+ const auto max_id = static_cast(previous_virtual_walls_nb);
for (const auto & p : poses) {
appendMarkerArray(
- function_create_wall_marker(p, module_name, now, id_to_create++, longitudinal_offset),
+ function_create_wall_marker(p, module_name, now, id++, longitudinal_offset, ns_prefix),
&wall_marker);
}
- previous_virtual_wall_poses = poses;
+
+ while (id < max_id) {
+ appendMarkerArray(function_delete_wall_marker(now, id++), &wall_marker, now);
+ }
+
+ previous_virtual_walls_nb = poses.size();
return wall_marker;
}
visualization_msgs::msg::MarkerArray VirtualWallMarkerCreator::createStopVirtualWallMarker(
const std::vector & stop_poses, const std::string & module_name, const rclcpp::Time & now,
- int32_t id, const double longitudinal_offset)
+ const double longitudinal_offset, const std::string & ns_prefix)
{
create_wall_function creator = motion_utils::createStopVirtualWallMarker;
delete_wall_function deleter = motion_utils::createDeletedStopVirtualWallMarker;
return handleVirtualWallMarker(
- stop_poses, module_name, now, id, creator, deleter, previous_stop_poses_, longitudinal_offset);
+ stop_poses, module_name, now, creator, deleter, previous_stop_poses_nb_, longitudinal_offset,
+ ns_prefix);
}
visualization_msgs::msg::MarkerArray VirtualWallMarkerCreator::createSlowDownVirtualWallMarker(
const std::vector & slow_down_poses, const std::string & module_name,
- const rclcpp::Time & now, int32_t id, const double longitudinal_offset)
+ const rclcpp::Time & now, const double longitudinal_offset, const std::string & ns_prefix)
{
create_wall_function creator = motion_utils::createSlowDownVirtualWallMarker;
delete_wall_function deleter = motion_utils::createDeletedSlowDownVirtualWallMarker;
return handleVirtualWallMarker(
- slow_down_poses, module_name, now, id, creator, deleter, previous_slow_down_poses_,
- longitudinal_offset);
+ slow_down_poses, module_name, now, creator, deleter, previous_slow_down_poses_nb_,
+ longitudinal_offset, ns_prefix);
}
visualization_msgs::msg::MarkerArray VirtualWallMarkerCreator::createDeadLineVirtualWallMarker(
const std::vector & dead_line_poses, const std::string & module_name,
- const rclcpp::Time & now, int32_t id, const double longitudinal_offset)
+ const rclcpp::Time & now, const double longitudinal_offset, const std::string & ns_prefix)
{
create_wall_function creator = motion_utils::createDeadLineVirtualWallMarker;
delete_wall_function deleter = motion_utils::createDeletedDeadLineVirtualWallMarker;
return handleVirtualWallMarker(
- dead_line_poses, module_name, now, id, creator, deleter, previous_dead_line_poses_,
- longitudinal_offset);
+ dead_line_poses, module_name, now, creator, deleter, previous_dead_line_poses_nb_,
+ longitudinal_offset, ns_prefix);
}
} // namespace motion_utils
diff --git a/common/motion_utils/src/resample/resample.cpp b/common/motion_utils/src/resample/resample.cpp
index 107a77393d5a2..091f3405e2815 100644
--- a/common/motion_utils/src/resample/resample.cpp
+++ b/common/motion_utils/src/resample/resample.cpp
@@ -188,21 +188,21 @@ autoware_auto_planning_msgs::msg::PathWithLaneId resamplePath(
}
const double distance_to_resampling_point = calcSignedArcLength(input_path.points, 0, i);
- for (size_t i = 1; i < resampling_arclength.size(); ++i) {
+ for (size_t j = 1; j < resampling_arclength.size(); ++j) {
if (
- resampling_arclength.at(i - 1) <= distance_to_resampling_point &&
- distance_to_resampling_point < resampling_arclength.at(i)) {
+ resampling_arclength.at(j - 1) <= distance_to_resampling_point &&
+ distance_to_resampling_point < resampling_arclength.at(j)) {
const double dist_to_prev_point =
- std::fabs(distance_to_resampling_point - resampling_arclength.at(i - 1));
+ std::fabs(distance_to_resampling_point - resampling_arclength.at(j - 1));
const double dist_to_following_point =
- std::fabs(resampling_arclength.at(i) - distance_to_resampling_point);
+ std::fabs(resampling_arclength.at(j) - distance_to_resampling_point);
if (dist_to_prev_point < motion_utils::overlap_threshold) {
- resampling_arclength.at(i - 1) = distance_to_resampling_point;
+ resampling_arclength.at(j - 1) = distance_to_resampling_point;
} else if (dist_to_following_point < motion_utils::overlap_threshold) {
- resampling_arclength.at(i) = distance_to_resampling_point;
+ resampling_arclength.at(j) = distance_to_resampling_point;
} else {
resampling_arclength.insert(
- resampling_arclength.begin() + i, distance_to_resampling_point);
+ resampling_arclength.begin() + j, distance_to_resampling_point);
}
break;
}
diff --git a/common/motion_utils/test/src/distance/test_distance.cpp b/common/motion_utils/test/src/distance/test_distance.cpp
index b5b9c5cfdc95f..5bcb2c26fe1bd 100644
--- a/common/motion_utils/test/src/distance/test_distance.cpp
+++ b/common/motion_utils/test/src/distance/test_distance.cpp
@@ -37,21 +37,6 @@ TEST(distance, calcDecelDistWithJerkAndAccConstraints)
EXPECT_FALSE(dist);
}
- // invalid deceleration
- {
- constexpr double current_vel = 16.7;
- constexpr double target_vel = 0.0;
- constexpr double current_acc = -2.5;
- constexpr double acc_min = -0.5;
- constexpr double jerk_acc = 1.0;
- constexpr double jerk_dec = -0.5;
-
- const auto dist = calcDecelDistWithJerkAndAccConstraints(
- current_vel, target_vel, current_acc, acc_min, jerk_acc, jerk_dec);
-
- EXPECT_FALSE(dist);
- }
-
// normal stop
{
constexpr double current_vel = 16.7;
@@ -111,6 +96,21 @@ TEST(distance, calcDecelDistWithJerkAndAccConstraints)
current_vel, target_vel, current_acc, acc_min, jerk_acc, jerk_dec);
EXPECT_NEAR(expected_dist, *dist, epsilon);
}
+
+ // current_acc is lower than acc_min
+ {
+ constexpr double current_vel = 16.7;
+ constexpr double target_vel = 0.0;
+ constexpr double current_acc = -2.5;
+ constexpr double acc_min = -0.5;
+ constexpr double jerk_acc = 1.0;
+ constexpr double jerk_dec = -0.5;
+
+ constexpr double expected_dist = 217.429;
+ const auto dist = calcDecelDistWithJerkAndAccConstraints(
+ current_vel, target_vel, current_acc, acc_min, jerk_acc, jerk_dec);
+ EXPECT_NEAR(expected_dist, *dist, epsilon);
+ }
}
} // namespace
diff --git a/common/motion_utils/test/src/trajectory/test_trajectory.cpp b/common/motion_utils/test/src/trajectory/test_trajectory.cpp
index ccbe0f75ee267..6237813a8084c 100644
--- a/common/motion_utils/test/src/trajectory/test_trajectory.cpp
+++ b/common/motion_utils/test/src/trajectory/test_trajectory.cpp
@@ -2750,6 +2750,193 @@ TEST(trajectory, insertTargetPoint_Length_Without_Target_Point_Non_Zero_Start_Id
}
}
+TEST(trajectory, insertTargetPoint_Negative_Length_Without_Target_Point_Non_Zero_Start_Idx)
+{
+ using motion_utils::calcArcLength;
+ using motion_utils::findNearestSegmentIndex;
+ using motion_utils::insertTargetPoint;
+ using tier4_autoware_utils::calcDistance2d;
+ using tier4_autoware_utils::createPoint;
+ using tier4_autoware_utils::deg2rad;
+ using tier4_autoware_utils::getPose;
+
+ const auto traj = generateTestTrajectory(10, 1.0);
+
+ // Insert
+ for (double x_start = -0.5; x_start < -5.0; x_start -= 1.0) {
+ auto traj_out = traj;
+
+ const size_t start_idx = 7;
+ const auto p_target = createPoint(7.0 + x_start, 0.0, 0.0);
+ const size_t base_idx = findNearestSegmentIndex(traj.points, p_target);
+ const auto insert_idx = insertTargetPoint(start_idx, x_start, traj_out.points);
+
+ EXPECT_NE(insert_idx, boost::none);
+ EXPECT_EQ(insert_idx.get(), base_idx + 1);
+ EXPECT_EQ(traj_out.points.size(), traj.points.size() + 1);
+
+ for (size_t i = 0; i < traj_out.points.size() - 1; ++i) {
+ EXPECT_TRUE(calcDistance2d(traj_out.points.at(i), traj_out.points.at(i + 1)) > 1e-3);
+ }
+
+ {
+ const auto p_insert = getPose(traj_out.points.at(insert_idx.get()));
+ const auto ans_quat = createQuaternionFromRPY(deg2rad(0.0), deg2rad(0.0), deg2rad(0.0));
+ EXPECT_EQ(p_insert.position.x, p_target.x);
+ EXPECT_EQ(p_insert.position.y, p_target.y);
+ EXPECT_EQ(p_insert.position.z, p_target.z);
+ EXPECT_NEAR(p_insert.orientation.x, ans_quat.x, epsilon);
+ EXPECT_NEAR(p_insert.orientation.y, ans_quat.y, epsilon);
+ EXPECT_NEAR(p_insert.orientation.z, ans_quat.z, epsilon);
+ EXPECT_NEAR(p_insert.orientation.w, ans_quat.w, epsilon);
+ }
+
+ {
+ const auto p_base = getPose(traj_out.points.at(base_idx));
+ const auto ans_quat = createQuaternionFromRPY(deg2rad(0.0), deg2rad(0.0), deg2rad(0.0));
+ EXPECT_NEAR(p_base.orientation.x, ans_quat.x, epsilon);
+ EXPECT_NEAR(p_base.orientation.y, ans_quat.y, epsilon);
+ EXPECT_NEAR(p_base.orientation.z, ans_quat.z, epsilon);
+ EXPECT_NEAR(p_base.orientation.w, ans_quat.w, epsilon);
+ }
+ }
+
+ // Boundary Condition(Before End Point)
+ {
+ auto traj_out = traj;
+ const double x_start = -1.0 - 1e-2;
+
+ const size_t start_idx = 8;
+ const auto p_target = createPoint(7.0 - 1e-2, 0.0, 0.0);
+ const size_t base_idx = findNearestSegmentIndex(traj.points, p_target);
+ const auto insert_idx = insertTargetPoint(start_idx, x_start, traj_out.points);
+
+ EXPECT_NE(insert_idx, boost::none);
+ EXPECT_EQ(insert_idx.get(), base_idx + 1);
+ EXPECT_EQ(traj_out.points.size(), traj.points.size() + 1);
+
+ for (size_t i = 0; i < traj_out.points.size() - 1; ++i) {
+ EXPECT_TRUE(calcDistance2d(traj_out.points.at(i), traj_out.points.at(i + 1)) > 1e-3);
+ }
+
+ {
+ const auto p_insert = getPose(traj_out.points.at(insert_idx.get()));
+ const auto ans_quat = createQuaternionFromRPY(deg2rad(0.0), deg2rad(0.0), deg2rad(0.0));
+ EXPECT_EQ(p_insert.position.x, p_target.x);
+ EXPECT_EQ(p_insert.position.y, p_target.y);
+ EXPECT_EQ(p_insert.position.z, p_target.z);
+ EXPECT_NEAR(p_insert.orientation.x, ans_quat.x, epsilon);
+ EXPECT_NEAR(p_insert.orientation.y, ans_quat.y, epsilon);
+ EXPECT_NEAR(p_insert.orientation.z, ans_quat.z, epsilon);
+ EXPECT_NEAR(p_insert.orientation.w, ans_quat.w, epsilon);
+ }
+
+ {
+ const auto p_base = getPose(traj_out.points.at(base_idx));
+ const auto ans_quat = createQuaternionFromRPY(deg2rad(0.0), deg2rad(0.0), deg2rad(0.0));
+ EXPECT_NEAR(p_base.orientation.x, ans_quat.x, epsilon);
+ EXPECT_NEAR(p_base.orientation.y, ans_quat.y, epsilon);
+ EXPECT_NEAR(p_base.orientation.z, ans_quat.z, epsilon);
+ EXPECT_NEAR(p_base.orientation.w, ans_quat.w, epsilon);
+ }
+ }
+
+ // Boundary Condition(Right on End Point)
+ {
+ auto traj_out = traj;
+ const double x_start = -1.0;
+
+ const size_t start_idx = 8;
+ const auto p_target = createPoint(7.0, 0.0, 0.0);
+ const size_t base_idx = findNearestSegmentIndex(traj.points, p_target);
+ const auto insert_idx = insertTargetPoint(start_idx, x_start, traj_out.points);
+
+ EXPECT_NE(insert_idx, boost::none);
+ EXPECT_EQ(insert_idx.get(), base_idx + 1);
+ EXPECT_EQ(traj_out.points.size(), traj.points.size());
+
+ for (size_t i = 0; i < traj_out.points.size() - 1; ++i) {
+ EXPECT_TRUE(calcDistance2d(traj_out.points.at(i), traj_out.points.at(i + 1)) > 1e-3);
+ }
+
+ {
+ const auto p_insert = getPose(traj_out.points.at(insert_idx.get()));
+ const auto ans_quat = createQuaternionFromRPY(deg2rad(0.0), deg2rad(0.0), deg2rad(0.0));
+ EXPECT_EQ(p_insert.position.x, p_target.x);
+ EXPECT_EQ(p_insert.position.y, p_target.y);
+ EXPECT_EQ(p_insert.position.z, p_target.z);
+ EXPECT_NEAR(p_insert.orientation.x, ans_quat.x, epsilon);
+ EXPECT_NEAR(p_insert.orientation.y, ans_quat.y, epsilon);
+ EXPECT_NEAR(p_insert.orientation.z, ans_quat.z, epsilon);
+ EXPECT_NEAR(p_insert.orientation.w, ans_quat.w, epsilon);
+ }
+
+ {
+ const auto p_base = getPose(traj_out.points.at(base_idx));
+ const auto ans_quat = createQuaternionFromRPY(deg2rad(0.0), deg2rad(0.0), deg2rad(0.0));
+ EXPECT_NEAR(p_base.orientation.x, ans_quat.x, epsilon);
+ EXPECT_NEAR(p_base.orientation.y, ans_quat.y, epsilon);
+ EXPECT_NEAR(p_base.orientation.z, ans_quat.z, epsilon);
+ EXPECT_NEAR(p_base.orientation.w, ans_quat.w, epsilon);
+ }
+ }
+
+ // Boundary Condition(start point)
+ {
+ auto traj_out = traj;
+ const double x_start = -5.0;
+
+ const size_t start_idx = 5;
+ const auto p_target = createPoint(0.0, 0.0, 0.0);
+ const size_t base_idx = findNearestSegmentIndex(traj.points, p_target);
+ const auto insert_idx = insertTargetPoint(start_idx, x_start, traj_out.points);
+
+ EXPECT_NE(insert_idx, boost::none);
+ EXPECT_EQ(insert_idx.get(), base_idx);
+ EXPECT_EQ(traj_out.points.size(), traj.points.size());
+
+ for (size_t i = 0; i < traj_out.points.size() - 1; ++i) {
+ EXPECT_TRUE(calcDistance2d(traj_out.points.at(i), traj_out.points.at(i + 1)) > 1e-3);
+ }
+
+ {
+ const auto p_insert = getPose(traj_out.points.at(insert_idx.get()));
+ const auto ans_quat = createQuaternionFromRPY(deg2rad(0.0), deg2rad(0.0), deg2rad(0.0));
+ EXPECT_EQ(p_insert.position.x, p_target.x);
+ EXPECT_EQ(p_insert.position.y, p_target.y);
+ EXPECT_EQ(p_insert.position.z, p_target.z);
+ EXPECT_NEAR(p_insert.orientation.x, ans_quat.x, epsilon);
+ EXPECT_NEAR(p_insert.orientation.y, ans_quat.y, epsilon);
+ EXPECT_NEAR(p_insert.orientation.z, ans_quat.z, epsilon);
+ EXPECT_NEAR(p_insert.orientation.w, ans_quat.w, epsilon);
+ }
+
+ {
+ const auto p_base = getPose(traj_out.points.at(base_idx));
+ const auto ans_quat = createQuaternionFromRPY(deg2rad(0.0), deg2rad(0.0), deg2rad(0.0));
+ EXPECT_NEAR(p_base.orientation.x, ans_quat.x, epsilon);
+ EXPECT_NEAR(p_base.orientation.y, ans_quat.y, epsilon);
+ EXPECT_NEAR(p_base.orientation.z, ans_quat.z, epsilon);
+ EXPECT_NEAR(p_base.orientation.w, ans_quat.w, epsilon);
+ }
+ }
+
+ // No Insert (Index Out of range)
+ {
+ auto traj_out = traj;
+ EXPECT_EQ(insertTargetPoint(0, -1.0, traj_out.points), boost::none);
+ EXPECT_EQ(insertTargetPoint(0, -1.0, traj_out.points), boost::none);
+ }
+
+ // No Insert (Length out of range)
+ {
+ auto traj_out = traj;
+ EXPECT_EQ(insertTargetPoint(9, -10.0, traj_out.points), boost::none);
+ EXPECT_EQ(insertTargetPoint(9, -9.0001, traj_out.points), boost::none);
+ EXPECT_EQ(insertTargetPoint(1, -1.0001, traj_out.points), boost::none);
+ }
+}
+
TEST(trajectory, insertTargetPoint_Length_from_a_pose)
{
using motion_utils::calcArcLength;
@@ -5238,3 +5425,128 @@ TEST(Trajectory, removeInvalidOrientationPoints)
},
1); // expected size is 1 since only the first point remains
}
+
+TEST(trajectory, calcYawDeviation)
+{
+ using autoware_auto_planning_msgs::msg::TrajectoryPoint;
+ using motion_utils::calcYawDeviation;
+
+ constexpr double tolerance = 1e-3;
+
+ // Generate test trajectory
+ const auto trajectory = generateTestTrajectory(4, 10.0, 0.0, 0.0, M_PI / 8);
+
+ // check with fist point
+ {
+ const auto input_pose = createPose(0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
+ const double yaw_deviation = calcYawDeviation(trajectory.points, input_pose);
+ constexpr double expected_yaw_deviation = -M_PI / 8;
+ EXPECT_NEAR(yaw_deviation, expected_yaw_deviation, tolerance);
+ }
+
+ // check with middle point
+ {
+ const auto input_pose = createPose(10.0, 10.0, 0.0, 0.0, 0.0, M_PI / 8);
+ const double yaw_deviation = calcYawDeviation(trajectory.points, input_pose);
+ constexpr double expected_yaw_deviation = -0.734;
+ EXPECT_NEAR(yaw_deviation, expected_yaw_deviation, tolerance);
+ }
+}
+
+TEST(trajectory, isTargetPointFront)
+{
+ using autoware_auto_planning_msgs::msg::TrajectoryPoint;
+ using motion_utils::isTargetPointFront;
+ using tier4_autoware_utils::createPoint;
+
+ // Generate test trajectory
+ const auto trajectory = generateTestTrajectory(10, 1.0);
+
+ // Front point is base
+ {
+ const auto base_point = createPoint(5.0, 0.0, 0.0);
+ const auto target_point = createPoint(1.0, 0.0, 0.0);
+
+ EXPECT_FALSE(isTargetPointFront(trajectory.points, base_point, target_point));
+ }
+
+ // Front point is target
+ {
+ const auto base_point = createPoint(1.0, 0.0, 0.0);
+ const auto target_point = createPoint(3.0, 0.0, 0.0);
+
+ EXPECT_TRUE(isTargetPointFront(trajectory.points, base_point, target_point));
+ }
+
+ // boundary condition
+ {
+ const auto base_point = createPoint(1.0, 0.0, 0.0);
+ const auto target_point = createPoint(1.0, 0.0, 0.0);
+
+ EXPECT_FALSE(isTargetPointFront(trajectory.points, base_point, target_point));
+ }
+
+ // before the start point
+ {
+ const auto base_point = createPoint(1.0, 0.0, 0.0);
+ const auto target_point = createPoint(-3.0, 0.0, 0.0);
+
+ EXPECT_FALSE(isTargetPointFront(trajectory.points, base_point, target_point));
+ }
+
+ {
+ const auto base_point = createPoint(-5.0, 0.0, 0.0);
+ const auto target_point = createPoint(1.0, 0.0, 0.0);
+
+ EXPECT_TRUE(isTargetPointFront(trajectory.points, base_point, target_point));
+ }
+
+ // after the end point
+ {
+ const auto base_point = createPoint(10.0, 0.0, 0.0);
+ const auto target_point = createPoint(3.0, 0.0, 0.0);
+
+ EXPECT_FALSE(isTargetPointFront(trajectory.points, base_point, target_point));
+ }
+
+ {
+ const auto base_point = createPoint(2.0, 0.0, 0.0);
+ const auto target_point = createPoint(14.0, 0.0, 0.0);
+
+ EXPECT_TRUE(isTargetPointFront(trajectory.points, base_point, target_point));
+ }
+
+ // empty point
+ {
+ const Trajectory traj;
+ const auto base_point = createPoint(2.0, 0.0, 0.0);
+ const auto target_point = createPoint(5.0, 0.0, 0.0);
+ EXPECT_FALSE(isTargetPointFront(traj.points, base_point, target_point));
+ }
+
+ // non-default threshold
+ {
+ const double threshold = 3.0;
+
+ {
+ const auto base_point = createPoint(5.0, 0.0, 0.0);
+ const auto target_point = createPoint(3.0, 0.0, 0.0);
+
+ EXPECT_FALSE(isTargetPointFront(trajectory.points, base_point, target_point, threshold));
+ }
+
+ {
+ const auto base_point = createPoint(1.0, 0.0, 0.0);
+ const auto target_point = createPoint(4.0, 0.0, 0.0);
+
+ EXPECT_FALSE(isTargetPointFront(trajectory.points, base_point, target_point, threshold));
+ }
+
+ {
+ const auto base_point = createPoint(1.0, 0.0, 0.0);
+ const auto target_point = createPoint(4.1, 0.0, 0.0);
+
+ EXPECT_TRUE(isTargetPointFront(trajectory.points, base_point, target_point, threshold));
+ }
+ }
+}
diff --git a/common/osqp_interface/include/osqp_interface/csc_matrix_conv.hpp b/common/osqp_interface/include/osqp_interface/csc_matrix_conv.hpp
index cabced5855d10..a919bc1f1c038 100644
--- a/common/osqp_interface/include/osqp_interface/csc_matrix_conv.hpp
+++ b/common/osqp_interface/include/osqp_interface/csc_matrix_conv.hpp
@@ -15,10 +15,11 @@
#ifndef OSQP_INTERFACE__CSC_MATRIX_CONV_HPP_
#define OSQP_INTERFACE__CSC_MATRIX_CONV_HPP_
-#include "eigen3/Eigen/Core"
#include "osqp/glob_opts.h" // for 'c_int' type ('long' or 'long long')
#include "osqp_interface/visibility_control.hpp"
+#include
+
#include
namespace autoware
diff --git a/common/osqp_interface/include/osqp_interface/osqp_interface.hpp b/common/osqp_interface/include/osqp_interface/osqp_interface.hpp
index fa9d491cd9c5f..f126ba9329d3e 100644
--- a/common/osqp_interface/include/osqp_interface/osqp_interface.hpp
+++ b/common/osqp_interface/include/osqp_interface/osqp_interface.hpp
@@ -15,11 +15,11 @@
#ifndef OSQP_INTERFACE__OSQP_INTERFACE_HPP_
#define OSQP_INTERFACE__OSQP_INTERFACE_HPP_
-#include "eigen3/Eigen/Core"
#include "osqp/osqp.h"
#include "osqp_interface/csc_matrix_conv.hpp"
#include "osqp_interface/visibility_control.hpp"
+#include
#include
#include
diff --git a/common/osqp_interface/package.xml b/common/osqp_interface/package.xml
index 643611ca48448..41ee5bb9055a6 100644
--- a/common/osqp_interface/package.xml
+++ b/common/osqp_interface/package.xml
@@ -11,8 +11,7 @@
Apache 2.0
ament_cmake_auto
-
- autoware_cmake
+ autoware_cmake
eigen
osqp_vendor
diff --git a/common/osqp_interface/src/csc_matrix_conv.cpp b/common/osqp_interface/src/csc_matrix_conv.cpp
index 051740e8974e1..1944face4516b 100644
--- a/common/osqp_interface/src/csc_matrix_conv.cpp
+++ b/common/osqp_interface/src/csc_matrix_conv.cpp
@@ -14,8 +14,8 @@
#include "osqp_interface/csc_matrix_conv.hpp"
-#include "eigen3/Eigen/Core"
-#include "eigen3/Eigen/SparseCore"
+#include
+#include
#include
#include
diff --git a/common/osqp_interface/test/test_csc_matrix_conv.cpp b/common/osqp_interface/test/test_csc_matrix_conv.cpp
index 50b8487c26d80..765f1a1afed3b 100644
--- a/common/osqp_interface/test/test_csc_matrix_conv.cpp
+++ b/common/osqp_interface/test/test_csc_matrix_conv.cpp
@@ -12,10 +12,11 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "eigen3/Eigen/Core"
#include "gtest/gtest.h"
#include "osqp_interface/csc_matrix_conv.hpp"
+#include
+
#include
#include
#include
diff --git a/common/osqp_interface/test/test_osqp_interface.cpp b/common/osqp_interface/test/test_osqp_interface.cpp
index cf96f0164bafc..caa89c79d08ea 100644
--- a/common/osqp_interface/test/test_osqp_interface.cpp
+++ b/common/osqp_interface/test/test_osqp_interface.cpp
@@ -12,10 +12,11 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "eigen3/Eigen/Core"
#include "gtest/gtest.h"
#include "osqp_interface/osqp_interface.hpp"
+#include
+
#include
#include
diff --git a/common/path_distance_calculator/package.xml b/common/path_distance_calculator/package.xml
index 997fbec2d4ef5..b5e770a0ea624 100644
--- a/common/path_distance_calculator/package.xml
+++ b/common/path_distance_calculator/package.xml
@@ -10,8 +10,7 @@
Apache License 2.0
ament_cmake
-
- autoware_cmake
+ autoware_cmake
autoware_auto_planning_msgs
motion_utils
diff --git a/common/perception_utils/package.xml b/common/perception_utils/package.xml
index 5d1fa5cae84a6..bc1d1b8b6bece 100644
--- a/common/perception_utils/package.xml
+++ b/common/perception_utils/package.xml
@@ -11,8 +11,7 @@
Apache License 2.0
ament_cmake_auto
-
- autoware_cmake
+ autoware_cmake
autoware_auto_perception_msgs
geometry_msgs
diff --git a/common/polar_grid/package.xml b/common/polar_grid/package.xml
index 75118d09ef5d2..ece156669c85b 100644
--- a/common/polar_grid/package.xml
+++ b/common/polar_grid/package.xml
@@ -8,8 +8,7 @@
Apache License 2.0
ament_cmake_auto
-
- autoware_cmake
+ autoware_cmake
libqt5-core
libqt5-gui
diff --git a/common/qp_interface/CMakeLists.txt b/common/qp_interface/CMakeLists.txt
new file mode 100644
index 0000000000000..00b2847309e9e
--- /dev/null
+++ b/common/qp_interface/CMakeLists.txt
@@ -0,0 +1,64 @@
+cmake_minimum_required(VERSION 3.14)
+project(qp_interface)
+
+find_package(autoware_cmake REQUIRED)
+autoware_package()
+
+find_package(Eigen3 REQUIRED)
+find_package(proxsuite REQUIRED)
+
+# after find_package(osqp_vendor) in ament_auto_find_build_dependencies
+find_package(osqp REQUIRED)
+get_target_property(OSQP_INCLUDE_SUB_DIR osqp::osqp INTERFACE_INCLUDE_DIRECTORIES)
+get_filename_component(OSQP_INCLUDE_DIR ${OSQP_INCLUDE_SUB_DIR} PATH)
+
+set(QP_INTERFACE_LIB_SRC
+ src/qp_interface.cpp
+ src/osqp_interface.cpp
+ src/osqp_csc_matrix_conv.cpp
+ src/proxqp_interface.cpp
+)
+
+set(QP_INTERFACE_LIB_HEADERS
+ include/qp_interface/qp_interface.hpp
+ include/qp_interface/osqp_interface.hpp
+ include/qp_interface/osqp_csc_matrix_conv.hpp
+ include/qp_interface/proxqp_interface.hpp
+)
+
+ament_auto_add_library(${PROJECT_NAME} SHARED
+ ${QP_INTERFACE_LIB_SRC}
+ ${QP_INTERFACE_LIB_HEADERS}
+)
+target_compile_options(${PROJECT_NAME} PRIVATE -Wno-error=old-style-cast -Wno-error=useless-cast)
+
+target_include_directories(qp_interface
+ SYSTEM PUBLIC
+ "${OSQP_INCLUDE_DIR}"
+ "${EIGEN3_INCLUDE_DIR}"
+)
+
+ament_target_dependencies(qp_interface
+ Eigen3
+ osqp_vendor
+ proxsuite
+)
+
+# crucial so downstream package builds because osqp_interface exposes osqp.hpp
+ament_export_include_directories("${OSQP_INCLUDE_DIR}")
+# crucial so the linking order is correct in a downstream package: libosqp_interface.a should come before libosqp.a
+ament_export_libraries(osqp::osqp)
+
+if(BUILD_TESTING)
+ set(TEST_SOURCES
+ test/test_osqp_interface.cpp
+ test/test_csc_matrix_conv.cpp
+ test/test_proxqp_interface.cpp
+ )
+ set(TEST_OSQP_INTERFACE_EXE test_osqp_interface)
+ ament_add_ros_isolated_gtest(${TEST_OSQP_INTERFACE_EXE} ${TEST_SOURCES})
+ target_link_libraries(${TEST_OSQP_INTERFACE_EXE} ${PROJECT_NAME})
+endif()
+
+ament_auto_package(INSTALL_TO_SHARE
+)
diff --git a/common/qp_interface/design/qp_interface-design.md b/common/qp_interface/design/qp_interface-design.md
new file mode 100644
index 0000000000000..3843e5a742d1e
--- /dev/null
+++ b/common/qp_interface/design/qp_interface-design.md
@@ -0,0 +1,48 @@
+# Interface for QP solvers
+
+This is the design document for the `qp_interface` package.
+
+## Purpose / Use cases
+
+This packages provides a C++ interface for QP solvers.
+Currently, supported QP solvers are
+
+- [OSQP library](https://osqp.org/docs/solver/index.html)
+
+## Design
+
+The class `QPInterface` takes a problem formulation as Eigen matrices and vectors, converts these objects into
+C-style Compressed-Column-Sparse matrices and dynamic arrays, loads the data into the QP workspace dataholder, and runs the optimizer.
+
+## Inputs / Outputs / API
+
+The interface can be used in several ways:
+
+1. Initialize the interface, and load the problem formulation at the optimization call.
+
+ ```cpp
+ QPInterface qp_interface;
+ qp_interface.optimize(P, A, q, l, u);
+ ```
+
+2. WARM START OPTIMIZATION by modifying the problem formulation between optimization runs.
+
+ ```cpp
+ QPInterface qp_interface(true);
+ qp_interface.optimize(P, A, q, l, u);
+ qp_interface.optimize(P_new, A_new, q_new, l_new, u_new);
+ ```
+
+ The optimization results are returned as a vector by the optimization function.
+
+ ```cpp
+ const auto solution = qp_interface.optimize();
+ double x_0 = solution[0];
+ double x_1 = solution[1];
+ ```
+
+## References / External links
+
+- OSQP library:
+
+## Related issues
diff --git a/common/qp_interface/include/qp_interface/osqp_csc_matrix_conv.hpp b/common/qp_interface/include/qp_interface/osqp_csc_matrix_conv.hpp
new file mode 100644
index 0000000000000..74ec4c1282f46
--- /dev/null
+++ b/common/qp_interface/include/qp_interface/osqp_csc_matrix_conv.hpp
@@ -0,0 +1,46 @@
+// Copyright 2023 TIER IV, Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef QP_INTERFACE__OSQP_CSC_MATRIX_CONV_HPP_
+#define QP_INTERFACE__OSQP_CSC_MATRIX_CONV_HPP_
+
+#include "osqp/glob_opts.h"
+
+#include
+
+#include
+
+namespace qp
+{
+/// \brief Compressed-Column-Sparse Matrix
+struct CSC_Matrix
+{
+ /// Vector of non-zero values. Ex: [4,1,1,2]
+ std::vector m_vals;
+ /// Vector of row index corresponding to values. Ex: [0, 1, 0, 1] (Eigen: 'inner')
+ std::vector m_row_idxs;
+ /// Vector of 'val' indices where each column starts. Ex: [0, 2, 4] (Eigen: 'outer')
+ std::vector m_col_idxs;
+};
+
+/// \brief Calculate CSC matrix from Eigen matrix
+CSC_Matrix calCSCMatrix(const Eigen::MatrixXd & mat);
+/// \brief Calculate upper trapezoidal CSC matrix from square Eigen matrix
+CSC_Matrix calCSCMatrixTrapezoidal(const Eigen::MatrixXd & mat);
+/// \brief Print the given CSC matrix to the standard output
+void printCSCMatrix(const CSC_Matrix & csc_mat);
+
+} // namespace qp
+
+#endif // QP_INTERFACE__OSQP_CSC_MATRIX_CONV_HPP_
diff --git a/common/qp_interface/include/qp_interface/osqp_interface.hpp b/common/qp_interface/include/qp_interface/osqp_interface.hpp
new file mode 100644
index 0000000000000..ef2c3bd17c89e
--- /dev/null
+++ b/common/qp_interface/include/qp_interface/osqp_interface.hpp
@@ -0,0 +1,145 @@
+// Copyright 2023 TIER IV, Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef QP_INTERFACE__OSQP_INTERFACE_HPP_
+#define QP_INTERFACE__OSQP_INTERFACE_HPP_
+
+#include "osqp/osqp.h"
+#include "qp_interface/osqp_csc_matrix_conv.hpp"
+#include "qp_interface/qp_interface.hpp"
+
+#include
+#include
+#include
+#include
+
+namespace qp
+{
+constexpr c_float INF = 1e30;
+
+class OSQPInterface : public QPInterface
+{
+public:
+ /// \brief Constructor without problem formulation
+ OSQPInterface(
+ const bool enable_warm_start = false,
+ const c_float eps_abs = std::numeric_limits::epsilon(), const bool polish = true);
+ /// \brief Constructor with problem setup
+ /// \param P: (n,n) matrix defining relations between parameters.
+ /// \param A: (m,n) matrix defining parameter constraints relative to the lower and upper bound.
+ /// \param q: (n) vector defining the linear cost of the problem.
+ /// \param l: (m) vector defining the lower bound problem constraint.
+ /// \param u: (m) vector defining the upper bound problem constraint.
+ /// \param eps_abs: Absolute convergence tolerance.
+ OSQPInterface(
+ const Eigen::MatrixXd & P, const Eigen::MatrixXd & A, const std::vector & q,
+ const std::vector & l, const std::vector & u,
+ const bool enable_warm_start = false,
+ const c_float eps_abs = std::numeric_limits::epsilon());
+ OSQPInterface(
+ const CSC_Matrix & P, const CSC_Matrix & A, const std::vector & q,
+ const std::vector & l, const std::vector & u,
+ const bool enable_warm_start = false,
+ const c_float eps_abs = std::numeric_limits::epsilon());
+ ~OSQPInterface();
+
+ static void OSQPWorkspaceDeleter(OSQPWorkspace * ptr) noexcept;
+
+ std::vector optimize(
+ CSC_Matrix P, CSC_Matrix A, const std::vector & q, const std::vector & l,
+ const std::vector & u);
+
+ int getIteration() const override;
+ int getStatus() const override;
+ int getPolishStatus() const;
+ std::vector getDualSolution() const;
+
+ void updateEpsAbs(const double eps_abs) override;
+ void updateEpsRel(const double eps_rel) override;
+ void updateVerbose(const bool verbose) override;
+
+ // Updates problem parameters while keeping solution in memory.
+ //
+ // Args:
+ // P_new: (n,n) matrix defining relations between parameters.
+ // A_new: (m,n) matrix defining parameter constraints relative to the lower and upper bound.
+ // q_new: (n) vector defining the linear cost of the problem.
+ // l_new: (m) vector defining the lower bound problem constraint.
+ // u_new: (m) vector defining the upper bound problem constraint.
+ void updateP(const Eigen::MatrixXd & P_new);
+ void updateCscP(const CSC_Matrix & P_csc);
+ void updateA(const Eigen::MatrixXd & A_new);
+ void updateCscA(const CSC_Matrix & A_csc);
+ void updateQ(const std::vector & q_new);
+ void updateL(const std::vector & l_new);
+ void updateU(const std::vector & u_new);
+ void updateBounds(const std::vector & l_new, const std::vector & u_new);
+
+ void updateMaxIter(const int iter);
+ void updateRhoInterval(const int rho_interval);
+ void updateRho(const double rho);
+ void updateAlpha(const double alpha);
+ void updateScaling(const int scaling);
+ void updatePolish(const bool polish);
+ void updatePolishRefinementIteration(const int polish_refine_iter);
+ void updateCheckTermination(const int check_termination);
+
+ /// \brief Get the number of iteration taken to solve the problem
+ inline int64_t getTakenIter() const { return static_cast(m_latest_work_info.iter); }
+ /// \brief Get the status message for the latest problem solved
+ inline std::string getStatusMessage() const
+ {
+ return static_cast(m_latest_work_info.status);
+ }
+ /// \brief Get the runtime of the latest problem solved
+ inline double getRunTime() const { return m_latest_work_info.run_time; }
+ /// \brief Get the objective value the latest problem solved
+ inline double getObjVal() const { return m_latest_work_info.obj_val; }
+ /// \brief Returns flag asserting interface condition (Healthy condition: 0).
+ inline int64_t getExitFlag() const { return m_exitflag; }
+
+ void logUnsolvedStatus(const std::string & prefix_message = "") const;
+
+ // Setter functions for warm start
+ bool setWarmStart(
+ const std::vector & primal_variables, const std::vector & dual_variables);
+ bool setPrimalVariables(const std::vector & primal_variables);
+ bool setDualVariables(const std::vector & dual_variables);
+
+private:
+ std::unique_ptr> m_work;
+ std::unique_ptr m_settings;
+ std::unique_ptr m_data;
+ // store last work info since work is cleaned up at every execution to prevent memory leak.
+ OSQPInfo m_latest_work_info;
+ // Number of parameters to optimize
+ int64_t m_param_n;
+ // Flag to check if the current work exists
+ bool m_work_initialized = false;
+ // Exitflag
+ int64_t m_exitflag;
+
+ void initializeProblemImpl(
+ const Eigen::MatrixXd & P, const Eigen::MatrixXd & A, const std::vector & q,
+ const std::vector & l, const std::vector & u) override;
+
+ void initializeCSCProblemImpl(
+ CSC_Matrix P, CSC_Matrix A, const std::vector & q, const std::vector & l,
+ const std::vector & u);
+
+ std::vector optimizeImpl() override;
+};
+} // namespace qp
+
+#endif // QP_INTERFACE__OSQP_INTERFACE_HPP_
diff --git a/common/qp_interface/include/qp_interface/proxqp_interface.hpp b/common/qp_interface/include/qp_interface/proxqp_interface.hpp
new file mode 100644
index 0000000000000..a940262d5f6da
--- /dev/null
+++ b/common/qp_interface/include/qp_interface/proxqp_interface.hpp
@@ -0,0 +1,55 @@
+// Copyright 2023 TIER IV, Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef QP_INTERFACE__PROXQP_INTERFACE_HPP_
+#define QP_INTERFACE__PROXQP_INTERFACE_HPP_
+
+#include "qp_interface/qp_interface.hpp"
+
+#include
+#include
+
+#include
+#include
+#include
+
+namespace qp
+{
+class ProxQPInterface : public QPInterface
+{
+public:
+ explicit ProxQPInterface(
+ const bool enable_warm_start = false,
+ const double eps_abs = std::numeric_limits::epsilon());
+
+ int getIteration() const override;
+ int getStatus() const override;
+
+ void updateEpsAbs(const double eps_abs) override;
+ void updateEpsRel(const double eps_rel) override;
+ void updateVerbose(const bool verbose) override;
+
+private:
+ proxsuite::proxqp::Settings m_settings;
+ std::shared_ptr> m_qp_ptr;
+
+ void initializeProblemImpl(
+ const Eigen::MatrixXd & P, const Eigen::MatrixXd & A, const std::vector & q,
+ const std::vector & l, const std::vector & u) override;
+
+ std::vector optimizeImpl() override;
+};
+} // namespace qp
+
+#endif // QP_INTERFACE__PROXQP_INTERFACE_HPP_
diff --git a/common/qp_interface/include/qp_interface/qp_interface.hpp b/common/qp_interface/include/qp_interface/qp_interface.hpp
new file mode 100644
index 0000000000000..026c0fe413b71
--- /dev/null
+++ b/common/qp_interface/include/qp_interface/qp_interface.hpp
@@ -0,0 +1,59 @@
+// Copyright 2023 TIER IV, Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#ifndef QP_INTERFACE__QP_INTERFACE_HPP_
+#define QP_INTERFACE__QP_INTERFACE_HPP_
+
+#include
+
+#include
+#include
+
+namespace qp
+{
+class QPInterface
+{
+public:
+ explicit QPInterface(const bool enable_warm_start) : m_enable_warm_start(enable_warm_start) {}
+
+ std::vector optimize(
+ const Eigen::MatrixXd & P, const Eigen::MatrixXd & A, const std::vector & q,
+ const std::vector & l, const std::vector & u);
+
+ virtual int getIteration() const = 0;
+ virtual int getStatus() const = 0;
+
+ virtual void updateEpsAbs([[maybe_unused]] const double eps_abs) = 0;
+ virtual void updateEpsRel([[maybe_unused]] const double eps_rel) = 0;
+ virtual void updateVerbose([[maybe_unused]] const bool verbose) {}
+
+protected:
+ bool m_enable_warm_start;
+
+ void initializeProblem(
+ const Eigen::MatrixXd & P, const Eigen::MatrixXd & A, const std::vector & q,
+ const std::vector & l, const std::vector & u);
+
+ virtual void initializeProblemImpl(
+ const Eigen::MatrixXd & P, const Eigen::MatrixXd & A, const std::vector & q,
+ const std::vector & l, const std::vector & u) = 0;
+
+ virtual std::vector optimizeImpl() = 0;
+
+ std::optional m_variables_num;
+ std::optional m_constraints_num;
+};
+} // namespace qp
+
+#endif // QP_INTERFACE__QP_INTERFACE_HPP_
diff --git a/common/qp_interface/package.xml b/common/qp_interface/package.xml
new file mode 100644
index 0000000000000..22cc3665ffaa0
--- /dev/null
+++ b/common/qp_interface/package.xml
@@ -0,0 +1,30 @@
+
+
+
+ qp_interface
+ 1.0.0
+ Interface for the QP solvers
+ Takayuki Murooka
+ Fumiya Watanabe
+ Maxime CLEMENT
+ Satoshi Ota
+ Apache 2.0
+
+ ament_cmake_auto
+ autoware_cmake
+
+ eigen
+ osqp_vendor
+ proxsuite
+ rclcpp
+ rclcpp_components
+
+ ament_cmake_ros
+ ament_lint_auto
+ autoware_lint_common
+ eigen
+
+
+ ament_cmake
+
+
diff --git a/common/qp_interface/src/osqp_csc_matrix_conv.cpp b/common/qp_interface/src/osqp_csc_matrix_conv.cpp
new file mode 100644
index 0000000000000..0faf7586463fd
--- /dev/null
+++ b/common/qp_interface/src/osqp_csc_matrix_conv.cpp
@@ -0,0 +1,134 @@
+// Copyright 2023 TIER IV, Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "qp_interface/osqp_csc_matrix_conv.hpp"
+
+#include
+#include
+
+#include
+#include
+#include
+
+namespace qp
+{
+CSC_Matrix calCSCMatrix(const Eigen::MatrixXd & mat)
+{
+ const size_t elem = static_cast(mat.nonZeros());
+ const Eigen::Index rows = mat.rows();
+ const Eigen::Index cols = mat.cols();
+
+ std::vector vals;
+ vals.reserve(elem);
+ std::vector row_idxs;
+ row_idxs.reserve(elem);
+ std::vector col_idxs;
+ col_idxs.reserve(elem);
+
+ // Construct CSC matrix arrays
+ c_float val;
+ c_int elem_count = 0;
+
+ col_idxs.push_back(0);
+
+ for (Eigen::Index j = 0; j < cols; j++) { // col iteration
+ for (Eigen::Index i = 0; i < rows; i++) { // row iteration
+ // Get values of nonzero elements
+ val = mat(i, j);
+ if (std::fabs(val) < 1e-9) {
+ continue;
+ }
+ elem_count += 1;
+
+ // Store values
+ vals.push_back(val);
+ row_idxs.push_back(i);
+ }
+
+ col_idxs.push_back(elem_count);
+ }
+
+ CSC_Matrix csc_matrix = {vals, row_idxs, col_idxs};
+
+ return csc_matrix;
+}
+
+CSC_Matrix calCSCMatrixTrapezoidal(const Eigen::MatrixXd & mat)
+{
+ const size_t elem = static_cast(mat.nonZeros());
+ const Eigen::Index rows = mat.rows();
+ const Eigen::Index cols = mat.cols();
+
+ if (rows != cols) {
+ throw std::invalid_argument("Matrix must be square (n, n)");
+ }
+
+ std::vector vals;
+ vals.reserve(elem);
+ std::vector row_idxs;
+ row_idxs.reserve(elem);
+ std::vector col_idxs;
+ col_idxs.reserve(elem);
+
+ // Construct CSC matrix arrays
+ c_float val;
+ Eigen::Index trap_last_idx = 0;
+ c_int elem_count = 0;
+
+ col_idxs.push_back(0);
+
+ for (Eigen::Index j = 0; j < cols; j++) { // col iteration
+ for (Eigen::Index i = 0; i <= trap_last_idx; i++) { // row iteration
+ // Get values of nonzero elements
+ val = mat(i, j);
+ if (std::fabs(val) < 1e-9) {
+ continue;
+ }
+ elem_count += 1;
+
+ // Store values
+ vals.push_back(val);
+ row_idxs.push_back(i);
+ }
+
+ col_idxs.push_back(elem_count);
+ trap_last_idx += 1;
+ }
+
+ CSC_Matrix csc_matrix = {vals, row_idxs, col_idxs};
+
+ return csc_matrix;
+}
+
+void printCSCMatrix(const CSC_Matrix & csc_mat)
+{
+ std::cout << "[";
+ for (const c_float & val : csc_mat.m_vals) {
+ std::cout << val << ", ";
+ }
+ std::cout << "]\n";
+
+ std::cout << "[";
+ for (const c_int & row : csc_mat.m_row_idxs) {
+ std::cout << row << ", ";
+ }
+ std::cout << "]\n";
+
+ std::cout << "[";
+ for (const c_int & col : csc_mat.m_col_idxs) {
+ std::cout << col << ", ";
+ }
+ std::cout << "]\n";
+}
+} // namespace qp
diff --git a/common/qp_interface/src/osqp_interface.cpp b/common/qp_interface/src/osqp_interface.cpp
new file mode 100644
index 0000000000000..81d2ffeeaaed5
--- /dev/null
+++ b/common/qp_interface/src/osqp_interface.cpp
@@ -0,0 +1,399 @@
+// Copyright 2023 TIER IV, Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "qp_interface/osqp_interface.hpp"
+
+#include "qp_interface/osqp_csc_matrix_conv.hpp"
+
+#include
+
+namespace qp
+{
+OSQPInterface::OSQPInterface(const bool enable_warm_start, const c_float eps_abs, const bool polish)
+: QPInterface(enable_warm_start), m_work{nullptr, OSQPWorkspaceDeleter}
+{
+ m_settings = std::make_unique();
+ m_data = std::make_unique();
+
+ if (m_settings) {
+ osqp_set_default_settings(m_settings.get());
+ m_settings->alpha = 1.6; // Change alpha parameter
+ m_settings->eps_rel = 1.0E-4;
+ m_settings->eps_abs = eps_abs;
+ m_settings->eps_prim_inf = 1.0E-4;
+ m_settings->eps_dual_inf = 1.0E-4;
+ m_settings->warm_start = true;
+ m_settings->max_iter = 4000;
+ m_settings->verbose = false;
+ m_settings->polish = polish;
+ }
+ m_exitflag = 0;
+}
+
+OSQPInterface::OSQPInterface(
+ const Eigen::MatrixXd & P, const Eigen::MatrixXd & A, const std::vector & q,
+ const std::vector & l, const std::vector & u, const bool enable_warm_start,
+ const c_float eps_abs)
+: OSQPInterface(enable_warm_start, eps_abs)
+{
+ initializeProblem(P, A, q, l, u);
+}
+
+OSQPInterface::OSQPInterface(
+ const CSC_Matrix & P, const CSC_Matrix & A, const std::vector & q,
+ const std::vector & l, const std::vector & u, const bool enable_warm_start,
+ const c_float eps_abs)
+: OSQPInterface(enable_warm_start, eps_abs)
+{
+ initializeCSCProblemImpl(P, A, q, l, u);
+}
+
+OSQPInterface::~OSQPInterface()
+{
+ if (m_data->P) free(m_data->P);
+ if (m_data->A) free(m_data->A);
+}
+
+void OSQPInterface::initializeProblemImpl(
+ const Eigen::MatrixXd & P, const Eigen::MatrixXd & A, const std::vector & q,
+ const std::vector & l, const std::vector & u)
+{
+ CSC_Matrix P_csc = calCSCMatrixTrapezoidal(P);
+ CSC_Matrix A_csc = calCSCMatrix(A);
+ initializeCSCProblemImpl(P_csc, A_csc, q, l, u);
+}
+
+void OSQPInterface::initializeCSCProblemImpl(
+ CSC_Matrix P_csc, CSC_Matrix A_csc, const std::vector & q, const std::vector & l,
+ const std::vector & u)
+{
+ // Dynamic float arrays
+ std::vector q_tmp(q.begin(), q.end());
+ std::vector l_tmp(l.begin(), l.end());
+ std::vector u_tmp(u.begin(), u.end());
+ double * q_dyn = q_tmp.data();
+ double * l_dyn = l_tmp.data();
+ double * u_dyn = u_tmp.data();
+
+ /**********************
+ * OBJECTIVE FUNCTION
+ **********************/
+ m_param_n = static_cast(q.size());
+ m_data->m = static_cast(l.size());
+
+ /*****************
+ * POPULATE DATA
+ *****************/
+ m_data->n = m_param_n;
+ if (m_data->P) free(m_data->P);
+ m_data->P = csc_matrix(
+ m_data->n, m_data->n, static_cast(P_csc.m_vals.size()), P_csc.m_vals.data(),
+ P_csc.m_row_idxs.data(), P_csc.m_col_idxs.data());
+ m_data->q = q_dyn;
+ if (m_data->A) free(m_data->A);
+ m_data->A = csc_matrix(
+ m_data->m, m_data->n, static_cast(A_csc.m_vals.size()), A_csc.m_vals.data(),
+ A_csc.m_row_idxs.data(), A_csc.m_col_idxs.data());
+ m_data->l = l_dyn;
+ m_data->u = u_dyn;
+
+ // Setup workspace
+ OSQPWorkspace * workspace;
+ m_exitflag = osqp_setup(&workspace, m_data.get(), m_settings.get());
+ m_work.reset(workspace);
+ m_work_initialized = true;
+}
+
+void OSQPInterface::OSQPWorkspaceDeleter(OSQPWorkspace * ptr) noexcept
+{
+ if (ptr != nullptr) {
+ osqp_cleanup(ptr);
+ }
+}
+
+void OSQPInterface::updateEpsAbs(const double eps_abs)
+{
+ m_settings->eps_abs = eps_abs; // for default setting
+ if (m_work_initialized) {
+ osqp_update_eps_abs(m_work.get(), eps_abs); // for current work
+ }
+}
+
+void OSQPInterface::updateEpsRel(const double eps_rel)
+{
+ m_settings->eps_rel = eps_rel; // for default setting
+ if (m_work_initialized) {
+ osqp_update_eps_rel(m_work.get(), eps_rel); // for current work
+ }
+}
+
+void OSQPInterface::updateMaxIter(const int max_iter)
+{
+ m_settings->max_iter = max_iter; // for default setting
+ if (m_work_initialized) {
+ osqp_update_max_iter(m_work.get(), max_iter); // for current work
+ }
+}
+
+void OSQPInterface::updateVerbose(const bool is_verbose)
+{
+ m_settings->verbose = is_verbose; // for default setting
+ if (m_work_initialized) {
+ osqp_update_verbose(m_work.get(), is_verbose); // for current work
+ }
+}
+
+void OSQPInterface::updateRhoInterval(const int rho_interval)
+{
+ m_settings->adaptive_rho_interval = rho_interval; // for default setting
+}
+
+void OSQPInterface::updateRho(const double rho)
+{
+ m_settings->rho = rho;
+ if (m_work_initialized) {
+ osqp_update_rho(m_work.get(), rho);
+ }
+}
+
+void OSQPInterface::updateAlpha(const double alpha)
+{
+ m_settings->alpha = alpha;
+ if (m_work_initialized) {
+ osqp_update_alpha(m_work.get(), alpha);
+ }
+}
+
+void OSQPInterface::updateScaling(const int scaling)
+{
+ m_settings->scaling = scaling;
+}
+
+void OSQPInterface::updatePolish(const bool polish)
+{
+ m_settings->polish = polish;
+ if (m_work_initialized) {
+ osqp_update_polish(m_work.get(), polish);
+ }
+}
+
+void OSQPInterface::updatePolishRefinementIteration(const int polish_refine_iter)
+{
+ if (polish_refine_iter < 0) {
+ std::cerr << "Polish refinement iterations must be positive" << std::endl;
+ return;
+ }
+
+ m_settings->polish_refine_iter = polish_refine_iter;
+ if (m_work_initialized) {
+ osqp_update_polish_refine_iter(m_work.get(), polish_refine_iter);
+ }
+}
+
+void OSQPInterface::updateCheckTermination(const int check_termination)
+{
+ if (check_termination < 0) {
+ std::cerr << "Check termination must be positive" << std::endl;
+ return;
+ }
+
+ m_settings->check_termination = check_termination;
+ if (m_work_initialized) {
+ osqp_update_check_termination(m_work.get(), check_termination);
+ }
+}
+
+bool OSQPInterface::setWarmStart(
+ const std::vector & primal_variables, const std::vector & dual_variables)
+{
+ return setPrimalVariables(primal_variables) && setDualVariables(dual_variables);
+}
+
+bool OSQPInterface::setPrimalVariables(const std::vector & primal_variables)
+{
+ if (!m_work_initialized) {
+ return false;
+ }
+
+ const auto result = osqp_warm_start_x(m_work.get(), primal_variables.data());
+ if (result != 0) {
+ std::cerr << "Failed to set primal variables for warm start" << std::endl;
+ return false;
+ }
+
+ return true;
+}
+
+bool OSQPInterface::setDualVariables(const std::vector & dual_variables)
+{
+ if (!m_work_initialized) {
+ return false;
+ }
+
+ const auto result = osqp_warm_start_y(m_work.get(), dual_variables.data());
+ if (result != 0) {
+ std::cerr << "Failed to set dual variables for warm start" << std::endl;
+ return false;
+ }
+
+ return true;
+}
+
+void OSQPInterface::logUnsolvedStatus(const std::string & prefix_message) const
+{
+ const int status = getStatus();
+ if (status == 1) {
+ // No need to log since optimization was solved.
+ return;
+ }
+
+ // create message
+ std::string output_message = "";
+ if (prefix_message != "") {
+ output_message = prefix_message + " ";
+ }
+
+ const auto status_message = getStatusMessage();
+ output_message += "Optimization failed due to " + status_message;
+
+ // log with warning
+ RCLCPP_WARN(rclcpp::get_logger("osqp_interface"), output_message.c_str());
+}
+
+void OSQPInterface::updateP(const Eigen::MatrixXd & P_new)
+{
+ /*
+ // Transform 'P' into an 'upper trapezoidal matrix'
+ Eigen::MatrixXd P_trap = P_new.triangularView();
+ // Transform 'P' into a sparse matrix and extract data as dynamic arrays
+ Eigen::SparseMatrix P_sparse = P_trap.sparseView();
+ double *P_val_ptr = P_sparse.valuePtr();
+ // Convert dynamic 'int' arrays to 'c_int' arrays (OSQP input type)
+ c_int P_elem_N = P_sparse.nonZeros();
+ */
+ CSC_Matrix P_csc = calCSCMatrixTrapezoidal(P_new);
+ osqp_update_P(
+ m_work.get(), P_csc.m_vals.data(), OSQP_NULL, static_cast(P_csc.m_vals.size()));
+}
+
+void OSQPInterface::updateCscP(const CSC_Matrix & P_csc)
+{
+ osqp_update_P(
+ m_work.get(), P_csc.m_vals.data(), OSQP_NULL, static_cast(P_csc.m_vals.size()));
+}
+
+void OSQPInterface::updateA(const Eigen::MatrixXd & A_new)
+{
+ /*
+ // Transform 'A' into a sparse matrix and extract data as dynamic arrays
+ Eigen::SparseMatrix A_sparse = A_new.sparseView();
+ double *A_val_ptr = A_sparse.valuePtr();
+ // Convert dynamic 'int' arrays to 'c_int' arrays (OSQP input type)
+ c_int A_elem_N = A_sparse.nonZeros();
+ */
+ CSC_Matrix A_csc = calCSCMatrix(A_new);
+ osqp_update_A(
+ m_work.get(), A_csc.m_vals.data(), OSQP_NULL, static_cast(A_csc.m_vals.size()));
+ return;
+}
+
+void OSQPInterface::updateCscA(const CSC_Matrix & A_csc)
+{
+ osqp_update_A(
+ m_work.get(), A_csc.m_vals.data(), OSQP_NULL, static_cast(A_csc.m_vals.size()));
+}
+
+void OSQPInterface::updateQ(const std::vector & q_new)
+{
+ std::vector q_tmp(q_new.begin(), q_new.end());
+ double * q_dyn = q_tmp.data();
+ osqp_update_lin_cost(m_work.get(), q_dyn);
+}
+
+void OSQPInterface::updateL(const std::vector & l_new)
+{
+ std::vector l_tmp(l_new.begin(), l_new.end());
+ double * l_dyn = l_tmp.data();
+ osqp_update_lower_bound(m_work.get(), l_dyn);
+}
+
+void OSQPInterface::updateU(const std::vector & u_new)
+{
+ std::vector u_tmp(u_new.begin(), u_new.end());
+ double * u_dyn = u_tmp.data();
+ osqp_update_upper_bound(m_work.get(), u_dyn);
+}
+
+void OSQPInterface::updateBounds(
+ const std::vector & l_new, const std::vector & u_new)
+{
+ std::vector l_tmp(l_new.begin(), l_new.end());
+ std::vector u_tmp(u_new.begin(), u_new.end());
+ double * l_dyn = l_tmp.data();
+ double * u_dyn = u_tmp.data();
+ osqp_update_bounds(m_work.get(), l_dyn, u_dyn);
+}
+
+int OSQPInterface::getIteration() const
+{
+ return m_work->info->iter;
+}
+
+int OSQPInterface::getStatus() const
+{
+ return static_cast(m_latest_work_info.status_val);
+}
+
+int OSQPInterface::getPolishStatus() const
+{
+ return static_cast(m_latest_work_info.status_polish);
+}
+
+std::vector OSQPInterface::getDualSolution() const
+{
+ double * sol_y = m_work->solution->y;
+ std::vector dual_solution(sol_y, sol_y + m_data->m);
+ return dual_solution;
+}
+
+std::vector OSQPInterface::optimizeImpl()
+{
+ osqp_solve(m_work.get());
+
+ double * sol_x = m_work->solution->x;
+ double * sol_y = m_work->solution->y;
+ std::vector sol_primal(sol_x, sol_x + m_param_n);
+ std::vector sol_lagrange_multiplier(sol_y, sol_y + m_data->m);
+
+ m_latest_work_info = *(m_work->info);
+
+ if (!m_enable_warm_start) {
+ m_work.reset();
+ m_work_initialized = false;
+ }
+
+ return sol_primal;
+}
+
+std::vector OSQPInterface::optimize(
+ CSC_Matrix P, CSC_Matrix A, const std::vector & q, const std::vector & l,
+ const std::vector & u)
+{
+ initializeCSCProblemImpl(P, A, q, l, u);
+ const auto result = optimizeImpl();
+
+ return result;
+}
+
+} // namespace qp
diff --git a/common/qp_interface/src/proxqp_interface.cpp b/common/qp_interface/src/proxqp_interface.cpp
new file mode 100644
index 0000000000000..bf1f0229e1e21
--- /dev/null
+++ b/common/qp_interface/src/proxqp_interface.cpp
@@ -0,0 +1,121 @@
+// Copyright 2023 TIER IV, Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "qp_interface/proxqp_interface.hpp"
+
+namespace qp
+{
+ProxQPInterface::ProxQPInterface(const bool enable_warm_start, const double eps_abs)
+: QPInterface(enable_warm_start)
+{
+ m_settings.eps_abs = eps_abs;
+}
+
+void ProxQPInterface::initializeProblemImpl(
+ const Eigen::MatrixXd & P, const Eigen::MatrixXd & A, const std::vector & q,
+ const std::vector & l, const std::vector & u)
+{
+ const size_t variables_num = q.size();
+ const size_t constraints_num = l.size();
+
+ const bool enable_warm_start = [&]() {
+ if (
+ !m_enable_warm_start // Warm start is designated
+ || !m_qp_ptr // QP pointer is initialized
+ // The number of variables is the same as the previous one.
+ || !m_variables_num ||
+ *m_variables_num != variables_num
+ // The number of constraints is the same as the previous one
+ || !m_constraints_num || *m_constraints_num != constraints_num) {
+ return false;
+ }
+ return true;
+ }();
+
+ if (!enable_warm_start) {
+ m_qp_ptr = std::make_shared>(
+ variables_num, 0, constraints_num);
+ }
+
+ m_settings.initial_guess =
+ enable_warm_start ? proxsuite::proxqp::InitialGuessStatus::WARM_START_WITH_PREVIOUS_RESULT
+ : proxsuite::proxqp::InitialGuessStatus::NO_INITIAL_GUESS;
+
+ m_qp_ptr->settings = m_settings;
+
+ Eigen::SparseMatrix P_sparse(variables_num, constraints_num);
+ P_sparse = P.sparseView();
+
+ // NOTE: const std vector cannot be converted to eigen vector
+ std::vector non_const_q = q;
+ Eigen::VectorXd eigen_q =
+ Eigen::Map(non_const_q.data(), non_const_q.size());
+ std::vector l_std_vec = l;
+ Eigen::VectorXd eigen_l =
+ Eigen::Map(l_std_vec.data(), l_std_vec.size());
+ std::vector u_std_vec = u;
+ Eigen::VectorXd eigen_u =
+ Eigen::Map(u_std_vec.data(), u_std_vec.size());
+
+ if (enable_warm_start) {
+ m_qp_ptr->update(
+ P_sparse, eigen_q, proxsuite::nullopt, proxsuite::nullopt, A.sparseView(), eigen_l, eigen_u);
+ } else {
+ m_qp_ptr->init(
+ P_sparse, eigen_q, proxsuite::nullopt, proxsuite::nullopt, A.sparseView(), eigen_l, eigen_u);
+ }
+}
+
+void ProxQPInterface::updateEpsAbs(const double eps_abs)
+{
+ m_settings.eps_abs = eps_abs;
+}
+
+void ProxQPInterface::updateEpsRel(const double eps_rel)
+{
+ m_settings.eps_rel = eps_rel;
+}
+
+void ProxQPInterface::updateVerbose(const bool is_verbose)
+{
+ m_settings.verbose = is_verbose;
+}
+
+int ProxQPInterface::getIteration() const
+{
+ if (m_qp_ptr) {
+ return m_qp_ptr->results.info.iter;
+ }
+ return 0;
+}
+
+int ProxQPInterface::getStatus() const
+{
+ if (m_qp_ptr) {
+ return static_cast(m_qp_ptr->results.info.status);
+ }
+ return 0;
+}
+
+std::vector ProxQPInterface::optimizeImpl()
+{
+ m_qp_ptr->solve();
+
+ std::vector result;
+ for (Eigen::Index i = 0; i < m_qp_ptr->results.x.size(); ++i) {
+ result.push_back(m_qp_ptr->results.x[i]);
+ }
+ return result;
+}
+} // namespace qp
diff --git a/common/qp_interface/src/qp_interface.cpp b/common/qp_interface/src/qp_interface.cpp
new file mode 100644
index 0000000000000..e7a69bac0c67c
--- /dev/null
+++ b/common/qp_interface/src/qp_interface.cpp
@@ -0,0 +1,70 @@
+// Copyright 2023 TIER IV, Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "qp_interface/qp_interface.hpp"
+
+#include
+#include
+#include
+
+namespace qp
+{
+void QPInterface::initializeProblem(
+ const Eigen::MatrixXd & P, const Eigen::MatrixXd & A, const std::vector & q,
+ const std::vector & l, const std::vector & u)
+{
+ // check if arguments are valid
+ std::stringstream ss;
+ if (P.rows() != P.cols()) {
+ ss << "P.rows() and P.cols() are not the same. P.rows() = " << P.rows()
+ << ", P.cols() = " << P.cols();
+ throw std::invalid_argument(ss.str());
+ }
+ if (P.rows() != static_cast(q.size())) {
+ ss << "P.rows() and q.size() are not the same. P.rows() = " << P.rows()
+ << ", q.size() = " << q.size();
+ throw std::invalid_argument(ss.str());
+ }
+ if (P.rows() != A.cols()) {
+ ss << "P.rows() and A.cols() are not the same. P.rows() = " << P.rows()
+ << ", A.cols() = " << A.cols();
+ throw std::invalid_argument(ss.str());
+ }
+ if (A.rows() != static_cast(l.size())) {
+ ss << "A.rows() and l.size() are not the same. A.rows() = " << A.rows()
+ << ", l.size() = " << l.size();
+ throw std::invalid_argument(ss.str());
+ }
+ if (A.rows() != static_cast(u.size())) {
+ ss << "A.rows() and u.size() are not the same. A.rows() = " << A.rows()
+ << ", u.size() = " << u.size();
+ throw std::invalid_argument(ss.str());
+ }
+
+ initializeProblemImpl(P, A, q, l, u);
+
+ m_variables_num = q.size();
+ m_constraints_num = l.size();
+}
+
+std::vector QPInterface::optimize(
+ const Eigen::MatrixXd & P, const Eigen::MatrixXd & A, const std::vector & q,
+ const std::vector & l, const std::vector & u)
+{
+ initializeProblem(P, A, q, l, u);
+ const auto result = optimizeImpl();
+
+ return result;
+}
+} // namespace qp
diff --git a/common/qp_interface/test/test_csc_matrix_conv.cpp b/common/qp_interface/test/test_csc_matrix_conv.cpp
new file mode 100644
index 0000000000000..fc604d762d2c4
--- /dev/null
+++ b/common/qp_interface/test/test_csc_matrix_conv.cpp
@@ -0,0 +1,181 @@
+// Copyright 2023 TIER IV, Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "gtest/gtest.h"
+#include "qp_interface/osqp_csc_matrix_conv.hpp"
+
+#include
+
+#include
+#include
+#include
+
+TEST(TestCscMatrixConv, Nominal)
+{
+ using qp::calCSCMatrix;
+ using qp::CSC_Matrix;
+
+ Eigen::MatrixXd rect1(1, 2);
+ rect1 << 0.0, 1.0;
+
+ const CSC_Matrix rect_m1 = calCSCMatrix(rect1);
+ ASSERT_EQ(rect_m1.m_vals.size(), size_t(1));
+ EXPECT_EQ(rect_m1.m_vals[0], 1.0);
+ ASSERT_EQ(rect_m1.m_row_idxs.size(), size_t(1));
+ EXPECT_EQ(rect_m1.m_row_idxs[0], c_int(0));
+ ASSERT_EQ(rect_m1.m_col_idxs.size(), size_t(3)); // nb of columns + 1
+ EXPECT_EQ(rect_m1.m_col_idxs[0], c_int(0));
+ EXPECT_EQ(rect_m1.m_col_idxs[1], c_int(0));
+ EXPECT_EQ(rect_m1.m_col_idxs[2], c_int(1));
+
+ Eigen::MatrixXd rect2(2, 4);
+ rect2 << 1.0, 0.0, 3.0, 0.0, 0.0, 6.0, 7.0, 0.0;
+
+ const CSC_Matrix rect_m2 = calCSCMatrix(rect2);
+ ASSERT_EQ(rect_m2.m_vals.size(), size_t(4));
+ EXPECT_EQ(rect_m2.m_vals[0], 1.0);
+ EXPECT_EQ(rect_m2.m_vals[1], 6.0);
+ EXPECT_EQ(rect_m2.m_vals[2], 3.0);
+ EXPECT_EQ(rect_m2.m_vals[3], 7.0);
+ ASSERT_EQ(rect_m2.m_row_idxs.size(), size_t(4));
+ EXPECT_EQ(rect_m2.m_row_idxs[0], c_int(0));
+ EXPECT_EQ(rect_m2.m_row_idxs[1], c_int(1));
+ EXPECT_EQ(rect_m2.m_row_idxs[2], c_int(0));
+ EXPECT_EQ(rect_m2.m_row_idxs[3], c_int(1));
+ ASSERT_EQ(rect_m2.m_col_idxs.size(), size_t(5)); // nb of columns + 1
+ EXPECT_EQ(rect_m2.m_col_idxs[0], c_int(0));
+ EXPECT_EQ(rect_m2.m_col_idxs[1], c_int(1));
+ EXPECT_EQ(rect_m2.m_col_idxs[2], c_int(2));
+ EXPECT_EQ(rect_m2.m_col_idxs[3], c_int(4));
+ EXPECT_EQ(rect_m2.m_col_idxs[4], c_int(4));
+
+ // Example from http://netlib.org/linalg/html_templates/node92.html
+ Eigen::MatrixXd square2(6, 6);
+ square2 << 10.0, 0.0, 0.0, 0.0, -2.0, 0.0, 3.0, 9.0, 0.0, 0.0, 0.0, 3.0, 0.0, 7.0, 8.0, 7.0, 0.0,
+ 0.0, 3.0, 0.0, 8.0, 7.0, 5.0, 0.0, 0.0, 8.0, 0.0, 9.0, 9.0, 13.0, 0.0, 4.0, 0.0, 0.0, 2.0, -1.0;
+
+ const CSC_Matrix square_m2 = calCSCMatrix(square2);
+ ASSERT_EQ(square_m2.m_vals.size(), size_t(19));
+ EXPECT_EQ(square_m2.m_vals[0], 10.0);
+ EXPECT_EQ(square_m2.m_vals[1], 3.0);
+ EXPECT_EQ(square_m2.m_vals[2], 3.0);
+ EXPECT_EQ(square_m2.m_vals[3], 9.0);
+ EXPECT_EQ(square_m2.m_vals[4], 7.0);
+ EXPECT_EQ(square_m2.m_vals[5], 8.0);
+ EXPECT_EQ(square_m2.m_vals[6], 4.0);
+ EXPECT_EQ(square_m2.m_vals[7], 8.0);
+ EXPECT_EQ(square_m2.m_vals[8], 8.0);
+ EXPECT_EQ(square_m2.m_vals[9], 7.0);
+ EXPECT_EQ(square_m2.m_vals[10], 7.0);
+ EXPECT_EQ(square_m2.m_vals[11], 9.0);
+ EXPECT_EQ(square_m2.m_vals[12], -2.0);
+ EXPECT_EQ(square_m2.m_vals[13], 5.0);
+ EXPECT_EQ(square_m2.m_vals[14], 9.0);
+ EXPECT_EQ(square_m2.m_vals[15], 2.0);
+ EXPECT_EQ(square_m2.m_vals[16], 3.0);
+ EXPECT_EQ(square_m2.m_vals[17], 13.0);
+ EXPECT_EQ(square_m2.m_vals[18], -1.0);
+ ASSERT_EQ(square_m2.m_row_idxs.size(), size_t(19));
+ EXPECT_EQ(square_m2.m_row_idxs[0], c_int(0));
+ EXPECT_EQ(square_m2.m_row_idxs[1], c_int(1));
+ EXPECT_EQ(square_m2.m_row_idxs[2], c_int(3));
+ EXPECT_EQ(square_m2.m_row_idxs[3], c_int(1));
+ EXPECT_EQ(square_m2.m_row_idxs[4], c_int(2));
+ EXPECT_EQ(square_m2.m_row_idxs[5], c_int(4));
+ EXPECT_EQ(square_m2.m_row_idxs[6], c_int(5));
+ EXPECT_EQ(square_m2.m_row_idxs[7], c_int(2));
+ EXPECT_EQ(square_m2.m_row_idxs[8], c_int(3));
+ EXPECT_EQ(square_m2.m_row_idxs[9], c_int(2));
+ EXPECT_EQ(square_m2.m_row_idxs[10], c_int(3));
+ EXPECT_EQ(square_m2.m_row_idxs[11], c_int(4));
+ EXPECT_EQ(square_m2.m_row_idxs[12], c_int(0));
+ EXPECT_EQ(square_m2.m_row_idxs[13], c_int(3));
+ EXPECT_EQ(square_m2.m_row_idxs[14], c_int(4));
+ EXPECT_EQ(square_m2.m_row_idxs[15], c_int(5));
+ EXPECT_EQ(square_m2.m_row_idxs[16], c_int(1));
+ EXPECT_EQ(square_m2.m_row_idxs[17], c_int(4));
+ EXPECT_EQ(square_m2.m_row_idxs[18], c_int(5));
+ ASSERT_EQ(square_m2.m_col_idxs.size(), size_t(7)); // nb of columns + 1
+ EXPECT_EQ(square_m2.m_col_idxs[0], c_int(0));
+ EXPECT_EQ(square_m2.m_col_idxs[1], c_int(3));
+ EXPECT_EQ(square_m2.m_col_idxs[2], c_int(7));
+ EXPECT_EQ(square_m2.m_col_idxs[3], c_int(9));
+ EXPECT_EQ(square_m2.m_col_idxs[4], c_int(12));
+ EXPECT_EQ(square_m2.m_col_idxs[5], c_int(16));
+ EXPECT_EQ(square_m2.m_col_idxs[6], c_int(19));
+}
+TEST(TestCscMatrixConv, Trapezoidal)
+{
+ using qp::calCSCMatrixTrapezoidal;
+ using qp::CSC_Matrix;
+
+ Eigen::MatrixXd square1(2, 2);
+ Eigen::MatrixXd square2(3, 3);
+ Eigen::MatrixXd rect1(1, 2);
+ square1 << 1.0, 2.0, 2.0, 4.0;
+ square2 << 0.0, 2.0, 0.0, 4.0, 5.0, 6.0, 0.0, 0.0, 0.0;
+ rect1 << 0.0, 1.0;
+
+ const CSC_Matrix square_m1 = calCSCMatrixTrapezoidal(square1);
+ // Trapezoidal: skip the lower left triangle (2.0 in this example)
+ ASSERT_EQ(square_m1.m_vals.size(), size_t(3));
+ EXPECT_EQ(square_m1.m_vals[0], 1.0);
+ EXPECT_EQ(square_m1.m_vals[1], 2.0);
+ EXPECT_EQ(square_m1.m_vals[2], 4.0);
+ ASSERT_EQ(square_m1.m_row_idxs.size(), size_t(3));
+ EXPECT_EQ(square_m1.m_row_idxs[0], c_int(0));
+ EXPECT_EQ(square_m1.m_row_idxs[1], c_int(0));
+ EXPECT_EQ(square_m1.m_row_idxs[2], c_int(1));
+ ASSERT_EQ(square_m1.m_col_idxs.size(), size_t(3));
+ EXPECT_EQ(square_m1.m_col_idxs[0], c_int(0));
+ EXPECT_EQ(square_m1.m_col_idxs[1], c_int(1));
+ EXPECT_EQ(square_m1.m_col_idxs[2], c_int(3));
+
+ const CSC_Matrix square_m2 = calCSCMatrixTrapezoidal(square2);
+ ASSERT_EQ(square_m2.m_vals.size(), size_t(3));
+ EXPECT_EQ(square_m2.m_vals[0], 2.0);
+ EXPECT_EQ(square_m2.m_vals[1], 5.0);
+ EXPECT_EQ(square_m2.m_vals[2], 6.0);
+ ASSERT_EQ(square_m2.m_row_idxs.size(), size_t(3));
+ EXPECT_EQ(square_m2.m_row_idxs[0], c_int(0));
+ EXPECT_EQ(square_m2.m_row_idxs[1], c_int(1));
+ EXPECT_EQ(square_m2.m_row_idxs[2], c_int(1));
+ ASSERT_EQ(square_m2.m_col_idxs.size(), size_t(4));
+ EXPECT_EQ(square_m2.m_col_idxs[0], c_int(0));
+ EXPECT_EQ(square_m2.m_col_idxs[1], c_int(0));
+ EXPECT_EQ(square_m2.m_col_idxs[2], c_int(2));
+ EXPECT_EQ(square_m2.m_col_idxs[3], c_int(3));
+
+ try {
+ const CSC_Matrix rect_m1 = calCSCMatrixTrapezoidal(rect1);
+ FAIL() << "calCSCMatrixTrapezoidal should fail with non-square inputs";
+ } catch (const std::invalid_argument & e) {
+ EXPECT_EQ(e.what(), std::string("Matrix must be square (n, n)"));
+ }
+}
+TEST(TestCscMatrixConv, Print)
+{
+ using qp::calCSCMatrix;
+ using qp::calCSCMatrixTrapezoidal;
+ using qp::CSC_Matrix;
+ using qp::printCSCMatrix;
+ Eigen::MatrixXd square1(2, 2);
+ Eigen::MatrixXd rect1(1, 2);
+ square1 << 1.0, 2.0, 2.0, 4.0;
+ rect1 << 0.0, 1.0;
+ const CSC_Matrix square_m1 = calCSCMatrixTrapezoidal(square1);
+ const CSC_Matrix rect_m1 = calCSCMatrix(rect1);
+ printCSCMatrix(square_m1);
+ printCSCMatrix(rect_m1);
+}
diff --git a/common/qp_interface/test/test_osqp_interface.cpp b/common/qp_interface/test/test_osqp_interface.cpp
new file mode 100644
index 0000000000000..e5d7041469289
--- /dev/null
+++ b/common/qp_interface/test/test_osqp_interface.cpp
@@ -0,0 +1,169 @@
+// Copyright 2023 TIER IV, Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "gtest/gtest.h"
+#include "qp_interface/osqp_interface.hpp"
+
+#include
+
+#include
+#include
+
+namespace
+{
+// Problem taken from https://github.com/osqp/osqp/blob/master/tests/basic_qp/generate_problem.py
+//
+// min 1/2 * x' * P * x + q' * x
+// s.t. lb <= A * x <= ub
+//
+// P = [4, 1], q = [1], A = [1, 1], lb = [ 1], ub = [1.0]
+// [1, 2] [1] [1, 0] [ 0] [0.7]
+// [0, 1] [ 0] [0.7]
+// [0, 1] [-inf] [inf]
+//
+// The optimal solution is
+// x = [0.3, 0.7]'
+// y = [-2.9, 0.0, 0.2, 0.0]`
+// obj = 1.88
+
+// cppcheck-suppress syntaxError
+TEST(TestOsqpInterface, BasicQp)
+{
+ using qp::calCSCMatrix;
+ using qp::calCSCMatrixTrapezoidal;
+ using qp::CSC_Matrix;
+
+ auto check_result = [](
+ const auto & solution, const int solution_status, const int polish_status) {
+ EXPECT_EQ(solution_status, 1);
+ EXPECT_EQ(polish_status, 1);
+
+ static const auto ep = 1.0e-8;
+
+ ASSERT_EQ(solution.size(), size_t(2));
+ EXPECT_NEAR(solution[0], 0.3, ep);
+ EXPECT_NEAR(solution[1], 0.7, ep);
+ };
+
+ const Eigen::MatrixXd P = (Eigen::MatrixXd(2, 2) << 4, 1, 1, 2).finished();
+ const Eigen::MatrixXd A = (Eigen::MatrixXd(4, 2) << 1, 1, 1, 0, 0, 1, 0, 1).finished();
+ const std::vector q = {1.0, 1.0};
+ const std::vector l = {1.0, 0.0, 0.0, -qp::INF};
+ const std::vector u = {1.0, 0.7, 0.7, qp::INF};
+
+ {
+ // Define problem during optimization
+ qp::OSQPInterface osqp(false, 1e-6);
+ const auto solution = osqp.QPInterface::optimize(P, A, q, l, u);
+ const auto solution_status = osqp.getStatus();
+ const auto polish_status = osqp.getPolishStatus();
+ check_result(solution, solution_status, polish_status);
+ }
+
+ {
+ // Define problem during initialization
+ qp::OSQPInterface osqp(false, 1e-6);
+ const auto solution = osqp.QPInterface::optimize(P, A, q, l, u);
+ const auto solution_status = osqp.getStatus();
+ const auto polish_status = osqp.getPolishStatus();
+ check_result(solution, solution_status, polish_status);
+ }
+
+ {
+ std::tuple, std::vector, int, int, int> result;
+ // Dummy initial problem
+ Eigen::MatrixXd P_ini = Eigen::MatrixXd::Zero(2, 2);
+ Eigen::MatrixXd A_ini = Eigen::MatrixXd::Zero(4, 2);
+ std::vector q_ini(2, 0.0);
+ std::vector l_ini(4, 0.0);
+ std::vector u_ini(4, 0.0);
+ qp::OSQPInterface osqp(false, 1e-6);
+ osqp.QPInterface::optimize(P_ini, A_ini, q_ini, l_ini, u_ini);
+ }
+
+ {
+ // Define problem during initialization with csc matrix
+ CSC_Matrix P_csc = calCSCMatrixTrapezoidal(P);
+ CSC_Matrix A_csc = calCSCMatrix(A);
+ qp::OSQPInterface osqp(false, 1e-6);
+
+ const auto solution = osqp.optimize(P_csc, A_csc, q, l, u);
+ const auto solution_status = osqp.getStatus();
+ const auto polish_status = osqp.getPolishStatus();
+ check_result(solution, solution_status, polish_status);
+ }
+
+ {
+ std::tuple, std::vector, int, int, int> result;
+ // Dummy initial problem with csc matrix
+ CSC_Matrix P_ini_csc = calCSCMatrixTrapezoidal(Eigen::MatrixXd::Zero(2, 2));
+ CSC_Matrix A_ini_csc = calCSCMatrix(Eigen::MatrixXd::Zero(4, 2));
+ std::vector q_ini(2, 0.0);
+ std::vector l_ini(4, 0.0);
+ std::vector u_ini(4, 0.0);
+ qp::OSQPInterface osqp(false, 1e-6);
+ osqp.optimize(P_ini_csc, A_ini_csc, q_ini, l_ini, u_ini);
+
+ // Redefine problem before optimization
+ CSC_Matrix P_csc = calCSCMatrixTrapezoidal(P);
+ CSC_Matrix A_csc = calCSCMatrix(A);
+
+ const auto solution = osqp.optimize(P_csc, A_csc, q, l, u);
+ const auto solution_status = osqp.getStatus();
+ const auto polish_status = osqp.getPolishStatus();
+ check_result(solution, solution_status, polish_status);
+ }
+
+ // add warm startup
+ {
+ // Dummy initial problem with csc matrix
+ CSC_Matrix P_ini_csc = calCSCMatrixTrapezoidal(Eigen::MatrixXd::Zero(2, 2));
+ CSC_Matrix A_ini_csc = calCSCMatrix(Eigen::MatrixXd::Zero(4, 2));
+ std::vector q_ini(2, 0.0);
+ std::vector l_ini(4, 0.0);
+ std::vector u_ini(4, 0.0);
+ qp::OSQPInterface osqp(true, 1e-6); // enable warm start
+ osqp.optimize(P_ini_csc, A_ini_csc, q_ini, l_ini, u_ini);
+
+ // Redefine problem before optimization
+ CSC_Matrix P_csc = calCSCMatrixTrapezoidal(P);
+ CSC_Matrix A_csc = calCSCMatrix(A);
+ {
+ const auto solution = osqp.optimize(P_csc, A_csc, q, l, u);
+ const auto solution_status = osqp.getStatus();
+ const auto polish_status = osqp.getPolishStatus();
+ check_result(solution, solution_status, polish_status);
+
+ osqp.updateCheckTermination(1);
+ const auto primal_val = solution;
+ const auto dual_val = osqp.getDualSolution();
+ for (size_t i = 0; i < primal_val.size(); ++i) {
+ std::cerr << primal_val.at(i) << std::endl;
+ }
+ osqp.setWarmStart(primal_val, dual_val);
+ }
+
+ {
+ const auto solution = osqp.optimize(P_csc, A_csc, q, l, u);
+ const auto solution_status = osqp.getStatus();
+ const auto polish_status = osqp.getPolishStatus();
+ check_result(solution, solution_status, polish_status);
+ }
+
+ // NOTE: This should be true, but currently optimize function reset the workspace, which
+ // disables warm start.
+ // EXPECT_EQ(osqp.getTakenIter(), 1);
+ }
+}
+} // namespace
diff --git a/common/qp_interface/test/test_proxqp_interface.cpp b/common/qp_interface/test/test_proxqp_interface.cpp
new file mode 100644
index 0000000000000..96466665d5172
--- /dev/null
+++ b/common/qp_interface/test/test_proxqp_interface.cpp
@@ -0,0 +1,79 @@
+// Copyright 2023 TIER IV, Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#include "gtest/gtest.h"
+#include "qp_interface/proxqp_interface.hpp"
+
+#include
+
+#include
+#include
+
+namespace
+{
+// Problem taken from
+// https://github.com/proxqp/proxqp/blob/master/tests/basic_qp/generate_problem.py
+//
+// min 1/2 * x' * P * x + q' * x
+// s.t. lb <= A * x <= ub
+//
+// P = [4, 1], q = [1], A = [1, 1], lb = [ 1], ub = [1.0]
+// [1, 2] [1] [1, 0] [ 0] [0.7]
+// [0, 1] [ 0] [0.7]
+// [0, 1] [-inf] [inf]
+//
+// The optimal solution is
+// x = [0.3, 0.7]'
+// y = [-2.9, 0.0, 0.2, 0.0]`
+// obj = 1.88
+
+// cppcheck-suppress syntaxError
+TEST(TestProxqpInterface, BasicQp)
+{
+ auto check_result = [](const auto & solution) {
+ static const auto ep = 1.0e-8;
+ ASSERT_EQ(solution.size(), size_t(2));
+ EXPECT_NEAR(solution[0], 0.3, ep);
+ EXPECT_NEAR(solution[1], 0.7, ep);
+ };
+
+ const Eigen::MatrixXd P = (Eigen::MatrixXd(2, 2) << 4, 1, 1, 2).finished();
+ const Eigen::MatrixXd A = (Eigen::MatrixXd(4, 2) << 1, 1, 1, 0, 0, 1, 0, 1).finished();
+ const std::vector q = {1.0, 1.0};
+ const std::vector l = {1.0, 0.0, 0.0, -std::numeric_limits::max()};
+ const std::vector u = {1.0, 0.7, 0.7, std::numeric_limits::max()};
+
+ {
+ // Define problem during optimization
+ qp::ProxQPInterface proxqp(false, 1e-9);
+ const auto solution = proxqp.QPInterface::optimize(P, A, q, l, u);
+ check_result(solution);
+ }
+
+ {
+ // Define problem during optimization with warm start
+ qp::ProxQPInterface proxqp(true, 1e-9);
+ {
+ const auto solution = proxqp.QPInterface::optimize(P, A, q, l, u);
+ check_result(solution);
+ EXPECT_NE(proxqp.getIteration(), 1);
+ }
+ {
+ const auto solution = proxqp.QPInterface::optimize(P, A, q, l, u);
+ check_result(solution);
+ EXPECT_EQ(proxqp.getIteration(), 0);
+ }
+ }
+}
+} // namespace
diff --git a/common/rtc_manager_rviz_plugin/package.xml b/common/rtc_manager_rviz_plugin/package.xml
index 6987e63c3c6ee..53f00386bdb4d 100644
--- a/common/rtc_manager_rviz_plugin/package.xml
+++ b/common/rtc_manager_rviz_plugin/package.xml
@@ -10,8 +10,7 @@
Apache License 2.0
ament_cmake_auto
-
- autoware_cmake
+ autoware_cmake
libqt5-core
libqt5-gui
diff --git a/common/rtc_manager_rviz_plugin/src/rtc_manager_panel.cpp b/common/rtc_manager_rviz_plugin/src/rtc_manager_panel.cpp
index 3f6724e64f1f2..5e795ae764092 100644
--- a/common/rtc_manager_rviz_plugin/src/rtc_manager_panel.cpp
+++ b/common/rtc_manager_rviz_plugin/src/rtc_manager_panel.cpp
@@ -63,8 +63,8 @@ std::string getModuleName(const uint8_t module_type)
case Module::AVOIDANCE_RIGHT: {
return "avoidance_right";
}
- case Module::PULL_OVER: {
- return "pull_over";
+ case Module::GOAL_PLANNER: {
+ return "goal_planner";
}
case Module::PULL_OUT: {
return "pull_out";
@@ -90,6 +90,9 @@ std::string getModuleName(const uint8_t module_type)
case Module::OCCLUSION_SPOT: {
return "occlusion_spot";
}
+ case Module::INTERSECTION_OCCLUSION: {
+ return "intersection_occlusion";
+ }
}
return "NONE";
}
@@ -102,7 +105,7 @@ bool isPathChangeModule(const uint8_t module_type)
module_type == Module::EXT_REQUEST_LANE_CHANGE_RIGHT ||
module_type == Module::AVOIDANCE_BY_LC_LEFT || module_type == Module::AVOIDANCE_BY_LC_RIGHT ||
module_type == Module::AVOIDANCE_LEFT || module_type == Module::AVOIDANCE_RIGHT ||
- module_type == Module::PULL_OVER || module_type == Module::PULL_OUT) {
+ module_type == Module::GOAL_PLANNER || module_type == Module::PULL_OUT) {
return true;
}
return false;
@@ -111,7 +114,7 @@ bool isPathChangeModule(const uint8_t module_type)
RTCManagerPanel::RTCManagerPanel(QWidget * parent) : rviz_common::Panel(parent)
{
// TODO(tanaka): replace this magic number to Module::SIZE
- const size_t module_size = 18;
+ const size_t module_size = 19;
auto_modes_.reserve(module_size);
auto * v_layout = new QVBoxLayout;
auto vertical_header = new QHeaderView(Qt::Vertical);
@@ -451,6 +454,7 @@ void RTCManagerPanel::onRTCStatus(const CooperateStatusArray::ConstSharedPtr msg
}
cnt++;
}
+ rtc_table_->update();
}
} // namespace rviz_plugins
diff --git a/common/signal_processing/include/signal_processing/lowpass_filter_1d.hpp b/common/signal_processing/include/signal_processing/lowpass_filter_1d.hpp
index 67d32a7739349..bef0a99f38403 100644
--- a/common/signal_processing/include/signal_processing/lowpass_filter_1d.hpp
+++ b/common/signal_processing/include/signal_processing/lowpass_filter_1d.hpp
@@ -17,6 +17,11 @@
#include
+namespace signal_processing
+{
+double lowpassFilter(const double current_val, const double prev_val, const double gain);
+}
+
/**
* @class First-order low-pass filter
* @brief filtering values
diff --git a/common/signal_processing/package.xml b/common/signal_processing/package.xml
index 042471134da0e..2412f916dbd15 100644
--- a/common/signal_processing/package.xml
+++ b/common/signal_processing/package.xml
@@ -5,15 +5,18 @@
0.1.0
The signal processing package
Takayuki Murooka
+ Takamasa Horibe
+ Fumiya Watanabe
+ Kyoichi Sugahara
Ali Boyali
Apache License 2.0
Takayuki Murooka
Ali BOYALI
- autoware_cmake
- libboost-dev
ament_cmake_auto
+ autoware_cmake
+ libboost-dev
geometry_msgs
rclcpp
libboost-dev
diff --git a/common/signal_processing/src/lowpass_filter_1d.cpp b/common/signal_processing/src/lowpass_filter_1d.cpp
index 8142d907e5c2c..ce85d276d4a70 100644
--- a/common/signal_processing/src/lowpass_filter_1d.cpp
+++ b/common/signal_processing/src/lowpass_filter_1d.cpp
@@ -14,6 +14,14 @@
#include "signal_processing/lowpass_filter_1d.hpp"
+namespace signal_processing
+{
+double lowpassFilter(const double current_val, const double prev_val, const double gain)
+{
+ return gain * prev_val + (1.0 - gain) * current_val;
+}
+} // namespace signal_processing
+
LowpassFilter1d::LowpassFilter1d(const double gain) : gain_(gain)
{
}
diff --git a/common/tensorrt_common/CMakeLists.txt b/common/tensorrt_common/CMakeLists.txt
index 36071c9ae14f8..cb24448f1a993 100644
--- a/common/tensorrt_common/CMakeLists.txt
+++ b/common/tensorrt_common/CMakeLists.txt
@@ -18,6 +18,7 @@ endif()
add_library(${PROJECT_NAME} SHARED
src/tensorrt_common.cpp
+ src/simple_profiler.cpp
)
target_link_libraries(${PROJECT_NAME}
diff --git a/common/tensorrt_common/include/tensorrt_common/logger.hpp b/common/tensorrt_common/include/tensorrt_common/logger.hpp
new file mode 100644
index 0000000000000..98fe18794998d
--- /dev/null
+++ b/common/tensorrt_common/include/tensorrt_common/logger.hpp
@@ -0,0 +1,503 @@
+/*
+ * Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef TENSORRT_COMMON__LOGGER_HPP_
+#define TENSORRT_COMMON__LOGGER_HPP_
+
+#include "NvInferRuntimeCommon.h"
+
+#include
+#include
+#include