From d5d998ea41a888cfa948be9b9bbbf00b4421d297 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20=C3=81ngel=20Gonz=C3=A1lez=20Santamarta?= Date: Mon, 4 Nov 2024 10:40:53 +0100 Subject: [PATCH] fixing C++ comments --- .../include/yasmin_ros/action_state.hpp | 45 ++++++++++--------- .../include/yasmin_ros/basic_outcomes.hpp | 2 +- .../include/yasmin_ros/monitor_state.hpp | 1 + .../include/yasmin_ros/service_state.hpp | 6 ++- yasmin_ros/include/yasmin_ros/yasmin_node.hpp | 7 +-- .../yasmin_viewer/yasmin_viewer_pub.hpp | 17 ++++--- 6 files changed, 44 insertions(+), 34 deletions(-) diff --git a/yasmin_ros/include/yasmin_ros/action_state.hpp b/yasmin_ros/include/yasmin_ros/action_state.hpp index 51ebb20..4e74e64 100644 --- a/yasmin_ros/include/yasmin_ros/action_state.hpp +++ b/yasmin_ros/include/yasmin_ros/action_state.hpp @@ -44,29 +44,30 @@ namespace yasmin_ros { * @tparam ActionT The type of the action this state will interface with. */ template class ActionState : public yasmin::State { - using Goal = typename ActionT::Goal; ///< Alias for the action goal type. - using Result = typename ActionT::Result::SharedPtr; ///< Alias for the action - ///< result type. - using Feedback = - typename ActionT::Feedback; ///< Alias for the action feedback type. - - using SendGoalOptions = typename rclcpp_action::Client< - ActionT>::SendGoalOptions; ///< Options for sending goals. - using ActionClient = typename rclcpp_action::Client< - ActionT>::SharedPtr; ///< Shared pointer type for the action client. - using GoalHandle = - rclcpp_action::ClientGoalHandle; ///< Handle for the action goal. - - using CreateGoalHandler = std::function)>; ///< Function type for - ///< creating a goal. + /// Alias for the action goal type. + using Goal = typename ActionT::Goal; + /// Alias for the action result type. + using Result = typename ActionT::Result::SharedPtr; + + /// Alias for the action feedback type. + using Feedback = typename ActionT::Feedback; + /// Options for sending goals. + using SendGoalOptions = + typename rclcpp_action::Client::SendGoalOptions; + /// Shared pointer type for the action client. + using ActionClient = typename rclcpp_action::Client::SharedPtr; + /// Handle for the action goal. + using GoalHandle = rclcpp_action::ClientGoalHandle; + /// Function type for creating a goal. + using CreateGoalHandler = + std::function)>; + /// Function type for handling results. using ResultHandler = std::function, - Result)>; ///< Function type for handling results. - using FeedbackHandler = std::function, - std::shared_ptr)>; ///< Function type for handling - ///< feedback. + std::shared_ptr, Result)>; + /// Function type for handling feedback. + using FeedbackHandler = + std::function, + std::shared_ptr)>; public: /** diff --git a/yasmin_ros/include/yasmin_ros/basic_outcomes.hpp b/yasmin_ros/include/yasmin_ros/basic_outcomes.hpp index 5bbfb5b..dc91247 100644 --- a/yasmin_ros/include/yasmin_ros/basic_outcomes.hpp +++ b/yasmin_ros/include/yasmin_ros/basic_outcomes.hpp @@ -22,7 +22,7 @@ namespace yasmin_ros { /** * @namespace yasmin_ros::basic_outcomes - * @brief Provides common outcome constants for ROS 2 actions. + * @brief Provides common outcome constants for ROS 2. * * The basic_outcomes namespace defines constants for common action outcomes * within the yasmin_ros framework. These constants represent the status of diff --git a/yasmin_ros/include/yasmin_ros/monitor_state.hpp b/yasmin_ros/include/yasmin_ros/monitor_state.hpp index 82a4b28..acf88fa 100644 --- a/yasmin_ros/include/yasmin_ros/monitor_state.hpp +++ b/yasmin_ros/include/yasmin_ros/monitor_state.hpp @@ -45,6 +45,7 @@ namespace yasmin_ros { */ template class MonitorState : public yasmin::State { + /// Function type for handling messages from topic. using MonitorHandler = std::function, std::shared_ptr)>; diff --git a/yasmin_ros/include/yasmin_ros/service_state.hpp b/yasmin_ros/include/yasmin_ros/service_state.hpp index 23f29fa..c20f9cb 100644 --- a/yasmin_ros/include/yasmin_ros/service_state.hpp +++ b/yasmin_ros/include/yasmin_ros/service_state.hpp @@ -40,11 +40,15 @@ namespace yasmin_ros { * @tparam ServiceT The type of the ROS 2 service this state interacts with. */ template class ServiceState : public yasmin::State { - + /// Alias for the service request type. using Request = typename ServiceT::Request::SharedPtr; + /// Alias for the service response type. using Response = typename ServiceT::Response::SharedPtr; + + /// Function type for creating a request. using CreateRequestHandler = std::function)>; + /// Function type for handling a response. using ResponseHandler = std::function, Response)>; diff --git a/yasmin_ros/include/yasmin_ros/yasmin_node.hpp b/yasmin_ros/include/yasmin_ros/yasmin_node.hpp index f7807b5..9ec17a6 100644 --- a/yasmin_ros/include/yasmin_ros/yasmin_node.hpp +++ b/yasmin_ros/include/yasmin_ros/yasmin_node.hpp @@ -77,9 +77,10 @@ class YasminNode : public rclcpp::Node { } private: - rclcpp::executors::MultiThreadedExecutor - executor; ///< Executor for managing multiple threads. - std::unique_ptr spin_thread; ///< Thread for spinning the node. + /// Executor for managing multiple threads. + rclcpp::executors::MultiThreadedExecutor executor; + /// Thread for spinning the node. + std::unique_ptr spin_thread; }; } // namespace yasmin_ros diff --git a/yasmin_viewer/include/yasmin_viewer/yasmin_viewer_pub.hpp b/yasmin_viewer/include/yasmin_viewer/yasmin_viewer_pub.hpp index 3f79de4..7858f3c 100644 --- a/yasmin_viewer/include/yasmin_viewer/yasmin_viewer_pub.hpp +++ b/yasmin_viewer/include/yasmin_viewer/yasmin_viewer_pub.hpp @@ -89,14 +89,17 @@ class YasminViewerPub { void publish_data(); private: - rclcpp::Node::SharedPtr node_; ///< Shared pointer to the ROS 2 node. - rclcpp::Publisher::SharedPtr - publisher; ///< Publisher for StateMachine messages. - rclcpp::TimerBase::SharedPtr timer; ///< Timer for periodic publishing. + /// Shared pointer to the ROS 2 node. + rclcpp::Node::SharedPtr node_; + /// Publisher for StateMachine messages. + rclcpp::Publisher::SharedPtr publisher; + /// Timer for periodic publishing. + rclcpp::TimerBase::SharedPtr timer; - std::string fsm_name; ///< Name of the finite state machine. - std::shared_ptr - fsm; ///< Shared pointer to the state machine. + /// Name of the finite state machine. + std::string fsm_name; + /// Shared pointer to the state machine. + std::shared_ptr fsm; }; } // namespace yasmin_viewer