Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(stop_filter): componentize StopFilter #7099

Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions localization/stop_filter/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,16 @@ project(stop_filter)
find_package(autoware_cmake REQUIRED)
autoware_package()

ament_auto_add_executable(stop_filter
src/stop_filter_node.cpp
ament_auto_add_library(${PROJECT_NAME} SHARED
src/stop_filter.cpp
)

rclcpp_components_register_node(${PROJECT_NAME}
PLUGIN "StopFilter"
EXECUTABLE ${PROJECT_NAME}_node
EXECUTOR SingleThreadedExecutor
)

ament_target_dependencies(stop_filter)

ament_auto_package(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
class StopFilter : public rclcpp::Node
{
public:
StopFilter(const std::string & node_name, const rclcpp::NodeOptions & options);
explicit StopFilter(const rclcpp::NodeOptions & options);

private:
rclcpp::Publisher<nav_msgs::msg::Odometry>::SharedPtr pub_odom_; //!< @brief odom publisher
Expand Down
2 changes: 1 addition & 1 deletion localization/stop_filter/launch/stop_filter.launch.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<arg name="input_odom_name" default="ekf_odom"/>
<arg name="output_odom_name" default="stop_filter_odom"/>
<arg name="debug_stop_flag" default="debug/stop_flag"/>
<node pkg="stop_filter" exec="stop_filter" name="stop_filter" output="screen">
<node pkg="stop_filter" exec="stop_filter_node" output="screen">
<remap from="input/odom" to="$(var input_odom_name)"/>

<remap from="output/odom" to="$(var output_odom_name)"/>
Expand Down
1 change: 1 addition & 0 deletions localization/stop_filter/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
<depend>geometry_msgs</depend>
<depend>nav_msgs</depend>
<depend>rclcpp</depend>
<depend>rclcpp_components</depend>
<depend>tf2</depend>
<depend>tier4_debug_msgs</depend>

Expand Down
7 changes: 5 additions & 2 deletions localization/stop_filter/src/stop_filter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@

using std::placeholders::_1;

StopFilter::StopFilter(const std::string & node_name, const rclcpp::NodeOptions & node_options)
: rclcpp::Node(node_name, node_options)
StopFilter::StopFilter(const rclcpp::NodeOptions & node_options)
: rclcpp::Node("stop_filter", node_options)
{
vx_threshold_ = declare_parameter<double>("vx_threshold");
wz_threshold_ = declare_parameter<double>("wz_threshold");
Expand Down Expand Up @@ -57,3 +57,6 @@ void StopFilter::callbackOdometry(const nav_msgs::msg::Odometry::SharedPtr msg)
pub_stop_flag_->publish(stop_flag_msg);
pub_odom_->publish(odom_msg);
}

#include <rclcpp_components/register_node_macro.hpp>
RCLCPP_COMPONENTS_REGISTER_NODE(StopFilter)
28 changes: 0 additions & 28 deletions localization/stop_filter/src/stop_filter_node.cpp

This file was deleted.

Loading