feat(trajectory_modifier): add obstacle stop feature to trajectory modifier#12338
feat(trajectory_modifier): add obstacle stop feature to trajectory modifier#12338mkquda wants to merge 7 commits intoautowarefoundation:mainfrom
Conversation
* refactor trajectory_modifier node applies following refactors to the trajectory_modifier node: - Use ros2 plugin framework to load submodules - Use generate_parameter_library to create parameter struct from schema on build - Use ParamListener to handle initial param loading and online param updates Signed-off-by: Mohammad <alqudah.mohammad@tier4.jp> * remove unnecessary launch-prefix tag * modify param schema Signed-off-by: Mohammad <alqudah.mohammad@tier4.jp> * style(pre-commit): autofix --------- Signed-off-by: Mohammad <alqudah.mohammad@tier4.jp> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* refactor trajectory_modifier node applies following refactors to the trajectory_modifier node: - Use ros2 plugin framework to load submodules - Use generate_parameter_library to create parameter struct from schema on build - Use ParamListener to handle initial param loading and online param updates Signed-off-by: Mohammad <alqudah.mohammad@tier4.jp> * remove unnecessary launch-prefix tag * add obstacle stop plugin framework > - add obstacle stop parameters > - add obstacle stop plugin > - update package.xml, plugins.xml, and CMakeLists.txt > - add obstacle stop utils > - implement pointcloud filtering and clustering logic - implement object filtering logic - refactor TrajectoryModifierData struct Signed-off-by: Mohammad <alqudah.mohammad@tier4.jp> * implement collision check and stop point logic - add function to generate trajectory polygon from footprints - add function to get nearest pcd collision point - add function to get nearest object collision point - add logic to track detected collision points for hysterisis - add logic to insert stop point Signed-off-by: Mohammad <alqudah.mohammad@tier4.jp> * fix minimum rule base planner code Signed-off-by: Mohammad <alqudah.mohammad@tier4.jp> * implement stop point logic - add function to calculate stop point index and modify trajectory - don't use hysterisis logic (on/off time buffers) - check for plugin name string instead of using isClassLoaded() Signed-off-by: Mohammad <alqudah.mohammad@tier4.jp> * implement smooth stopping logic - compute stopping trajectory from jerk and accel limits, assuming highest initial velocity - use skima spline trajectory interpolator to generate stopping trajectory - use a constant dt to compute s for each interpolated point Signed-off-by: Mohammad <alqudah.mohammad@tier4.jp> * add debug data and markers Signed-off-by: Mohammad <alqudah.mohammad@tier4.jp> * use motion_utils::calculate_stop_distance function Signed-off-by: Mohammad <alqudah.mohammad@tier4.jp> * pre-commit fix Signed-off-by: Mohammad <alqudah.mohammad@tier4.jp> * don't skip entire trajectory modification for missing pcd or predicted objects, disble stop point setting Signed-off-by: Mohammad <alqudah.mohammad@tier4.jp> --------- Signed-off-by: Mohammad <alqudah.mohammad@tier4.jp>
check for null ptr Signed-off-by: Mohammad Alqudah <alqudah.mohammad@tier4.jp>
…ior (#2770) * improve logic for generating stopping trajectory Signed-off-by: Mohammad <alqudah.mohammad@tier4.jp> * log name of plugins that modified trajectory Signed-off-by: Mohammad <alqudah.mohammad@tier4.jp> --------- Signed-off-by: Mohammad <alqudah.mohammad@tier4.jp>
Signed-off-by: Mohammad Alqudah <alqudah.mohammad@tier4.jp>
|
Thank you for contributing to the Autoware project! 🚧 If your pull request is in progress, switch it to draft mode. Please ensure:
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #12338 +/- ##
==========================================
+ Coverage 18.54% 18.60% +0.06%
==========================================
Files 1851 1858 +7
Lines 127991 128587 +596
Branches 45588 45780 +192
==========================================
+ Hits 23738 23928 +190
- Misses 84559 85128 +569
+ Partials 19694 19531 -163
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR refactors autoware_trajectory_modifier into a plugin-based architecture (pluginlib) with generated parameter handling, and adds a new ObstacleStop modifier plugin that detects collisions (pointcloud + predicted objects) and modifies trajectories to stop before obstacles.
Changes:
- Refactor trajectory modifier node to load modifier submodules via pluginlib and handle parameters via generate_parameter_library (
ParamListener). - Add
ObstacleStopplugin + supporting utilities for pointcloud/object filtering, collision detection, and stop-trajectory generation. - Update configuration, launch, and tests to match new plugin + parameter structure and new utils header paths.
Reviewed changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 16 comments.
Show a summary per file
| File | Description |
|---|---|
| planning/autoware_trajectory_modifier/src/trajectory_modifier.cpp | Switch node to ParamListener + pluginlib loading; update callback flow |
| planning/autoware_trajectory_modifier/include/autoware/trajectory_modifier/trajectory_modifier.hpp | Update node interface, plugin loader, and subscribers for new inputs |
| planning/autoware_trajectory_modifier/include/autoware/trajectory_modifier/trajectory_modifier_plugins/trajectory_modifier_plugin_base.hpp | Redefine plugin base API for pluginlib + shared data + param updates |
| planning/autoware_trajectory_modifier/src/trajectory_modifier_plugins/obstacle_stop.cpp | Implement obstacle collision checks and stop/velocity modification |
| planning/autoware_trajectory_modifier/include/autoware/trajectory_modifier/trajectory_modifier_plugins/obstacle_stop.hpp | Declare ObstacleStop plugin interface and debug publishing |
| planning/autoware_trajectory_modifier/src/trajectory_modifier_utils/obstacle_stop_utils.cpp | Add geometry/pointcloud/object utility functions for obstacle stop |
| planning/autoware_trajectory_modifier/include/autoware/trajectory_modifier/trajectory_modifier_utils/obstacle_stop_utils.hpp | Add public utility declarations and shared structs for obstacle stop |
| planning/autoware_trajectory_modifier/src/trajectory_modifier_plugins/stop_point_fixer.cpp | Adapt StopPointFixer to new plugin base API and planning factor publication |
| planning/autoware_trajectory_modifier/include/autoware/trajectory_modifier/trajectory_modifier_plugins/stop_point_fixer.hpp | Update StopPointFixer interface to new plugin base API |
| planning/autoware_trajectory_modifier/include/autoware/trajectory_modifier/trajectory_modifier_structs.hpp | Expand shared data to include vehicle info, TF, objects, pointcloud |
| planning/autoware_trajectory_modifier/param/trajectory_modifier_parameter_struct.yaml | Define generate_parameter_library schema for node + plugins |
| planning/autoware_trajectory_modifier/schema/trajectory_modifier.schema.json | Extend JSON schema to include obstacle_stop parameters |
| planning/autoware_trajectory_modifier/config/trajectory_modifier.param.yaml | Add obstacle_stop parameters and top-level flags |
| planning/autoware_trajectory_modifier/launch/trajectory_modifier.launch.xml | Add module selection + new input remaps (objects/pointcloud) |
| planning/autoware_trajectory_modifier/plugins.xml | Register pluginlib classes for StopPointFixer and ObstacleStop |
| planning/autoware_trajectory_modifier/CMakeLists.txt | Split libs (core/utils/plugins), export pluginlib XML, generate params |
| planning/autoware_trajectory_modifier/package.xml | Add dependencies needed for plugins/params/trajectory tools |
| planning/autoware_trajectory_modifier/src/trajectory_modifier_utils/utils.cpp | Update include path for utils header |
| planning/autoware_trajectory_modifier/include/autoware/trajectory_modifier/trajectory_modifier_utils/utils.hpp | Move/rename include guard for new utils header location |
| planning/autoware_trajectory_modifier/tests/test_utils.cpp | Update include path for utils header |
| planning/autoware_trajectory_modifier/tests/test_stop_point_fixer_integration.cpp | Update tests to new plugin init + generated params pattern |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| #include <pcl/registration/gicp.h> | ||
| #include <pcl/segmentation/extract_clusters.h> | ||
| #include <pcl/surface/convex_hull.h> | ||
| #include <pcl_conversions/pcl_conversions.h> |
| bool ObstacleStop::modify_trajectory(TrajectoryPoints & traj_points) | ||
| { | ||
| if (!enabled_ || !is_trajectory_modification_required(traj_points)) return false; | ||
|
|
||
| if (!nearest_collision_point_) return false; | ||
|
|
||
| RCLCPP_WARN_THROTTLE( | ||
| get_node_ptr()->get_logger(), *get_clock(), 500, | ||
| "[TM ObstacleStop] Detected collision point at arc length %f m", | ||
| nearest_collision_point_->arc_length); | ||
|
|
||
| return set_stop_point(traj_points); | ||
| } |
| geometry_msgs::msg::TransformStamped transform_stamped; | ||
| try { | ||
| transform_stamped = data_->tf_buffer.lookupTransform( | ||
| "map", pointcloud->header.frame_id, pointcloud->header.stamp, | ||
| rclcpp::Duration::from_seconds(0.1)); | ||
| } catch (tf2::TransformException & e) { | ||
| RCLCPP_WARN(get_node_ptr()->get_logger(), "no transform found for pointcloud: %s", e.what()); | ||
| } | ||
|
|
||
| Eigen::Affine3f isometry = tf2::transformToEigen(transform_stamped.transform).cast<float>(); | ||
| autoware_utils::transform_pointcloud(*filtered_pointcloud, *filtered_pointcloud, isometry); | ||
| } |
| struct CollisionPoint | ||
| { | ||
| geometry_msgs::msg::Point point; | ||
| double arc_length; | ||
| rclcpp::Time start_time; | ||
| bool is_active{false}; |
| name_ = std::invoke([&name]() { | ||
| const auto npos = name.find_last_of(':'); | ||
| return npos != std::string::npos ? name.substr(npos + 1) : name; | ||
| }); |
|
|
||
| bool ObstacleStop::is_trajectory_modification_required(const TrajectoryPoints & traj_points) | ||
| { | ||
| debug_data_ = DebugData(); |
| "description": "Nominal deceleration during stopping [m/s^2]", | ||
| "default": -2.0 | ||
| }, | ||
| "nom_stopping_jerk": { | ||
| "type": "number", | ||
| "description": "Nominal jerk during stopping [m/s^3]", | ||
| "default": -3.0 | ||
| }, | ||
| "max_stopping_decel": { | ||
| "type": "number", | ||
| "description": "Maximum deceleration during stopping [m/s^2]", | ||
| "default": -4.0 | ||
| }, | ||
| "max_stopping_jerk": { | ||
| "type": "number", | ||
| "description": "Maximum jerk during stopping [m/s^3]", | ||
| "default": -8.0 | ||
| }, | ||
| "on_time_buffer": { |
| const auto collision_point_pcd = check_pointcloud(traj_points, debug_data_.trajectory_polygon); | ||
| const auto collision_point_objects = | ||
| check_predicted_objects(traj_points, debug_data_.trajectory_polygon); |
| autoware_utils_geometry::MultiPolygon2d get_trajectory_polygon( | ||
| const TrajectoryPoints & trajectory_points, const geometry_msgs::msg::Pose & ego_pose, | ||
| const autoware::vehicle_info_utils::VehicleInfo & vehicle_info, const double lateral_margin, | ||
| const double longitudinal_margin) | ||
| { | ||
| const auto offset_pose = | ||
| autoware_utils::calc_offset_pose(ego_pose, vehicle_info.max_longitudinal_offset_m, 0, 0); | ||
| auto start_idx = motion_utils::findNearestSegmentIndex(trajectory_points, offset_pose.position); | ||
| const auto forward_traj_points = | ||
| TrajectoryPoints(trajectory_points.begin() + start_idx, trajectory_points.end()); | ||
|
|
| const std::vector<ObjectType> object_types = std::invoke([&]() { | ||
| std::vector<ObjectType> object_types; | ||
| object_types.reserve(object_type_strings.size()); | ||
| for (const auto & object_type_string : object_type_strings) { | ||
| object_types.push_back(string_to_object_type.at(object_type_string)); | ||
| } | ||
| return object_types; |
| @@ -39,10 +44,13 @@ TrajectoryModifier::TrajectoryModifier(const rclcpp::NodeOptions & options) | |||
|
|
|||
| time_keeper_ = std::make_shared<autoware_utils_debug::TimeKeeper>(); | |||
There was a problem hiding this comment.
this needs to be initialized with a publisher, otherwise the runtime topic is not published.
danielsanchezaran
left a comment
There was a problem hiding this comment.
@mkquda there seems to be a strange issue with parameter loading, this is how rqt reconfigure looks:
Also it seems that all options to reconfigure the stop point fixer disappeared? OSS trajectory_modifier can be reconfigured online, but this PR seems to remove that option?
Also I think Copilot and @maxime-clem made some good remarks, can you please check?
|
@mkquda can you please add some video examples of your feature working? The new plugin should also be reflected in the documentation (README) or please make a new docs/ directory with .md files for the different plugins |
danielsanchezaran
left a comment
There was a problem hiding this comment.
The stop walls are great additions, but I noticed a flickering for the obstacle stop wall:
cap-.2026-03-19-11-10-15.mp4
could you please investigate? @mkquda
danielsanchezaran
left a comment
There was a problem hiding this comment.
The plugin loading method used by this PR does not really align with how the autoware_trajectory_optimizer loads its plugins, as the optimizer receives the plugin names from the param file and not directly in the launch file. I think it is better to do it how the optimizer does and have a separate enable flag to enable /disable plugins online
danielsanchezaran
left a comment
There was a problem hiding this comment.
Please add some unit tests for the ObstableStop modifier plugin and / or its utils
There was a problem hiding this comment.
Pull request overview
This PR refactors autoware_trajectory_modifier into a pluginlib-based architecture with generated parameter structs, and adds a new ObstacleStop plugin that detects collisions (pointcloud + predicted objects) and modifies trajectories to stop before obstacles.
Changes:
- Refactor
TrajectoryModifierto load modifier plugins viapluginliband update parameters viagenerate_parameter_library+ParamListener. - Add
ObstacleStopplugin + supporting utilities for collision detection and stop/velocity-profile generation. - Update configs/launch/tests/includes to match the new module + utils structure.
Reviewed changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| planning/autoware_trajectory_modifier/src/trajectory_modifier.cpp | Loads plugins from launch_modules, updates params via ParamListener, and runs plugins over candidate trajectories. |
| planning/autoware_trajectory_modifier/include/autoware/trajectory_modifier/trajectory_modifier.hpp | Updates node members for pluginlib + generated params + extra subscriptions. |
| planning/autoware_trajectory_modifier/include/autoware/trajectory_modifier/trajectory_modifier_plugins/trajectory_modifier_plugin_base.hpp | Changes plugin API to initialize()/update_params()/modify_trajectory() and adds planning factor + debug hooks. |
| planning/autoware_trajectory_modifier/src/trajectory_modifier_plugins/stop_point_fixer.cpp | Migrates StopPointFixer to the new plugin base interface and planning factor publishing. |
| planning/autoware_trajectory_modifier/include/autoware/trajectory_modifier/trajectory_modifier_plugins/stop_point_fixer.hpp | Updates StopPointFixer interface for the new plugin API and generated params. |
| planning/autoware_trajectory_modifier/src/trajectory_modifier_plugins/obstacle_stop.cpp | Implements obstacle collision checks and trajectory stopping behavior with debug outputs. |
| planning/autoware_trajectory_modifier/include/autoware/trajectory_modifier/trajectory_modifier_plugins/obstacle_stop.hpp | Declares ObstacleStop plugin interface and debug publishers. |
| planning/autoware_trajectory_modifier/src/trajectory_modifier_utils/obstacle_stop_utils.cpp | Adds pointcloud filtering/clustering and object filtering + collision point selection helpers. |
| planning/autoware_trajectory_modifier/include/autoware/trajectory_modifier/trajectory_modifier_utils/obstacle_stop_utils.hpp | Declares ObstacleStop helper types/APIs. |
| planning/autoware_trajectory_modifier/src/trajectory_modifier_utils/utils.cpp | Updates include path for shared trajectory modifier utilities. |
| planning/autoware_trajectory_modifier/include/autoware/trajectory_modifier/trajectory_modifier_utils/utils.hpp | Renames include guard to match new header path. |
| planning/autoware_trajectory_modifier/include/autoware/trajectory_modifier/trajectory_modifier_structs.hpp | Extends shared data container with vehicle info, TF, predicted objects, and pointcloud. |
| planning/autoware_trajectory_modifier/plugins.xml | Registers StopPointFixer and ObstacleStop as pluginlib classes. |
| planning/autoware_trajectory_modifier/CMakeLists.txt | Adds generated param library, splits libs into core/utils/plugins, exports plugin description. |
| planning/autoware_trajectory_modifier/package.xml | Adds dependencies for pluginlib + parameter generation + obstacle stop implementation. |
| planning/autoware_trajectory_modifier/launch/trajectory_modifier.launch.xml | Adds module selection + object/pointcloud remaps and constructs launch_modules list. |
| planning/autoware_trajectory_modifier/config/trajectory_modifier.param.yaml | Adds obstacle_stop parameters and new top-level parameters. |
| planning/autoware_trajectory_modifier/schema/trajectory_modifier.schema.json | Extends parameter schema for obstacle stop and new top-level flags. |
| planning/autoware_trajectory_modifier/param/trajectory_modifier_parameter_struct.yaml | New parameter-struct definition used by generate_parameter_library. |
| planning/autoware_trajectory_modifier/tests/test_stop_point_fixer_integration.cpp | Updates integration test to new plugin init + generated params and node options. |
| planning/autoware_trajectory_modifier/tests/test_utils.cpp | Updates utils header include path. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| #include <autoware_utils_geometry/boost_geometry.hpp> | ||
| #include <autoware_vehicle_info_utils/vehicle_info.hpp> | ||
|
|
||
| #include <autoware_perception_msgs/msg/predicted_objects.hpp> | ||
| #include <autoware_planning_msgs/msg/trajectory.hpp> | ||
| #include <autoware_planning_msgs/msg/trajectory_point.hpp> | ||
| #include <sensor_msgs/msg/point_cloud2.hpp> | ||
|
|
||
| #include <pcl/point_cloud.h> | ||
| #include <pcl/point_types.h> | ||
| #include <pcl_conversions/pcl_conversions.h> | ||
|
|
||
| #include <string> | ||
| #include <unordered_map> | ||
| #include <vector> | ||
|
|
||
| namespace autoware::trajectory_modifier::utils::obstacle_stop | ||
| { | ||
| using sensor_msgs::msg::PointCloud2; | ||
| using PointCloud = pcl::PointCloud<pcl::PointXYZ>; | ||
| using autoware_perception_msgs::msg::ObjectClassification; | ||
| using autoware_perception_msgs::msg::PredictedObjects; | ||
| using autoware_planning_msgs::msg::TrajectoryPoint; | ||
| using TrajectoryPoints = std::vector<TrajectoryPoint>; | ||
|
|
||
| enum class ObjectType : uint8_t { | ||
| UNKNOWN = 0, | ||
| CAR, | ||
| TRUCK, | ||
| BUS, | ||
| TRAILER, | ||
| MOTORCYCLE, | ||
| BICYCLE, | ||
| PEDESTRIAN | ||
| }; | ||
|
|
||
| inline static const std::unordered_map<std::string, ObjectType> string_to_object_type = { | ||
| {"unknown", ObjectType::UNKNOWN}, {"car", ObjectType::CAR}, | ||
| {"truck", ObjectType::TRUCK}, {"bus", ObjectType::BUS}, | ||
| {"trailer", ObjectType::TRAILER}, {"motorcycle", ObjectType::MOTORCYCLE}, | ||
| {"bicycle", ObjectType::BICYCLE}, {"pedestrian", ObjectType::PEDESTRIAN}}; | ||
|
|
||
| inline static const std::unordered_map<uint8_t, ObjectType> classification_to_object_type = { | ||
| {ObjectClassification::UNKNOWN, ObjectType::UNKNOWN}, | ||
| {ObjectClassification::CAR, ObjectType::CAR}, | ||
| {ObjectClassification::TRUCK, ObjectType::TRUCK}, | ||
| {ObjectClassification::BUS, ObjectType::BUS}, | ||
| {ObjectClassification::TRAILER, ObjectType::TRAILER}, | ||
| {ObjectClassification::MOTORCYCLE, ObjectType::MOTORCYCLE}, | ||
| {ObjectClassification::BICYCLE, ObjectType::BICYCLE}, | ||
| {ObjectClassification::PEDESTRIAN, ObjectType::PEDESTRIAN}}; | ||
|
|
||
| struct CollisionPoint | ||
| { | ||
| geometry_msgs::msg::Point point; | ||
| double arc_length; | ||
| rclcpp::Time start_time; | ||
| bool is_active{false}; | ||
|
|
||
| CollisionPoint(const geometry_msgs::msg::Point & point, const double arc_length) | ||
| : point(point), arc_length(arc_length) | ||
| { | ||
| } | ||
|
|
||
| CollisionPoint( | ||
| const CollisionPoint & collision_point, const rclcpp::Time & start_time, const bool active) | ||
| : point(collision_point.point), | ||
| arc_length(collision_point.arc_length), | ||
| start_time(start_time), | ||
| is_active(active) | ||
| { | ||
| } | ||
| }; | ||
|
|
||
| struct DebugData | ||
| { | ||
| PointCloud2::SharedPtr cluster_points; | ||
| PointCloud2::SharedPtr voxel_points; | ||
| PointCloud2::SharedPtr target_pcd_points; | ||
| std::vector<autoware_utils_geometry::Polygon2d> target_polygons; | ||
| autoware_utils_geometry::MultiPolygon2d trajectory_polygon; | ||
| std::vector<geometry_msgs::msg::Point> target_collision_points; | ||
| geometry_msgs::msg::Point active_collision_point; | ||
| }; | ||
|
|
||
| autoware_utils_geometry::MultiPolygon2d get_trajectory_polygon( | ||
| const TrajectoryPoints & trajectory_points, const geometry_msgs::msg::Pose & ego_pose, | ||
| const autoware::vehicle_info_utils::VehicleInfo & vehicle_info, const double lateral_margin = 0.0, | ||
| const double longitudinal_margin = 0.0); |
| "nom_stopping_decel": { | ||
| "type": "number", | ||
| "description": "Nominal deceleration during stopping [m/s^2]", | ||
| "default": -2.0 | ||
| }, | ||
| "nom_stopping_jerk": { | ||
| "type": "number", | ||
| "description": "Nominal jerk during stopping [m/s^3]", | ||
| "default": -3.0 | ||
| }, | ||
| "max_stopping_decel": { | ||
| "type": "number", | ||
| "description": "Maximum deceleration during stopping [m/s^2]", | ||
| "default": -4.0 | ||
| }, | ||
| "max_stopping_jerk": { | ||
| "type": "number", | ||
| "description": "Maximum jerk during stopping [m/s^3]", | ||
| "default": -8.0 | ||
| }, | ||
| "on_time_buffer": { | ||
| "type": "number", | ||
| "description": "Duration an obstacle must be detected before stopping [s]", | ||
| "default": 0.5, | ||
| "minimum": 0.0 | ||
| }, | ||
| "off_time_buffer": { | ||
| "type": "number", | ||
| "description": "Duration an obstacle must be detected before stopping [s]", | ||
| "default": 1.0, | ||
| "minimum": 0.0 | ||
| }, |
| bool ObstacleStop::modify_trajectory(TrajectoryPoints & traj_points) | ||
| { | ||
| if (!enabled_ || !is_trajectory_modification_required(traj_points)) return false; | ||
|
|
||
| if (!nearest_collision_point_) return false; | ||
|
|
||
| RCLCPP_WARN_THROTTLE( | ||
| get_node_ptr()->get_logger(), *get_clock(), 500, | ||
| "[TM ObstacleStop] Detected collision point at arc length %f m", | ||
| nearest_collision_point_->arc_length); | ||
|
|
||
| if (!params_.enable_stop) return false; | ||
|
|
||
| return set_stop_point(traj_points); | ||
| } |
| geometry_msgs::msg::TransformStamped transform_stamped; | ||
| try { | ||
| transform_stamped = data_->tf_buffer.lookupTransform( | ||
| "map", pointcloud->header.frame_id, pointcloud->header.stamp, | ||
| rclcpp::Duration::from_seconds(0.1)); | ||
| } catch (tf2::TransformException & e) { | ||
| RCLCPP_WARN(get_node_ptr()->get_logger(), "no transform found for pointcloud: %s", e.what()); | ||
| } | ||
|
|
||
| Eigen::Affine3f isometry = tf2::transformToEigen(transform_stamped.transform).cast<float>(); | ||
| autoware_utils::transform_pointcloud(*filtered_pointcloud, *filtered_pointcloud, isometry); |
| Marker marker = autoware_utils::create_default_marker( | ||
| "map", get_clock()->now(), ns, id, Marker::LINE_LIST, | ||
| autoware_utils::create_marker_scale(0.1, 0.1, 0.1), color); | ||
| marker.lifetime = rclcpp::Duration::from_seconds(0.2); | ||
|
|
||
| for (const auto & p : polygon.outer()) { | ||
| marker.points.push_back(autoware_utils_geometry::create_point(p.x(), p.y(), ego_z)); | ||
| } | ||
| if (!marker.points.empty()) { | ||
| marker.points.push_back(marker.points.front()); | ||
| } | ||
| marker_array.markers.push_back(marker); |
| // Check if the plugin is already instantiated | ||
| auto it = std::find_if( | ||
| plugins_.begin(), plugins_.end(), [&](const auto & p) { return p->get_name() == name; }); | ||
| if (it != plugins_.end()) { | ||
| RCLCPP_WARN( | ||
| this->get_logger(), "The plugin '%s' is already in the plugins list.", name.c_str()); | ||
| return; |
| std::vector<ObjectType> object_types; | ||
| object_types.reserve(object_type_strings.size()); | ||
| for (const auto & object_type_string : object_type_strings) { | ||
| object_types.push_back(string_to_object_type.at(object_type_string)); |
| default_value: false | ||
| description: Enable the use of stop point fixer | ||
| read_only: false | ||
| use_obstacle_stop: | ||
| type: bool | ||
| default_value: false |
|
|
||
| bool ObstacleStop::is_trajectory_modification_required(const TrajectoryPoints & traj_points) | ||
| { | ||
| debug_data_ = DebugData(); |
| #include "autoware/trajectory_modifier/trajectory_modifier_structs.hpp" | ||
|
|
||
| #include <autoware_trajectory_modifier/trajectory_modifier_param.hpp> | ||
| #include <autoware_utils/ros/polling_subscriber.hpp> |
Description
This PR implements the
obstacle_stopplugin withinautoware_trajectory_modifiernode.Changes
Refactor trajectory_modifier to:
Implement obstacle checking logic:
Implement stopping behavior:
Related links
Parent Issue:
How was this PR tested?
562676997-6e0294f3-0e4d-44ee-8858-8e8bc473d4b8.webm
Notes for reviewers
None.
Interface changes
ROS Parameter Changes
use_obstacle_stopbooltruetrajectory_time_stepdouble0.1obstacle_stop.use_objectsbooltrueobstacle_stop.use_pointcloudbooltrueobstacle_stop.stop_margindouble6.0obstacle_stop.nom_stopping_deceldouble1.0obstacle_stop.max_stopping_deceldouble4.0obstacle_stop.stopping_jerkdouble3.0obstacle_stop.lateral_margin_mdouble0.5obstacle_stop.objectsN/AN/Aobstacle_stop.pointcloudN/AN/AEffects on system behavior
If diffusion planner trajectory causes collision with obstacle, trajectory modifier will adjust trajectory to stop ego.