From 9d7f3bce8c07d970e7350fecc5bdcd565bb9918f Mon Sep 17 00:00:00 2001 From: Ryohsuke Mitsudome Date: Tue, 25 Mar 2025 11:56:50 +0900 Subject: [PATCH] feat(autoware_stop_filter)!: port package to Autoware Core Signed-off-by: Ryohsuke Mitsudome --- .../autoware_stop_filter/CHANGELOG.rst | 86 ------------------- .../autoware_stop_filter/CMakeLists.txt | 22 ----- localization/autoware_stop_filter/README.md | 28 ------ .../config/stop_filter.param.yaml | 4 - .../launch/stop_filter.launch.xml | 14 --- localization/autoware_stop_filter/package.xml | 34 -------- .../schema/stop_filter.schema.json | 40 --------- .../autoware_stop_filter/src/stop_filter.cpp | 64 -------------- .../autoware_stop_filter/src/stop_filter.hpp | 60 ------------- 9 files changed, 352 deletions(-) delete mode 100644 localization/autoware_stop_filter/CHANGELOG.rst delete mode 100644 localization/autoware_stop_filter/CMakeLists.txt delete mode 100644 localization/autoware_stop_filter/README.md delete mode 100644 localization/autoware_stop_filter/config/stop_filter.param.yaml delete mode 100644 localization/autoware_stop_filter/launch/stop_filter.launch.xml delete mode 100644 localization/autoware_stop_filter/package.xml delete mode 100644 localization/autoware_stop_filter/schema/stop_filter.schema.json delete mode 100644 localization/autoware_stop_filter/src/stop_filter.cpp delete mode 100644 localization/autoware_stop_filter/src/stop_filter.hpp diff --git a/localization/autoware_stop_filter/CHANGELOG.rst b/localization/autoware_stop_filter/CHANGELOG.rst deleted file mode 100644 index 203050501a5e4..0000000000000 --- a/localization/autoware_stop_filter/CHANGELOG.rst +++ /dev/null @@ -1,86 +0,0 @@ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Changelog for package autoware_stop_filter -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -0.43.0 (2025-03-21) -------------------- -* Merge remote-tracking branch 'origin/main' into chore/bump-version-0.43 -* chore: rename from `autoware.universe` to `autoware_universe` (`#10306 `_) -* Contributors: Hayato Mizushima, Yutaka Kondo - -0.42.0 (2025-03-03) -------------------- - -0.41.2 (2025-02-19) -------------------- -* chore: bump version to 0.41.1 (`#10088 `_) -* Contributors: Ryohsuke Mitsudome - -0.41.1 (2025-02-10) -------------------- - -0.41.0 (2025-01-29) -------------------- -* Merge remote-tracking branch 'origin/main' into tmp/bot/bump_version_base -* feat: tier4_debug_msgs to autoware_internal_debug_msgs in files localization/autoware_stop_filter (`#9867 `_) - Co-authored-by: SakodaShintaro -* fix(autoware_stop_filter): fix bugprone-reserved-identifier (`#9643 `_) - * fix: bugprone-reserved-identifier - * fix: fmt - --------- -* Contributors: Fumiya Watanabe, Vishal Chauhan, kobayu858 - -0.40.0 (2024-12-12) -------------------- -* Revert "chore(package.xml): bump version to 0.39.0 (`#9587 `_)" - This reverts commit c9f0f2688c57b0f657f5c1f28f036a970682e7f5. -* fix: fix ticket links in CHANGELOG.rst (`#9588 `_) -* chore(package.xml): bump version to 0.39.0 (`#9587 `_) - * chore(package.xml): bump version to 0.39.0 - * fix: fix ticket links in CHANGELOG.rst - * fix: remove unnecessary diff - --------- - Co-authored-by: Yutaka Kondo -* fix: fix ticket links in CHANGELOG.rst (`#9588 `_) -* 0.39.0 -* update changelog -* fix: fix ticket links to point to https://github.com/autowarefoundation/autoware_universe (`#9304 `_) -* fix: fix ticket links to point to https://github.com/autowarefoundation/autoware_universe (`#9304 `_) -* chore(package.xml): bump version to 0.38.0 (`#9266 `_) (`#9284 `_) - * unify package.xml version to 0.37.0 - * remove system_monitor/CHANGELOG.rst - * add changelog - * 0.38.0 - --------- -* Contributors: Esteve Fernandez, Fumiya Watanabe, Ryohsuke Mitsudome, Yutaka Kondo - -0.39.0 (2024-11-25) -------------------- -* fix: fix ticket links to point to https://github.com/autowarefoundation/autoware_universe (`#9304 `_) -* fix: fix ticket links to point to https://github.com/autowarefoundation/autoware_universe (`#9304 `_) -* chore(package.xml): bump version to 0.38.0 (`#9266 `_) (`#9284 `_) - * unify package.xml version to 0.37.0 - * remove system_monitor/CHANGELOG.rst - * add changelog - * 0.38.0 - --------- -* Contributors: Esteve Fernandez, Yutaka Kondo - -0.38.0 (2024-11-08) -------------------- -* unify package.xml version to 0.37.0 -* fix(docs): autoware stop filter docs (`#8302 `_) - fix autoware stop filter docs -* fix(autoware_stop_filter): fix funcArgNamesDifferent (`#8008 `_) - fix:funcArgNamesDifferent -* chore(localization, map): remove maintainer (`#7940 `_) -* fix(stop_filter): fix plugin name (`#7820 `_) - Fixed plugin name -* refactor(stop_filter): prefix package and namespace with autoware (`#7789 `_) - * refactor(stop_filter): prefix package and namespace with autoware - * fix launch files and update CODEOWNERS - --------- -* Contributors: Esteve Fernandez, SakodaShintaro, Yutaka Kondo, Yuxuan Liu, kminoda, kobayu858 - -0.26.0 (2024-04-03) -------------------- diff --git a/localization/autoware_stop_filter/CMakeLists.txt b/localization/autoware_stop_filter/CMakeLists.txt deleted file mode 100644 index 96123e89c5050..0000000000000 --- a/localization/autoware_stop_filter/CMakeLists.txt +++ /dev/null @@ -1,22 +0,0 @@ -cmake_minimum_required(VERSION 3.14) -project(autoware_stop_filter) - -find_package(autoware_cmake REQUIRED) -autoware_package() - -ament_auto_add_library(${PROJECT_NAME} SHARED - src/stop_filter.cpp - src/stop_filter.hpp -) - -rclcpp_components_register_node(${PROJECT_NAME} - PLUGIN "autoware::stop_filter::StopFilter" - EXECUTABLE ${PROJECT_NAME}_node - EXECUTOR SingleThreadedExecutor -) - -ament_auto_package( - INSTALL_TO_SHARE - launch - config -) diff --git a/localization/autoware_stop_filter/README.md b/localization/autoware_stop_filter/README.md deleted file mode 100644 index 9136f6b6fc8a0..0000000000000 --- a/localization/autoware_stop_filter/README.md +++ /dev/null @@ -1,28 +0,0 @@ -# stop_filter - -## Purpose - -When this function did not exist, each node used a different criterion to determine whether the vehicle is stopping or not, resulting that some nodes were in operation of stopping the vehicle and some nodes continued running in the drive mode. -This node aims to: - -- apply a uniform stopping decision criterion to several nodes. -- suppress the control noise by overwriting the velocity and angular velocity with zero. - -## Inputs / Outputs - -### Input - -| Name | Type | Description | -| ------------ | ------------------------- | --------------------- | -| `input/odom` | `nav_msgs::msg::Odometry` | localization odometry | - -### Output - -| Name | Type | Description | -| ----------------- | ------------------------------------------------ | -------------------------------------------------------- | -| `output/odom` | `nav_msgs::msg::Odometry` | odometry with suppressed longitudinal and yaw twist | -| `debug/stop_flag` | `autoware_internal_debug_msgs::msg::BoolStamped` | flag to represent whether the vehicle is stopping or not | - -## Parameters - -{{ json_to_markdown("localization/autoware_stop_filter/schema/stop_filter.schema.json") }} diff --git a/localization/autoware_stop_filter/config/stop_filter.param.yaml b/localization/autoware_stop_filter/config/stop_filter.param.yaml deleted file mode 100644 index ded090b75b5bd..0000000000000 --- a/localization/autoware_stop_filter/config/stop_filter.param.yaml +++ /dev/null @@ -1,4 +0,0 @@ -/**: - ros__parameters: - vx_threshold: 0.1 # [m/s] - wz_threshold: 0.02 # [rad/s] diff --git a/localization/autoware_stop_filter/launch/stop_filter.launch.xml b/localization/autoware_stop_filter/launch/stop_filter.launch.xml deleted file mode 100644 index ff7b6cafe6e8f..0000000000000 --- a/localization/autoware_stop_filter/launch/stop_filter.launch.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/localization/autoware_stop_filter/package.xml b/localization/autoware_stop_filter/package.xml deleted file mode 100644 index beb854b40c54e..0000000000000 --- a/localization/autoware_stop_filter/package.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - autoware_stop_filter - 0.43.0 - The stop filter package - Yamato Ando - Masahiro Sakamoto - Kento Yabuuchi - NGUYEN Viet Anh - Taiki Yamada - Shintaro Sakoda - Ryu Yamamoto - Apache License 2.0 - Koji Minoda - - ament_cmake_auto - autoware_cmake - - autoware_internal_debug_msgs - geometry_msgs - nav_msgs - rclcpp - rclcpp_components - tf2 - - ament_cmake_ros - ament_lint_auto - autoware_lint_common - - - ament_cmake - - diff --git a/localization/autoware_stop_filter/schema/stop_filter.schema.json b/localization/autoware_stop_filter/schema/stop_filter.schema.json deleted file mode 100644 index ce6d4b8a2bb72..0000000000000 --- a/localization/autoware_stop_filter/schema/stop_filter.schema.json +++ /dev/null @@ -1,40 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "Parameters for Stop Filter Node", - "type": "object", - "definitions": { - "stop_filter": { - "type": "object", - "properties": { - "vx_threshold": { - "type": "number", - "description": "Longitudinal velocity threshold to determine if the vehicle is stopping. [m/s]", - "default": "0.01", - "minimum": 0.0 - }, - "wz_threshold": { - "type": "number", - "description": "Yaw velocity threshold to determine if the vehicle is stopping. [rad/s]", - "default": "0.01", - "minimum": 0.0 - } - }, - "required": ["vx_threshold", "wz_threshold"], - "additionalProperties": false - } - }, - "properties": { - "/**": { - "type": "object", - "properties": { - "ros__parameters": { - "$ref": "#/definitions/stop_filter" - } - }, - "required": ["ros__parameters"], - "additionalProperties": false - } - }, - "required": ["/**"], - "additionalProperties": false -} diff --git a/localization/autoware_stop_filter/src/stop_filter.cpp b/localization/autoware_stop_filter/src/stop_filter.cpp deleted file mode 100644 index b0f1bc8eba053..0000000000000 --- a/localization/autoware_stop_filter/src/stop_filter.cpp +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright 2021 TierIV -// -// 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 "stop_filter.hpp" - -#include - -#include -#include -#include -#include -#include - -namespace autoware::stop_filter -{ -StopFilter::StopFilter(const rclcpp::NodeOptions & node_options) -: rclcpp::Node("stop_filter", node_options) -{ - vx_threshold_ = declare_parameter("vx_threshold"); - wz_threshold_ = declare_parameter("wz_threshold"); - - sub_odom_ = create_subscription( - "input/odom", 1, std::bind(&StopFilter::callback_odometry, this, std::placeholders::_1)); - - pub_odom_ = create_publisher("output/odom", 1); - pub_stop_flag_ = - create_publisher("debug/stop_flag", 1); -} - -void StopFilter::callback_odometry(const nav_msgs::msg::Odometry::SharedPtr msg) -{ - autoware_internal_debug_msgs::msg::BoolStamped stop_flag_msg; - stop_flag_msg.stamp = msg->header.stamp; - stop_flag_msg.data = false; - - nav_msgs::msg::Odometry odom_msg; - odom_msg = *msg; - - if ( - std::fabs(msg->twist.twist.linear.x) < vx_threshold_ && - std::fabs(msg->twist.twist.angular.z) < wz_threshold_) { - odom_msg.twist.twist.linear.x = 0.0; - odom_msg.twist.twist.angular.z = 0.0; - stop_flag_msg.data = true; - } - - pub_stop_flag_->publish(stop_flag_msg); - pub_odom_->publish(odom_msg); -} -} // namespace autoware::stop_filter - -#include -RCLCPP_COMPONENTS_REGISTER_NODE(autoware::stop_filter::StopFilter) diff --git a/localization/autoware_stop_filter/src/stop_filter.hpp b/localization/autoware_stop_filter/src/stop_filter.hpp deleted file mode 100644 index 71864fab0a580..0000000000000 --- a/localization/autoware_stop_filter/src/stop_filter.hpp +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright 2021 TierIV -// -// 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 STOP_FILTER_HPP_ -#define STOP_FILTER_HPP_ - -#include - -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -namespace autoware::stop_filter -{ -class StopFilter : public rclcpp::Node -{ -public: - explicit StopFilter(const rclcpp::NodeOptions & node_options); - -private: - rclcpp::Publisher::SharedPtr pub_odom_; //!< @brief odom publisher - rclcpp::Publisher::SharedPtr - pub_stop_flag_; //!< @brief stop flag publisher - rclcpp::Subscription::SharedPtr - sub_odom_; //!< @brief measurement odometry subscriber - - double vx_threshold_; //!< @brief vx threshold - double wz_threshold_; //!< @brief wz threshold - - /** - * @brief set odometry measurement - */ - void callback_odometry(const nav_msgs::msg::Odometry::SharedPtr msg); -}; -} // namespace autoware::stop_filter -#endif // STOP_FILTER_HPP_