-
Notifications
You must be signed in to change notification settings - Fork 310
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add to support restart operations in switch_controller by specifying …
…the same controller name in the start/stop requests
- Loading branch information
1 parent
0115236
commit 6b447b2
Showing
11 changed files
with
1,340 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 74 additions & 0 deletions
74
controller_manager/test/test_controller_with_command/test_controller_with_command.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
// Copyright 2024 Tokyo Robotics Inc. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#include "test_controller_with_command.hpp" | ||
|
||
#include <memory> | ||
#include <string> | ||
|
||
#include "lifecycle_msgs/msg/transition.hpp" | ||
|
||
namespace test_controller_with_command | ||
{ | ||
TestControllerWithCommand::TestControllerWithCommand() : controller_interface::ControllerInterface() | ||
{ | ||
} | ||
|
||
rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn | ||
TestControllerWithCommand::on_init() | ||
{ | ||
return rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn::SUCCESS; | ||
} | ||
|
||
controller_interface::return_type TestControllerWithCommand::update( | ||
const rclcpp::Time & /*time*/, const rclcpp::Duration & /*period*/) | ||
{ | ||
return controller_interface::return_type::OK; | ||
} | ||
|
||
rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn | ||
TestControllerWithCommand::on_configure(const rclcpp_lifecycle::State & /*previous_state&*/) | ||
{ | ||
return rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn::SUCCESS; | ||
} | ||
|
||
rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn | ||
TestControllerWithCommand::on_activate(const rclcpp_lifecycle::State & /*previous_state*/) | ||
{ | ||
simulate_command = SIMULATE_COMMAND_ACTIVATE_VALUE; | ||
++activate_calls; | ||
return rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn::SUCCESS; | ||
} | ||
|
||
rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn | ||
TestControllerWithCommand::on_deactivate(const rclcpp_lifecycle::State & /*previous_state*/) | ||
{ | ||
simulate_command = SIMULATE_COMMAND_DEACTIVATE_VALUE; | ||
++deactivate_calls; | ||
return rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn::SUCCESS; | ||
} | ||
|
||
rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn | ||
TestControllerWithCommand::on_cleanup(const rclcpp_lifecycle::State & /*previous_state*/) | ||
{ | ||
return rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn::SUCCESS; | ||
} | ||
|
||
} // namespace test_controller_with_command | ||
|
||
#include "pluginlib/class_list_macros.hpp" | ||
|
||
PLUGINLIB_EXPORT_CLASS( | ||
test_controller_with_command::TestControllerWithCommand, | ||
controller_interface::ControllerInterface) |
Oops, something went wrong.