Skip to content

Commit

Permalink
Revert "Add configure and cleanup transitions to lifecycle manager an…
Browse files Browse the repository at this point in the history
…d client (#4371)"

This reverts commit 06ec958.
  • Loading branch information
SteveMacenski committed Aug 23, 2024
1 parent 8369712 commit c86b1a9
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 70 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,16 +93,6 @@ class LifecycleManager : public rclcpp::Node
* @return true or false
*/
bool startup();
/**
* @brief Configures the managed nodes.
* @return true or false
*/
bool configure();
/**
* @brief Cleanups the managed nodes
* @return true or false
*/
bool cleanup();
/**
* @brief Deactivate, clean up and shut down all the managed nodes.
* @return true or false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,6 @@ class LifecycleManagerClient
* @return true or false
*/
bool reset(const std::chrono::nanoseconds timeout = std::chrono::nanoseconds(-1));
/**
* @brief Make configure service call
* @return true or false
*/
bool configure(const std::chrono::nanoseconds timeout = std::chrono::nanoseconds(-1));
/**
* @brief Make cleanup service call
* @return true or false
*/
bool cleanup(const std::chrono::nanoseconds timeout = std::chrono::nanoseconds(-1));
/**
* @brief Check if lifecycle node manager server is active
* @return ACTIVE or INACTIVE or TIMEOUT
Expand Down
34 changes: 0 additions & 34 deletions nav2_lifecycle_manager/src/lifecycle_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,6 @@ LifecycleManager::managerCallback(
case ManageLifecycleNodes::Request::STARTUP:
response->success = startup();
break;
case ManageLifecycleNodes::Request::CONFIGURE:
response->success = configure();
break;
case ManageLifecycleNodes::Request::CLEANUP:
response->success = cleanup();
break;
case ManageLifecycleNodes::Request::RESET:
response->success = reset();
break;
Expand Down Expand Up @@ -297,34 +291,6 @@ LifecycleManager::startup()
return true;
}

bool
LifecycleManager::configure()
{
message("Configuring managed nodes...");
if (!changeStateForAllNodes(Transition::TRANSITION_CONFIGURE)) {
RCLCPP_ERROR(get_logger(), "Failed to configure all requested nodes. Aborting bringup.");
managed_nodes_state_ = NodeState::UNKNOWN;
return false;
}
message("Managed nodes are now configured");
managed_nodes_state_ = NodeState::INACTIVE;
return true;
}

bool
LifecycleManager::cleanup()
{
message("Cleaning up managed nodes...");
if (!changeStateForAllNodes(Transition::TRANSITION_CLEANUP)) {
RCLCPP_ERROR(get_logger(), "Failed to cleanup all requested nodes. Aborting cleanup.");
managed_nodes_state_ = NodeState::UNKNOWN;
return false;
}
message("Managed nodes have been cleaned up");
managed_nodes_state_ = NodeState::UNCONFIGURED;
return true;
}

bool
LifecycleManager::shutdown()
{
Expand Down
12 changes: 0 additions & 12 deletions nav2_lifecycle_manager/src/lifecycle_manager_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,18 +73,6 @@ LifecycleManagerClient::reset(const std::chrono::nanoseconds timeout)
return callService(ManageLifecycleNodes::Request::RESET, timeout);
}

bool
LifecycleManagerClient::configure(const std::chrono::nanoseconds timeout)
{
return callService(ManageLifecycleNodes::Request::CONFIGURE, timeout);
}

bool
LifecycleManagerClient::cleanup(const std::chrono::nanoseconds timeout)
{
return callService(ManageLifecycleNodes::Request::CLEANUP, timeout);
}

SystemStatus
LifecycleManagerClient::is_active(const std::chrono::nanoseconds timeout)
{
Expand Down
2 changes: 0 additions & 2 deletions nav2_lifecycle_manager/test/test_lifecycle_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,6 @@ TEST(LifecycleClientTest, BasicTest)
client.is_active(std::chrono::nanoseconds(1000000000)));
EXPECT_TRUE(client.resume());
EXPECT_TRUE(client.reset());
EXPECT_TRUE(client.configure());
EXPECT_TRUE(client.cleanup());
EXPECT_TRUE(client.shutdown());
}

Expand Down
2 changes: 0 additions & 2 deletions nav2_msgs/srv/ManageLifecycleNodes.srv
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ uint8 PAUSE = 1
uint8 RESUME = 2
uint8 RESET = 3
uint8 SHUTDOWN = 4
uint8 CONFIGURE = 5
uint8 CLEANUP = 6

uint8 command
---
Expand Down

0 comments on commit c86b1a9

Please sign in to comment.