Skip to content
Snippets Groups Projects
Commit 4d358a60 authored by Shivang Patel's avatar Shivang Patel
Browse files

Add doxygen doc in nav2_lifecycle_manager header files

parent a03b3e40
No related branches found
No related tags found
No related merge requests found
......@@ -31,11 +31,20 @@ namespace nav2_lifecycle_manager
{
using nav2_msgs::srv::ManageLifecycleNodes;
/**
* @class nav2_lifecycle_manager::LifecycleManager
* @brief Implements lifecycle node manager service
*/
class LifecycleManager : public rclcpp::Node
{
public:
/**
* @brief A constructor for nav2_lifecycle_manager::LifecycleManager
*/
LifecycleManager();
/**
* @brief A destructor for nav2_lifecycle_manager::LifecycleManager
*/
~LifecycleManager();
protected:
......@@ -45,38 +54,84 @@ protected:
// The services provided by this node
rclcpp::Service<ManageLifecycleNodes>::SharedPtr manager_srv_;
rclcpp::Service<std_srvs::srv::Trigger>::SharedPtr is_active_srv_;
/**
* @brief Lifecycle node manager callback function
* @param request_header Header of the service request
* @param request Service request
* @param reponse Service response
*/
void managerCallback(
const std::shared_ptr<rmw_request_id_t> request_header,
const std::shared_ptr<ManageLifecycleNodes::Request> request,
std::shared_ptr<ManageLifecycleNodes::Response> response);
/**
* @brief Trigger callback funcition checks if the system is active or not
* @param request_header Header of the request
* @param request Service request
* @param reponse Service response
*/
void isActiveCallback(
const std::shared_ptr<rmw_request_id_t> request_header,
const std::shared_ptr<std_srvs::srv::Trigger::Request> request,
std::shared_ptr<std_srvs::srv::Trigger::Response> response);
// Support functions for the service calls
/**
* @brief Start up manage nodes.
* @return true or false
*/
bool startup();
/**
* @brief Deactivates, clean up and shutdown all the manage nodes.
* @return true or false
*/
bool shutdown();
/**
* @brief Reset all the manage nodes.
* @return true or false
*/
bool reset();
/**
* @brief Pause all the manage nodes.
* @return true or false
*/
bool pause();
/**
* @brief Resume all the manage nodes.
* @return true or false
*/
bool resume();
// Support function for creating service clients
/**
* @brief Support function for creating service clients
*/
void createLifecycleServiceClients();
// Support functions for shutdown
/**
* @brief Support function for shutdown
*/
void shutdownAllNodes();
/**
* @brief Destroy all the lifecycle service clients.
*/
void destroyLifecycleServiceClients();
// For a node, transition to the new target state
/**
* @brief For a node, transition to the new target state
*/
bool changeStateForNode(const std::string & node_name, std::uint8_t transition);
// For each node in the map, transition to the new target state
/**
* @brief For each node in the map, transition to the new target state
*/
bool changeStateForAllNodes(std::uint8_t transition, bool reverse_order = false);
// Convenience function to highlight the output on the console
/**
* @brief Helper function to highlight the output on the console
*/
void message(const std::string & msg);
// A map of all nodes to be controlled
......
......@@ -29,30 +29,80 @@
namespace nav2_lifecycle_manager
{
/**
* @enum nav2_lifecycle_manager::SystemStatus
* @brief Enum class representing the status of the system.
*/
enum class SystemStatus {ACTIVE, INACTIVE, TIMEOUT};
/**
* @class nav2_lifecycle_manager::LifeCycleMangerClient
* @brief Implements lifecycle manager service client and NavigateToPose action
* client
*/
class LifecycleManagerClient
{
public:
/**
* @brief A constructor for LifeCycleMangerClient
*/
LifecycleManagerClient();
// Client-side interface to the Nav2 lifecycle manager
/**
* @brief Makes start up service call
* @return true or false
*/
bool startup();
/**
* @brief Makes shutdown service call
* @return true or false
*/
bool shutdown();
/**
* @brief Makes pause service call
* @return true or false
*/
bool pause();
/**
* @brief Makes resume service call
* @return true or false
*/
bool resume();
/**
* @brief Makes reset service call
* @return true or false
*/
bool reset();
/**
* @brief Checks if lifecycle node manager server is active
* @return ACTIVE or INACTIVE or TIMEOUT
*/
SystemStatus is_active(const std::chrono::nanoseconds timeout = std::chrono::nanoseconds(-1));
// A couple convenience methods to facilitate scripting tests
/**
* @brief Sets initial pose with covariance
* @param x X position
* @param y Y position
* @param theta orientation
*/
void set_initial_pose(double x, double y, double theta);
/**
* @brief Sends goal pose to NavigationToPose action server
* @param x X position
* @param y Y position
* @param theta orientation
* @return true or false
*/
bool navigate_to_pose(double x, double y, double theta);
protected:
using ManageLifecycleNodes = nav2_msgs::srv::ManageLifecycleNodes;
// A generic method used to call startup, shutdown, etc.
/**
* @brief A generic method used to call startup, shutdown, etc.
* @param command
*/
bool callService(uint8_t command);
// The node to use for the service call
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment