From 891f9c7af1c6134ee311ac35e5e8008a892e0b70 Mon Sep 17 00:00:00 2001 From: tanaka3 Date: Fri, 24 Dec 2021 12:49:54 +0900 Subject: [PATCH] fix: order to create callback Signed-off-by: tanaka3 --- localization/pose2twist/src/pose2twist_core.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/localization/pose2twist/src/pose2twist_core.cpp b/localization/pose2twist/src/pose2twist_core.cpp index 00109ac37b9d9..9eeb5f359695d 100644 --- a/localization/pose2twist/src/pose2twist_core.cpp +++ b/localization/pose2twist/src/pose2twist_core.cpp @@ -28,13 +28,13 @@ Pose2Twist::Pose2Twist() : Node("pose2twist_core") rclcpp::QoS durable_qos(queue_size); durable_qos.transient_local(); - pose_sub_ = create_subscription( - "pose", queue_size, std::bind(&Pose2Twist::callbackPose, this, _1)); - twist_pub_ = create_publisher("twist", durable_qos); linear_x_pub_ = create_publisher("linear_x", durable_qos); angular_z_pub_ = create_publisher("angular_z", durable_qos); + // Note: this callback publishes topics above + pose_sub_ = create_subscription( + "pose", queue_size, std::bind(&Pose2Twist::callbackPose, this, _1)); } double calcDiffForRadian(const double lhs_rad, const double rhs_rad)