From 126eddcaf612c1a6348b77928f0a83fcf7727e63 Mon Sep 17 00:00:00 2001 From: Murilo Marinho Date: Thu, 24 Sep 2026 18:03:44 +0100 Subject: [PATCH] Remove 'using namespace rclcpp' usings; qualify rclcpp types in public headers RobotKinematicsClient/Server public headers no longer leak 'using namespace rclcpp;'. Node/Subscription/Publisher are qualified with rclcpp:: in the headers and companion sources. 'using namespace DQ_robotics;' is kept (per project policy). This PR was created by an AI agent (OpenHands) on behalf of the repository owner. --- .../sas_robot_kinematics_client.hpp | 13 ++++++------- .../sas_robot_kinematics_server.hpp | 13 ++++++------- src/sas_robot_kinematics_client.cpp | 2 +- src/sas_robot_kinematics_server.cpp | 2 +- 4 files changed, 14 insertions(+), 16 deletions(-) diff --git a/include/sas_robot_kinematics/sas_robot_kinematics_client.hpp b/include/sas_robot_kinematics/sas_robot_kinematics_client.hpp index 1f62d17..b564370 100644 --- a/include/sas_robot_kinematics/sas_robot_kinematics_client.hpp +++ b/include/sas_robot_kinematics/sas_robot_kinematics_client.hpp @@ -32,7 +32,6 @@ #include #include -using namespace rclcpp; using namespace DQ_robotics; namespace sas @@ -49,18 +48,18 @@ namespace sas class RobotKinematicsClient: private sas::Object { private: - std::shared_ptr node_; + std::shared_ptr node_; std::atomic_bool enabled_; const std::string topic_prefix_; - Subscription::SharedPtr subscriber_pose_; + rclcpp::Subscription::SharedPtr subscriber_pose_; DQ pose_; - Subscription::SharedPtr subscriber_reference_frame_; + rclcpp::Subscription::SharedPtr subscriber_reference_frame_; DQ reference_frame_; - Publisher::SharedPtr publisher_desired_pose_; - Publisher::SharedPtr publisher_desired_interpolator_speed_; + rclcpp::Publisher::SharedPtr publisher_desired_pose_; + rclcpp::Publisher::SharedPtr publisher_desired_interpolator_speed_; void _callback_pose(const geometry_msgs::msg::PoseStamped& msg); void _callback_reference_frame(const geometry_msgs::msg::PoseStamped& msg); @@ -79,7 +78,7 @@ class RobotKinematicsClient: private sas::Object * @param topic_prefix Topic name prefix used for subscriptions and * publications. */ - RobotKinematicsClient(const std::shared_ptr &node, const std::string& topic_prefix); + RobotKinematicsClient(const std::shared_ptr &node, const std::string& topic_prefix); /** * @brief Check whether the client is enabled (subscribers/publishers active). diff --git a/include/sas_robot_kinematics/sas_robot_kinematics_server.hpp b/include/sas_robot_kinematics/sas_robot_kinematics_server.hpp index 5aaf81a..bebf89b 100644 --- a/include/sas_robot_kinematics/sas_robot_kinematics_server.hpp +++ b/include/sas_robot_kinematics/sas_robot_kinematics_server.hpp @@ -32,7 +32,6 @@ #include #include -using namespace rclcpp; using namespace DQ_robotics; namespace sas @@ -48,17 +47,17 @@ namespace sas class RobotKinematicsServer: private sas::Object { protected: - std::shared_ptr node_; + std::shared_ptr node_; std::atomic_bool enabled_; const std::string topic_prefix_; - Publisher::SharedPtr publisher_pose_; - Publisher::SharedPtr publisher_reference_frame_; + rclcpp::Publisher::SharedPtr publisher_pose_; + rclcpp::Publisher::SharedPtr publisher_reference_frame_; - Subscription::SharedPtr subscriber_desired_pose_; + rclcpp::Subscription::SharedPtr subscriber_desired_pose_; DQ desired_pose_; - Subscription::SharedPtr subscriber_desired_interpolator_speed_; + rclcpp::Subscription::SharedPtr subscriber_desired_interpolator_speed_; double desired_interpolator_speed_; void _callback_desired_pose(const geometry_msgs::msg::PoseStamped& msg); @@ -79,7 +78,7 @@ class RobotKinematicsServer: private sas::Object * @param topic_prefix Topic name prefix used for subscriptions and * publications. */ - RobotKinematicsServer(const std::shared_ptr& node, const std::string& topic_prefix); + RobotKinematicsServer(const std::shared_ptr& node, const std::string& topic_prefix); /** * @brief Get the most recently received desired pose. diff --git a/src/sas_robot_kinematics_client.cpp b/src/sas_robot_kinematics_client.cpp index e61d818..554f466 100644 --- a/src/sas_robot_kinematics_client.cpp +++ b/src/sas_robot_kinematics_client.cpp @@ -53,7 +53,7 @@ void RobotKinematicsClient::_callback_reference_frame(const geometry_msgs::msg:: //} //#endif -RobotKinematicsClient::RobotKinematicsClient(const std::shared_ptr &node, const std::string &topic_prefix): +RobotKinematicsClient::RobotKinematicsClient(const std::shared_ptr &node, const std::string &topic_prefix): sas::Object("RobotKinematicsClient"), node_(node), enabled_(false), diff --git a/src/sas_robot_kinematics_server.cpp b/src/sas_robot_kinematics_server.cpp index 3be1045..20ca8ed 100644 --- a/src/sas_robot_kinematics_server.cpp +++ b/src/sas_robot_kinematics_server.cpp @@ -47,7 +47,7 @@ void RobotKinematicsServer::_callback_desired_interpolator_speed(const sas_msgs: //} //#endif -RobotKinematicsServer::RobotKinematicsServer(const std::shared_ptr &node, const std::string &topic_prefix): +RobotKinematicsServer::RobotKinematicsServer(const std::shared_ptr &node, const std::string &topic_prefix): sas::Object("RobotKinematicsServer"), node_(node), enabled_(false),