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(pose2twist): componentize Pose2Twist #7113

Merged
Show file tree
Hide file tree
Changes from all 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
9 changes: 7 additions & 2 deletions localization/pose2twist/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,16 @@ project(pose2twist)
find_package(autoware_cmake REQUIRED)
autoware_package()

ament_auto_add_executable(pose2twist
src/pose2twist_node.cpp
ament_auto_add_library(${PROJECT_NAME} SHARED
src/pose2twist_core.cpp
)

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

ament_auto_package(
INSTALL_TO_SHARE
launch
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
class Pose2Twist : public rclcpp::Node
{
public:
Pose2Twist();
explicit Pose2Twist(const rclcpp::NodeOptions & options);
~Pose2Twist() = default;

private:
Expand Down
2 changes: 1 addition & 1 deletion localization/pose2twist/launch/pose2twist.launch.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<arg name="input_pose_topic" default="/localization/pose_estimator/pose" description=""/>
<arg name="output_twist_topic" default="/estimate_twist" description=""/>

<node pkg="pose2twist" exec="pose2twist" name="pose2twist" output="log">
<node pkg="pose2twist" exec="pose2twist_node" output="both">
<remap from="pose" to="$(var input_pose_topic)"/>
<remap from="twist" to="$(var output_twist_topic)"/>
</node>
Expand Down
1 change: 1 addition & 0 deletions localization/pose2twist/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

<depend>geometry_msgs</depend>
<depend>rclcpp</depend>
<depend>rclcpp_components</depend>
<depend>tf2_geometry_msgs</depend>
<depend>tier4_debug_msgs</depend>

Expand Down
5 changes: 4 additions & 1 deletion localization/pose2twist/src/pose2twist_core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <cstddef>
#include <functional>

Pose2Twist::Pose2Twist() : Node("pose2twist_core")
Pose2Twist::Pose2Twist(const rclcpp::NodeOptions & options) : rclcpp::Node("pose2twist", options)
{
using std::placeholders::_1;

Expand Down Expand Up @@ -129,3 +129,6 @@ void Pose2Twist::callbackPose(geometry_msgs::msg::PoseStamped::SharedPtr pose_ms
angular_z_msg.data = twist_msg.twist.angular.z;
angular_z_pub_->publish(angular_z_msg);
}

#include <rclcpp_components/register_node_macro.hpp>
RCLCPP_COMPONENTS_REGISTER_NODE(Pose2Twist)
29 changes: 0 additions & 29 deletions localization/pose2twist/src/pose2twist_node.cpp

This file was deleted.

Loading