ros2 / ros2/rclcpp

SyncParametersClient can't be used in component node

Open
#1,553 2 comments 0 reactions 1 assignee View on GitHub

@mabelzhang is already working on this.

Since Mar 9, 2021.

Dominant language
C++
Stars
805
Forks
564
Avg merge
1d 17h
Merged PRs (30d)
27

Description

Because SyncParametersClient calls spin_until_future_complete it can't be used in component nodes.

A workaround for this might be to have some way of discovering if the node is a component and then just calling get() on the future instead of trying to spin the node (as the Node should already be added to an executor and executing). Another option would be to leave spinning the Node on an executor up to the implementer of the Node (expect they are spinning it already when they call methods like set_parameters) and change the implementation of SyncParametersClient to block forever (by waiting on the future) if the user failed to start the executor on a separate thread first.

This workaround might not work during initialization if the component manager doesn't start the executor on a separate thread before loading the component nodes.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.