We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Required Info:
Parameter Server code
#include <chrono> #include <iostream> #include <memory> #include <vector> #include <rclcpp/rclcpp.hpp> int main(int argc, char *argv[]) { rclcpp::init(argc, argv); rclcpp::executors::SingleThreadedExecutor executor; auto node = std::make_shared<rclcpp::Node>("param_test_server_node"); auto test_param = "test_param"; rcl_interfaces::msg::ParameterDescriptor descriptor; descriptor.read_only = false; node->declare_parameter(test_param, rclcpp::ParameterValue(10), descriptor); executor.add_node(node); node->set_on_parameters_set_callback([&](const std::vector<rclcpp::Parameter> & parameters) { rcl_interfaces::msg::SetParametersResult result; std::cout << "set_parameter callback is called" << std::endl; result.successful = true; for (const auto & parameter : parameters) { if (parameter.get_name() == test_param) { std::cout << test_param << " " << parameter.value_to_string() << std::endl; } } std::this_thread::sleep_for(std::chrono::seconds(100)); // To reproduce the issue return result; }); executor.spin(); rclcpp::shutdown(); return 0; }
Parameter Client code
#include <chrono> #include <iostream> #include <memory> #include <vector> #include <rclcpp/rclcpp.hpp> int main(int argc, char *argv[]) { rclcpp::init(argc, argv); auto remote_node = "/param_test_server_node"; auto test_param = "test_param"; auto exec = std::make_shared<rclcpp::executors::SingleThreadedExecutor>() ; auto node = std::make_shared<rclcpp::Node>("param_test_client"); std::this_thread::sleep_for(std::chrono::seconds(1)); auto parameters_client = std::make_shared<rclcpp::SyncParametersClient>(exec, node, remote_node); while (!parameters_client->wait_for_service(std::chrono::seconds(1))) { if (!rclcpp::ok()) { RCLCPP_ERROR(node->get_logger(), "interrupted, exit!"); rclcpp::shutdown(); return 0; } RCLCPP_INFO(node->get_logger(), "wait for service"); } auto timer_callback = [&]() -> void { RCLCPP_INFO(node->get_logger(), "Timer expired"); exec->cancel(); }; auto timer = node->create_wall_timer(std::chrono::seconds(5), timer_callback); std::vector<rclcpp::Parameter> set_params; set_params.emplace_back(test_param, 50); auto results = parameters_client->set_parameters(set_params); for (auto &result : results) RCLCPP_INFO(node->get_logger(), "result: %d", result.successful); RCLCPP_INFO(node->get_logger(), "done"); timer->cancel(); rclcpp::shutdown(); return 0; }
Although set_parameters is not finished successfully, if executor is canceled then set_parameters must be finished.
set_parameter callback is called test_param 50 [INFO] [1583914754.708738050] [param_test_client]: Timer expired [INFO] [1583914754.709483787] [param_test_client]: done
set_parameters does not finished although executor is cancled.
set_parameter callback is called test_param 50 [INFO] [1583914837.349401253] [param_test_client]: Timer expired [INFO] [1583914842.349311295] [param_test_client]: Timer expired
The text was updated successfully, but these errors were encountered:
fix: splitting by time feature (ros2#1022)
ad484ba
style: fix diff style: remove additional spaces style: typo fix: added missing input parameter refactor: make variable private refactor: fix linting error fix: Add missing initialization style: linter refactor: invert logic Signed-off-by: Kaju Bubanja <bubanja.kaju@gmail.com>
wjwwood
No branches or pull requests
Bug report
Required Info:
Steps to reproduce issue
Parameter Server code
Parameter Client code
Expected behavior
Although set_parameters is not finished successfully, if executor is canceled then set_parameters must be finished.
set_parameter callback is called test_param 50 [INFO] [1583914754.708738050] [param_test_client]: Timer expired [INFO] [1583914754.709483787] [param_test_client]: done
Actual behavior
set_parameters does not finished although executor is cancled.
The text was updated successfully, but these errors were encountered: