Skip to content

Expose timeout option for parameter service calls by SyncParametersClient #360

Closed

Description

@dhood

As an example, SyncParametersClient::set_parameters doesn't take a timeout option. So, if anything goes wrong in the service call (e.g. the server goes down), we will get stuck waiting indefinitely.

Exposing a timout that is set to -1 by default (as is done for SyncParametersClient::wait_for_service) would be appropriate.

Parameter tests in test_rclcpp (e.g. this one) should be updated to specify a timeout, so that the other tests in the file can be run even if one of them hangs.

Activity

  1. wjwwood commented on Mar 19, 2020

    @wjwwood
    Member

    Updated link:

    std::vector<rcl_interfaces::msg::SetParametersResult>
    SyncParametersClient::set_parameters(
    const std::vector<rclcpp::Parameter> & parameters)
    {
    auto f = async_parameters_client_->set_parameters(parameters);
    using rclcpp::executors::spin_node_until_future_complete;
    if (
    spin_node_until_future_complete(
    *executor_, node_base_interface_,
    f) == rclcpp::executor::FutureReturnCode::SUCCESS)
    {
    return f.get();
    }
    return std::vector<rcl_interfaces::msg::SetParametersResult>();
    }

  2. fujitatomoya commented on Dec 22, 2020

    @fujitatomoya
    Collaborator

    @wjwwood

    thanks for the review, i think we can close this.

  3. added a commit that references this issue on Aug 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions