Skip to content

Commit

Permalink
fixing C++ comments
Browse files Browse the repository at this point in the history
  • Loading branch information
mgonzs13 committed Nov 4, 2024
1 parent 862394e commit d5d998e
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 34 deletions.
45 changes: 23 additions & 22 deletions yasmin_ros/include/yasmin_ros/action_state.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,29 +44,30 @@ namespace yasmin_ros {
* @tparam ActionT The type of the action this state will interface with.
*/
template <typename ActionT> 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<ActionT>; ///< Handle for the action goal.

using CreateGoalHandler = std::function<Goal(
std::shared_ptr<yasmin::blackboard::Blackboard>)>; ///< 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<ActionT>::SendGoalOptions;
/// Shared pointer type for the action client.
using ActionClient = typename rclcpp_action::Client<ActionT>::SharedPtr;
/// Handle for the action goal.
using GoalHandle = rclcpp_action::ClientGoalHandle<ActionT>;
/// Function type for creating a goal.
using CreateGoalHandler =
std::function<Goal(std::shared_ptr<yasmin::blackboard::Blackboard>)>;
/// Function type for handling results.
using ResultHandler = std::function<std::string(
std::shared_ptr<yasmin::blackboard::Blackboard>,
Result)>; ///< Function type for handling results.
using FeedbackHandler = std::function<void(
std::shared_ptr<yasmin::blackboard::Blackboard>,
std::shared_ptr<const Feedback>)>; ///< Function type for handling
///< feedback.
std::shared_ptr<yasmin::blackboard::Blackboard>, Result)>;
/// Function type for handling feedback.
using FeedbackHandler =
std::function<void(std::shared_ptr<yasmin::blackboard::Blackboard>,
std::shared_ptr<const Feedback>)>;

public:
/**
Expand Down
2 changes: 1 addition & 1 deletion yasmin_ros/include/yasmin_ros/basic_outcomes.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions yasmin_ros/include/yasmin_ros/monitor_state.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ namespace yasmin_ros {
*/
template <typename MsgT> class MonitorState : public yasmin::State {

/// Function type for handling messages from topic.
using MonitorHandler = std::function<std::string(
std::shared_ptr<yasmin::blackboard::Blackboard>, std::shared_ptr<MsgT>)>;

Expand Down
6 changes: 5 additions & 1 deletion yasmin_ros/include/yasmin_ros/service_state.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,15 @@ namespace yasmin_ros {
* @tparam ServiceT The type of the ROS 2 service this state interacts with.
*/
template <typename ServiceT> 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<Request(std::shared_ptr<yasmin::blackboard::Blackboard>)>;
/// Function type for handling a response.
using ResponseHandler = std::function<std::string(
std::shared_ptr<yasmin::blackboard::Blackboard>, Response)>;

Expand Down
7 changes: 4 additions & 3 deletions yasmin_ros/include/yasmin_ros/yasmin_node.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,10 @@ class YasminNode : public rclcpp::Node {
}

private:
rclcpp::executors::MultiThreadedExecutor
executor; ///< Executor for managing multiple threads.
std::unique_ptr<std::thread> spin_thread; ///< Thread for spinning the node.
/// Executor for managing multiple threads.
rclcpp::executors::MultiThreadedExecutor executor;
/// Thread for spinning the node.
std::unique_ptr<std::thread> spin_thread;
};

} // namespace yasmin_ros
Expand Down
17 changes: 10 additions & 7 deletions yasmin_viewer/include/yasmin_viewer/yasmin_viewer_pub.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,17 @@ class YasminViewerPub {
void publish_data();

private:
rclcpp::Node::SharedPtr node_; ///< Shared pointer to the ROS 2 node.
rclcpp::Publisher<yasmin_msgs::msg::StateMachine>::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<yasmin_msgs::msg::StateMachine>::SharedPtr publisher;
/// Timer for periodic publishing.
rclcpp::TimerBase::SharedPtr timer;

std::string fsm_name; ///< Name of the finite state machine.
std::shared_ptr<yasmin::StateMachine>
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<yasmin::StateMachine> fsm;
};

} // namespace yasmin_viewer
Expand Down

0 comments on commit d5d998e

Please sign in to comment.